| 
    KiCad PCB EDA Suite
    
   | 
 
#include <opengl_compositor.h>
  
Classes | |
| struct | OPENGL_BUFFER | 
Public Member Functions | |
| OPENGL_COMPOSITOR () | |
| virtual | ~OPENGL_COMPOSITOR () | 
| virtual void | Initialize () override | 
| Perform primary initialization, necessary to use the object.      | |
| virtual void | Resize (unsigned int aWidth, unsigned int aHeight) override | 
| Clear the state of COMPOSITOR, so it has to be reinitialized again with the new dimensions.      | |
| virtual unsigned int | CreateBuffer () override | 
| Prepare a new buffer that may be used as a rendering target.      | |
| virtual void | SetBuffer (unsigned int aBufferHandle) override | 
| Set the selected buffer as the rendering target.      | |
| virtual unsigned int | GetBuffer () const override | 
| Return currently used buffer handle.      | |
| virtual void | ClearBuffer (const COLOR4D &aColor) override | 
| Clear the selected buffer (set by the SetBuffer() function).      | |
| virtual void | DrawBuffer (unsigned int aBufferHandle) override | 
| Draw the selected buffer to the output buffer.      | |
| virtual void | Begin () override | 
| Call this at the beginning of each frame.      | |
| virtual void | Present () override | 
| Call this to present the output buffer to the screen.   | |
| VECTOR2I | GetScreenSize () const | 
| GLenum | GetBufferTexture (unsigned int aBufferHandle) | 
| void | DrawBuffer (unsigned int aSourceHandle, unsigned int aDestHandle) | 
| unsigned int | CreateBuffer (VECTOR2I aDimensions) | 
| void | SetAntialiasingMode (GAL_ANTIALIASING_MODE aMode) | 
| GAL_ANTIALIASING_MODE | GetAntialiasingMode () const | 
| int | GetAntialiasSupersamplingFactor () const | 
| VECTOR2D | GetAntialiasRenderingOffset () const | 
Static Public Attributes | |
| static const unsigned int | DIRECT_RENDERING = 0 | 
Protected Types | |
| typedef std::deque< OPENGL_BUFFER > | OPENGL_BUFFERS | 
Protected Member Functions | |
| void | bindFb (unsigned int aFb) | 
| Binds a specific Framebuffer Object.   | |
| void | clean () | 
| Perform freeing of resources.   | |
| unsigned int | usedBuffers () | 
| Returns number of used buffers.   | |
Protected Attributes | |
| bool | m_initialized | 
| Initialization status flag.   | |
| unsigned int | m_curBuffer | 
| Currently used buffer handle.   | |
| GLuint | m_mainFbo | 
| Main FBO handle (storing all target textures)   | |
| GLuint | m_depthBuffer | 
| Depth buffer handle.   | |
| OPENGL_BUFFERS | m_buffers | 
| Stores information about initialized buffers.   | |
| GLuint | m_curFbo | 
| Store the used FBO name in case there was more than one compositor used.   | |
| GAL_ANTIALIASING_MODE | m_currentAntialiasingMode | 
| std::unique_ptr< OPENGL_PRESENTOR > | m_antialiasing | 
| unsigned int | m_width | 
| Width of the buffer (in pixels)   | |
| unsigned int | m_height | 
| Height of the buffer (in pixels)   | |
Definition at line 46 of file opengl_compositor.h.
      
  | 
  protected | 
Definition at line 126 of file opengl_compositor.h.
| OPENGL_COMPOSITOR::OPENGL_COMPOSITOR | ( | ) | 
Definition at line 46 of file opengl_compositor.cpp.
References KIGFX::AA_NONE, DIRECT_RENDERING, m_antialiasing, m_curBuffer, m_curFbo, m_currentAntialiasingMode, m_depthBuffer, m_initialized, and m_mainFbo.
      
  | 
  virtual | 
Definition at line 58 of file opengl_compositor.cpp.
References clean(), and m_initialized.
      
  | 
  overridevirtual | 
Call this at the beginning of each frame.
Implements KIGFX::COMPOSITOR.
Definition at line 306 of file opengl_compositor.cpp.
References m_antialiasing.
      
  | 
  protected | 
Binds a specific Framebuffer Object.
Definition at line 370 of file opengl_compositor.cpp.
References checkGlError(), DIRECT_RENDERING, m_curFbo, and m_mainFbo.
Referenced by clean(), CreateBuffer(), Initialize(), and SetBuffer().
      
  | 
  protected | 
Perform freeing of resources.
Definition at line 384 of file opengl_compositor.cpp.
References bindFb(), DIRECT_RENDERING, m_buffers, m_depthBuffer, m_initialized, and m_mainFbo.
Referenced by Resize(), SetAntialiasingMode(), and ~OPENGL_COMPOSITOR().
      
  | 
  overridevirtual | 
Clear the selected buffer (set by the SetBuffer() function).
Implements KIGFX::COMPOSITOR.
Definition at line 287 of file opengl_compositor.cpp.
References KIGFX::COLOR4D::b, DIRECT_RENDERING, KIGFX::COLOR4D::g, m_curFbo, m_initialized, and KIGFX::COLOR4D::r.
Referenced by CreateBuffer().
      
  | 
  overridevirtual | 
Prepare a new buffer that may be used as a rendering target.
Implements KIGFX::COMPOSITOR.
Definition at line 157 of file opengl_compositor.cpp.
References m_antialiasing.
| unsigned int OPENGL_COMPOSITOR::CreateBuffer | ( | VECTOR2I | aDimensions | ) | 
Definition at line 163 of file opengl_compositor.cpp.
References bindFb(), KIGFX::COLOR4D::BLACK, checkGlError(), ClearBuffer(), DIRECT_RENDERING, m_buffers, m_initialized, m_mainFbo, usedBuffers(), VECTOR2< T >::x, and VECTOR2< T >::y.
      
  | 
  overridevirtual | 
Draw the selected buffer to the output buffer.
| aBufferHandle | is the handle of the buffer to be drawn. | 
Implements KIGFX::COMPOSITOR.
Definition at line 312 of file opengl_compositor.cpp.
References m_antialiasing.
| void OPENGL_COMPOSITOR::DrawBuffer | ( | unsigned int | aSourceHandle, | 
| unsigned int | aDestHandle ) | 
Definition at line 318 of file opengl_compositor.cpp.
References m_buffers, m_initialized, SetBuffer(), and usedBuffers().
| GAL_ANTIALIASING_MODE OPENGL_COMPOSITOR::GetAntialiasingMode | ( | ) | const | 
Definition at line 84 of file opengl_compositor.cpp.
References m_currentAntialiasingMode.
| VECTOR2D OPENGL_COMPOSITOR::GetAntialiasRenderingOffset | ( | ) | const | 
Definition at line 414 of file opengl_compositor.cpp.
References KIGFX::AA_HIGHQUALITY, and m_currentAntialiasingMode.
| int OPENGL_COMPOSITOR::GetAntialiasSupersamplingFactor | ( | ) | const | 
Definition at line 405 of file opengl_compositor.cpp.
References KIGFX::AA_HIGHQUALITY, and m_currentAntialiasingMode.
      
  | 
  inlineoverridevirtual | 
Return currently used buffer handle.
Implements KIGFX::COMPOSITOR.
Definition at line 65 of file opengl_compositor.h.
References DIRECT_RENDERING, m_curBuffer, and m_curFbo.
| GLenum OPENGL_COMPOSITOR::GetBufferTexture | ( | unsigned int | aBufferHandle | ) | 
Definition at line 257 of file opengl_compositor.cpp.
References m_buffers, and usedBuffers().
| VECTOR2I OPENGL_COMPOSITOR::GetScreenSize | ( | ) | const | 
Definition at line 296 of file opengl_compositor.cpp.
References KIGFX::COMPOSITOR::m_height, and KIGFX::COMPOSITOR::m_width.
Referenced by SetBuffer().
      
  | 
  overridevirtual | 
Perform primary initialization, necessary to use the object.
Implements KIGFX::COMPOSITOR.
Definition at line 90 of file opengl_compositor.cpp.
References KIGFX::AA_FAST, KIGFX::AA_HIGHQUALITY, bindFb(), checkGlError(), DIRECT_RENDERING, m_antialiasing, m_currentAntialiasingMode, m_depthBuffer, m_initialized, m_mainFbo, VECTOR2< T >::x, and VECTOR2< T >::y.
      
  | 
  overridevirtual | 
Call this to present the output buffer to the screen.
Implements KIGFX::COMPOSITOR.
Definition at line 364 of file opengl_compositor.cpp.
References m_antialiasing.
      
  | 
  overridevirtual | 
Clear the state of COMPOSITOR, so it has to be reinitialized again with the new dimensions.
| aWidth | is the framebuffer width (in pixels). | 
| aHeight | is the framebuffer height (in pixels). | 
Implements KIGFX::COMPOSITOR.
Definition at line 145 of file opengl_compositor.cpp.
References clean(), m_antialiasing, KIGFX::COMPOSITOR::m_height, m_initialized, and KIGFX::COMPOSITOR::m_width.
| void OPENGL_COMPOSITOR::SetAntialiasingMode | ( | GAL_ANTIALIASING_MODE | aMode | ) | 
Definition at line 75 of file opengl_compositor.cpp.
References clean(), m_currentAntialiasingMode, and m_initialized.
      
  | 
  overridevirtual | 
Set the selected buffer as the rendering target.
All the following drawing functions are going to be rendered in the selected buffer.
| aBufferHandle | is the handle of the buffer or 0 in case of rendering directly to the display. | 
Implements KIGFX::COMPOSITOR.
Definition at line 264 of file opengl_compositor.cpp.
References bindFb(), checkGlError(), DIRECT_RENDERING, GetScreenSize(), m_buffers, m_curBuffer, m_curFbo, m_initialized, m_mainFbo, and usedBuffers().
Referenced by DrawBuffer().
      
  | 
  inlineprotected | 
Returns number of used buffers.
Definition at line 109 of file opengl_compositor.h.
References m_buffers.
Referenced by CreateBuffer(), DrawBuffer(), GetBufferTexture(), and SetBuffer().
      
  | 
  static | 
Definition at line 86 of file opengl_compositor.h.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), bindFb(), KIGFX::OPENGL_GAL::blitCursor(), clean(), ClearBuffer(), KIGFX::OPENGL_GAL::ClearScreen(), CreateBuffer(), KIGFX::ANTIALIASING_NONE::DrawBuffer(), GetBuffer(), Initialize(), OPENGL_COMPOSITOR(), KIGFX::ANTIALIASING_SMAA::Present(), KIGFX::ANTIALIASING_SUPERSAMPLING::Present(), and SetBuffer().
      
  | 
  protected | 
Definition at line 135 of file opengl_compositor.h.
Referenced by Begin(), CreateBuffer(), DrawBuffer(), Initialize(), OPENGL_COMPOSITOR(), Present(), and Resize().
      
  | 
  protected | 
Stores information about initialized buffers.
Definition at line 129 of file opengl_compositor.h.
Referenced by clean(), CreateBuffer(), DrawBuffer(), GetBufferTexture(), SetBuffer(), and usedBuffers().
      
  | 
  protected | 
Currently used buffer handle.
Definition at line 123 of file opengl_compositor.h.
Referenced by GetBuffer(), OPENGL_COMPOSITOR(), and SetBuffer().
      
  | 
  protected | 
Store the used FBO name in case there was more than one compositor used.
Definition at line 132 of file opengl_compositor.h.
Referenced by bindFb(), ClearBuffer(), GetBuffer(), OPENGL_COMPOSITOR(), and SetBuffer().
      
  | 
  protected | 
Definition at line 134 of file opengl_compositor.h.
Referenced by GetAntialiasingMode(), GetAntialiasRenderingOffset(), GetAntialiasSupersamplingFactor(), Initialize(), OPENGL_COMPOSITOR(), and SetAntialiasingMode().
      
  | 
  protected | 
Depth buffer handle.
Definition at line 125 of file opengl_compositor.h.
Referenced by clean(), Initialize(), and OPENGL_COMPOSITOR().
      
  | 
  protectedinherited | 
Height of the buffer (in pixels)
Definition at line 113 of file compositor.h.
Referenced by COMPOSITOR(), KIGFX::CAIRO_COMPOSITOR::CreateBuffer(), KIGFX::OPENGL_COMPOSITOR::GetScreenSize(), KIGFX::CAIRO_COMPOSITOR::Resize(), and KIGFX::OPENGL_COMPOSITOR::Resize().
      
  | 
  protected | 
Initialization status flag.
Definition at line 122 of file opengl_compositor.h.
Referenced by clean(), ClearBuffer(), CreateBuffer(), DrawBuffer(), Initialize(), OPENGL_COMPOSITOR(), Resize(), SetAntialiasingMode(), SetBuffer(), and ~OPENGL_COMPOSITOR().
      
  | 
  protected | 
Main FBO handle (storing all target textures)
Definition at line 124 of file opengl_compositor.h.
Referenced by bindFb(), clean(), CreateBuffer(), Initialize(), OPENGL_COMPOSITOR(), and SetBuffer().
      
  | 
  protectedinherited | 
Width of the buffer (in pixels)
Definition at line 112 of file compositor.h.
Referenced by COMPOSITOR(), KIGFX::CAIRO_COMPOSITOR::CreateBuffer(), KIGFX::OPENGL_COMPOSITOR::GetScreenSize(), KIGFX::CAIRO_COMPOSITOR::Resize(), and KIGFX::OPENGL_COMPOSITOR::Resize().