Record draw call for batch processing
Just started working on this, not sure if it would be available for raylib 1.5
This commit is contained in:
parent
66ec0b5d82
commit
4dae3385c3
1 changed files with 28 additions and 2 deletions
30
src/rlgl.c
30
src/rlgl.c
|
@ -159,9 +159,17 @@ typedef struct {
|
||||||
// Draw call type
|
// Draw call type
|
||||||
// NOTE: Used to track required draw-calls, organized by texture
|
// NOTE: Used to track required draw-calls, organized by texture
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GLuint textureId;
|
|
||||||
int vertexCount;
|
int vertexCount;
|
||||||
// TODO: Store draw state -> blending mode, shader
|
GLuint vaoId;
|
||||||
|
GLuint textureId;
|
||||||
|
GLuint shaderId;
|
||||||
|
|
||||||
|
Matrix projection;
|
||||||
|
Matrix modelview;
|
||||||
|
|
||||||
|
// TODO: Store additional draw state data
|
||||||
|
//int blendMode;
|
||||||
|
//Guint fboId;
|
||||||
} DrawCall;
|
} DrawCall;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@ -2099,6 +2107,24 @@ void *rlglReadTexturePixels(Texture2D texture)
|
||||||
return pixels;
|
return pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// TODO: Record draw calls to be processed in batch
|
||||||
|
// NOTE: Global state must be kept
|
||||||
|
void rlglRecordDraw(void)
|
||||||
|
{
|
||||||
|
// TODO: Before adding a new draw, check if anything changed from last stored draw
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
|
draws[drawsCounter].vaoId = currentState.vaoId; // lines.id, trangles.id, quads.id?
|
||||||
|
draws[drawsCounter].textureId = currentState.textureId; // whiteTexture?
|
||||||
|
draws[drawsCounter].shaderId = currentState.shaderId; // defaultShader.id
|
||||||
|
draws[drawsCounter].projection = projection;
|
||||||
|
draws[drawsCounter].modelview = modelview;
|
||||||
|
draws[drawsCounter].vertexCount = currentState.vertexCount;
|
||||||
|
|
||||||
|
drawsCounter++;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Functions Definition - Shaders Functions
|
// Module Functions Definition - Shaders Functions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue