34 virtual void init(
int width,
int height) = 0;
78 virtual void loadTextureData(
void * texture,
const uint8_t * rgba,
int width,
int height) = 0;
80 virtual bool canReuseTexture(
int allocWidth,
int allocHeight,
int width,
int height)
const
82 return width <= allocWidth && height <= allocHeight;
87 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;
108 virtual void*
createMesh(
const MeshVertex* vertices,
size_t count) { (void)vertices; (void)count;
return nullptr; }
119 virtual void drawMeshInstance(
void* mesh,
float x,
float y,
float scaleX,
float scaleY) { (void)mesh; (void)x; (void)y; (void)scaleX; (void)scaleY; }
136 virtual void drawQuad(
void* texture, int16_t screenX, int16_t screenY, uint16_t width, uint16_t height,
const PixelColor& color) = 0;
138 virtual void drawFeature(int16_t screenX, int16_t screenY, uint16_t width, uint16_t height,
const PixelColor& color) = 0;
Draws glyph textures and solid rectangles on behalf of GuiTextRenderer.
virtual void destroyTexture(void *texture)=0
Destroys a texture created by createTexture().
virtual void drawQuad(void *texture, int16_t screenX, int16_t screenY, uint16_t width, uint16_t height, const PixelColor &color)=0
Draws a glyph texture as a quad tinted with color.
virtual void * createTexture(uint16_t width, uint16_t height)=0
Allocates an empty single-channel glyph texture. Returns an opaque handle.
virtual void drawFeature(int16_t screenX, int16_t screenY, uint16_t width, uint16_t height, const PixelColor &color)=0
Draws a solid-color rectangle used for text decoration (underline/strike-through).
virtual void loadTextureData(void *texture, FT_Bitmap *bitmap)=0
Uploads a rasterized FreeType glyph bitmap into a texture from createTexture().
Platform image/texture backend GuiImageData and GuiImage delegate to.
virtual void * createTexture(int width, int height)=0
Allocates an empty hardware-aligned texture buffer.
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.
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 loadTextureData(void *texture, const uint8_t *rgba, int width, int height)=0
Loads raw RGBA8 pixels into the pre-allocated texture.
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,...
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 destroyTexture(void *texture)=0
Destroys 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 bool canReuseTexture(int allocWidth, int allocHeight, int width, int height) const
Whether a texture allocated for allocWidth x allocHeight can be reloaded in place.
Platform video backend owning the frame lifecycle (init/render/clear, screen size,...
virtual int getScreenWidth() const =0
virtual int getScreenHeight() const =0
virtual void init(int width, int height)=0
virtual GlyphRenderer * getGlyphRenderer()=0
virtual void clearScreen(const PixelColor &color)=0
Clears the current frame buffer.
virtual void render()=0
Flushes the current frame to the screen and swaps buffers.
virtual int getRefreshRate() const =0
virtual ImageRenderer * getImageRenderer()=0
virtual uint32_t getFrameTimer()=0
virtual float getUIScale() const
Ratio of physical render-target pixels to design-canvas pixels (the width/height passed to init()).
virtual float getDeltaTime() const =0
virtual void shutdown()=0
Releases the video backend. Call after every other user of the renderers has finished.
A single 2D vertex with its own color, in design-canvas coordinates.
8-bit-per-channel RGBA color used by the video interfaces.