11#define VDP_TEXFMT_RGB565 0
12#define VDP_TEXFMT_RGBA4444 1
13#define VDP_TEXFMT_RGBA8888 2
14#define VDP_TEXFMT_DXT1 3
15#define VDP_TEXFMT_DXT3 4
17#define VDP_FILTER_NEAREST 0x2600
18#define VDP_FILTER_LINEAR 0x2601
20#define VDP_WRAP_REPEAT 0x2901
21#define VDP_WRAP_CLAMP 0x812F
22#define VDP_WRAP_MIRROR 0x8370
24#define VDP_COMPARE_NEVER 0x0200
25#define VDP_COMPARE_LESS 0x0201
26#define VDP_COMPARE_EQUAL 0x0202
27#define VDP_COMPARE_LEQUAL 0x0203
28#define VDP_COMPARE_GREATER 0x0204
29#define VDP_COMPARE_NOTEQUAL 0x0205
30#define VDP_COMPARE_GEQUAL 0x0206
31#define VDP_COMPARE_ALWAYS 0x0207
33#define VDP_FUNC_ADD 0x8006
34#define VDP_FUNC_SUBTRACT 0x800A
35#define VDP_FUNC_REVERSE_SUBTRACT 0x800B
37#define VDP_BLEND_ZERO 0
38#define VDP_BLEND_ONE 1
39#define VDP_BLEND_SRC_COLOR 0x0300
40#define VDP_BLEND_ONE_MINUS_SRC_COLOR 0x0301
41#define VDP_BLEND_SRC_ALPHA 0x0302
42#define VDP_BLEND_ONE_MINUS_SRC_ALPHA 0x0303
43#define VDP_BLEND_DST_ALPHA 0x0304
44#define VDP_BLEND_ONE_MINUS_DST_ALPHA 0x0305
45#define VDP_BLEND_DST_COLOR 0x0306
46#define VDP_BLEND_ONE_MINUS_DST_COLOR 0x0307
48#define VDP_WINDING_CW 0x0900
49#define VDP_WINDING_CCW 0x0901
51#define VDP_TOPOLOGY_LINES 0x0000
52#define VDP_TOPOLOGY_LINE_STRIP 0x0001
53#define VDP_TOPOLOGY_TRIANGLES 0x0002
54#define VDP_TOPOLOGY_TRIANGLE_STRIP 0x0003
139extern uint32_t
vdp_allocTexture(uint8_t mipmap, uint32_t format, uint32_t width, uint32_t height);
150extern void vdp_setTextureData(uint32_t textureHandle, uint32_t level,
const void *data, uint32_t dataLen);
177extern void vdp_viewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
186extern void vdp_submitDepthQuery(
float refVal, uint32_t comparison, uint32_t x, uint32_t y, uint32_t w, uint32_t h);
void vdp_viewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
Set the current viewport rect.
void vdp_submitDepthQuery(float refVal, uint32_t comparison, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
Submit a depth query of a portion of the framebuffer, comparing a region of it against a specified va...
void vdp_copyFbToTexture(vdp_Rect *srcRect, vdp_Rect *dstRect, uint32_t textureHandle)
Copy a portion of the framebuffer into a texture.
void vdp_depthWrite(uint8_t enable)
Set whether depth writes are enabled or disabled.
void vdp_depthFunc(uint32_t comparison)
Set the depth test function.
void vdp_clearDepth(float depth)
Clear depth buffer to the given depth value.
uint32_t vdp_getDepthQueryResult()
Get the results of the previously submitted depth query.
void vdp_blendFunc(uint32_t srcFactor, uint32_t dstFactor)
Set the blend equation factors.
void vdp_setWinding(uint32_t windingOrder)
Set the winding order of vertices for backface culling.
void vdp_setVsyncHandler(const vsync_handler_t handler)
Set a callback handler for vsync.
void vdp_releaseTexture(uint32_t textureHandle)
Release previously allocated texture.
void vdp_clearColor(const vdp_Color32 *color)
Clear framebuffer to the given color value.
uint32_t vdp_getUsage()
Report total texture memory usage in bytes.
void vdp_setSampleParams(uint32_t filter, uint32_t wrapU, uint32_t wrapV)
Set texture sampling params.
void vdp_blendEquation(uint32_t mode)
Set the blend equation mode.
void vdp_setTextureData(uint32_t textureHandle, uint32_t level, const void *data, uint32_t dataLen)
Upload data to an allocated texture.
void vdp_drawGeometry(uint32_t topology, uint32_t first, uint32_t count, const vdp_Vertex *vertexData)
Draw geometry to the screen.
void vdp_bindTexture(uint32_t textureHandle)
Set texture to use for rendering.
uint32_t vdp_allocTexture(uint8_t mipmap, uint32_t format, uint32_t width, uint32_t height)
Allocate a texture.
void(* vsync_handler_t)()
Callback type for vsync.
void vdp_setCulling(uint8_t enabled)
Set whether backface culling is enabled or disabled.
An axis-aligned rectangle.
A vertex which can be passed to vdp_drawGeometry.
Vec4 texcoord
The texture coordinate used to sample the currently bound texture.
Vec4 ocolor
The vertex offset color (added to color * texture)
Vec4 color
The vertex color (multiplied with currently bound texture)
Vec4 position
The position of the vertex.