Platform image/texture backend GuiImageData and GuiImage delegate to. More...
#include <VideoDriver.h>
Public Member Functions | |
| virtual void * | createTexture (int width, int height)=0 |
| Allocates an empty hardware-aligned texture buffer. | |
| virtual void | loadTextureData (void *texture, const uint8_t *rgba, int width, int height)=0 |
| Loads raw RGBA8 pixels into the pre-allocated texture. | |
| virtual bool | canReuseTexture (int allocWidth, int allocHeight, int width, int height) const |
| Whether a texture allocated for allocWidth x allocHeight can be reloaded in place. | |
| virtual void | destroyTexture (void *texture)=0 |
| Destroys a texture created by createTexture. | |
| virtual void | drawTexture (void *texture, float xpos, float ypos, uint16_t width, uint16_t height, float degrees, float scaleX, float scaleY, uint8_t alpha)=0 |
| Draws a texture created by createTexture. | |
| virtual void | drawRectangle (float x, float y, float width, float height, PixelColor color)=0 |
| Draws a solid-color rectangle (alpha-blended using color.a). | |
| virtual void | drawMesh (const MeshVertex *vertices, size_t count)=0 |
| Draws a triangle list: three vertices per triangle, each with its own color. | |
| virtual void * | createMesh (const MeshVertex *vertices, size_t count) |
| Hands a triangle list to the backend to keep in its own ready-to-draw form (a GX display list, a GX2 vertex buffer), so drawing it again with drawMeshInstance() costs the CPU almost nothing, where drawMesh() sends every vertex every time. | |
| virtual void | destroyMesh (void *mesh) |
| Releases a mesh from createMesh(). | |
| virtual void | drawMeshInstance (void *mesh, float x, float y, float scaleX, float scaleY) |
| Draws a mesh from createMesh() fully opaque, as its vertex colors say. | |
Platform image/texture backend GuiImageData and GuiImage delegate to.
Exactly one driver implements this and assigns the single global instance below. GuiImageData/GuiImage never touch any platform texture type directly, only imageSystem.
Definition at line 71 of file VideoDriver.h.
|
inlinevirtual |
Whether a texture allocated for allocWidth x allocHeight can be reloaded in place.
Reimplemented in WutImageRenderer.
Definition at line 80 of file VideoDriver.h.
|
inlinevirtual |
Hands a triangle list to the backend to keep in its own ready-to-draw form (a GX display list, a GX2 vertex buffer), so drawing it again with drawMeshInstance() costs the CPU almost nothing, where drawMesh() sends every vertex every time.
Same vertex rules as drawMesh(); the vertices are copied. Call while drawing, since a backend may record from its current render state.
Reimplemented in OgcImageRenderer, and WutImageRenderer.
Definition at line 108 of file VideoDriver.h.
|
pure virtual |
Allocates an empty hardware-aligned texture buffer.
Implemented in OgcImageRenderer, and WutImageRenderer.
|
inlinevirtual |
Releases a mesh from createMesh().
Safe to call while draws that use it are still waiting to be submitted; the backend keeps it until they are done.
Reimplemented in OgcImageRenderer, and WutImageRenderer.
Definition at line 111 of file VideoDriver.h.
|
pure virtual |
Destroys a texture created by createTexture.
Implemented in OgcImageRenderer, and WutImageRenderer.
|
pure virtual |
Draws a triangle list: three vertices per triangle, each with its own color.
Positions are in design-canvas pixels (the same space as drawRectangle()), colors are straight (non-premultiplied) RGBA blended source-over, so per-vertex alpha gives gradients and soft edges (see GuiMesh). Winding does not matter. A count that is not a multiple of 3 is rounded down. The vertices are copied (or consumed) before this returns, so the caller can free or reuse the array immediately.
| vertices | Triangle list |
| count | Number of vertices |
Implemented in OgcImageRenderer, and WutImageRenderer.
|
inlinevirtual |
Draws a mesh from createMesh() fully opaque, as its vertex colors say.
Mesh vertex (vx, vy) lands at (x + vx * scaleX, y + vy * scaleY) in design-canvas pixels.
| mesh | Handle from createMesh() |
| x | Where mesh (0,0) lands |
| y | Where mesh (0,0) lands |
| scaleX | Horizontal stretch about (x,y) |
| scaleY | Vertical stretch about (x,y) |
Reimplemented in OgcImageRenderer, and WutImageRenderer.
Definition at line 119 of file VideoDriver.h.
|
pure virtual |
Draws a solid-color rectangle (alpha-blended using color.a).
Implemented in OgcImageRenderer, and WutImageRenderer.
|
pure virtual |
Draws a texture created by createTexture.
Implemented in OgcImageRenderer, and WutImageRenderer.
|
pure virtual |
Loads raw RGBA8 pixels into the pre-allocated texture.
Implemented in OgcImageRenderer, and WutImageRenderer.