#include <painter_surface_gl.hpp>
A PainterSurfaceGL is the implementatin of PainterSurface for the GL backend. A PainterSurfaceGL must only be used with at most one GL context (even GL contexts in the same share group cannot shader PainterSurfaceGL objects).
Definition at line 43 of file painter_surface_gl.hpp.
◆ PainterSurfaceGL() [1/2]
Ctor. Creates and uses a backing color texture. The viewport() is initialized to be exactly the entire backing store.
- Parameters
-
◆ PainterSurfaceGL() [2/2]
Ctor. Use the passed GL texture to which to render content; the gl_texture must have as its texture target GL_TEXTURE_2D and must already have its backing store allocated (i.e. glTexImage or glTexStorage has been called on the texture). The texture object's ownership is NOT passed to the PainterSurfaceGL, the caller is still responible to delete the texture (with GL) and the texture must not be deleted (or have its backing store changed via glTexImage) until the PainterSurfaceGL is deleted. The viewport() is initialized to be exactly the entire backing store.
- Parameters
-
dims | width and height of the GL texture |
gl_texture | GL name of texture |
backend | the PainterEngineGL that produces Painter Backend objects can use the created PainterSurfaceGL |
render_type | the render type of the surface (i.e. is it a color buffer or deferred coverage buffer) |
◆ blit_surface() [1/2]
void fastuidraw::gl::PainterSurfaceGL::blit_surface |
( |
const Viewport & |
src, |
|
|
const Viewport & |
dst, |
|
|
GLenum |
filter = GL_NEAREST |
|
) |
| const |
Blit the PainterSurfaceGL color buffer to the FBO currently bound to GL_DRAW_FRAMEBUFFER.
- Parameters
-
src | source from this PainterSurfaceGL to which to bit |
dst | destination in FBO to which to blit |
filter | GL filter to apply to blit operation |
◆ blit_surface() [2/2]
void fastuidraw::gl::PainterSurfaceGL::blit_surface |
( |
GLenum |
filter = GL_NEAREST | ) |
const |
Provided as a convenience, equivalent to
- Parameters
-
filter | GL filter to apply to blit operation |
◆ clear_color() [1/2]
virtual const vec4& fastuidraw::gl::PainterSurfaceGL::clear_color |
( |
void |
| ) |
const |
|
finaloverridevirtual |
◆ clear_color() [2/2]
virtual void fastuidraw::gl::PainterSurfaceGL::clear_color |
( |
const vec4 & |
| ) |
|
|
finaloverridevirtual |
◆ dimensions()
virtual ivec2 fastuidraw::gl::PainterSurfaceGL::dimensions |
( |
void |
| ) |
const |
|
finaloverridevirtual |
To be implemented by a derived class to return the dimensions of the Surface backing store.
Implements fastuidraw::PainterSurface.
◆ image()
◆ opaque_data()
void* fastuidraw::gl::PainterSurfaceGL::opaque_data |
( |
void |
| ) |
const |
|
inline |
Used internally by the GL backend; do not touch the data behind the void pointer.
Definition at line 127 of file painter_surface_gl.hpp.
◆ render_type()
virtual enum render_type_t fastuidraw::gl::PainterSurfaceGL::render_type |
( |
void |
| ) |
const |
|
finaloverridevirtual |
To be implemented by a derived class to return the surface type of the Surface (i.e. is it a color buffer or a deferred coverage buffer).
Implements fastuidraw::PainterSurface.
◆ texture()
GLuint fastuidraw::gl::PainterSurfaceGL::texture |
( |
void |
| ) |
const |
Returns the GL name of the texture backing the color buffer of the PainterSurfaceGL.
◆ viewport() [1/2]
virtual const Viewport& fastuidraw::gl::PainterSurfaceGL::viewport |
( |
void |
| ) |
const |
|
finaloverridevirtual |
◆ viewport() [2/2]
virtual void fastuidraw::gl::PainterSurfaceGL::viewport |
( |
const Viewport & |
vwp | ) |
|
|
finaloverridevirtual |
To be implemented by a derived class to set the viewport into the surface. The viewport cannot be changed while the Surface is in use by a Painter Backend or Painter.
- Parameters
-
vwp | new viewport into the surface to use |
Implements fastuidraw::PainterSurface.
The documentation for this class was generated from the following file: