]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.h
added bufferobject and bufferoffset parameters to all R_Mesh_*Pointer functions and...
[xonotic/darkplaces.git] / gl_backend.h
index 0c66d2f1b3ba11216e55517ddaa7b2626ef65f94..ba2e646a3cf39107899b3b9ddef5555dbd0282d8 100644 (file)
@@ -2,7 +2,8 @@
 #ifndef GL_BACKEND_H
 #define GL_BACKEND_H
 
 #ifndef GL_BACKEND_H
 #define GL_BACKEND_H
 
-#define MAX_TEXTUREUNITS 16
+// how many texture units to track state on (backendunits/backendimageunits/backendarrayunits are limited to this value)
+#define MAX_TEXTUREUNITS 64
 
 #define POLYGONELEMENTS_MAXPOINTS 258
 extern int polygonelements[(POLYGONELEMENTS_MAXPOINTS-2)*3];
 
 #define POLYGONELEMENTS_MAXPOINTS 258
 extern int polygonelements[(POLYGONELEMENTS_MAXPOINTS-2)*3];
@@ -10,7 +11,7 @@ extern int polygonelements[(POLYGONELEMENTS_MAXPOINTS-2)*3];
 extern int quadelements[QUADELEMENTS_MAXQUADS*6];
 
 void GL_SetupView_Orientation_Identity(void);
 extern int quadelements[QUADELEMENTS_MAXQUADS*6];
 
 void GL_SetupView_Orientation_Identity(void);
-void GL_SetupView_Orientation_FromEntity(matrix4x4_t *matrix);
+void GL_SetupView_Orientation_FromEntity(const matrix4x4_t *matrix);
 void GL_SetupView_Mode_Perspective(double frustumx, double frustumy, double zNear, double zFar);
 void GL_SetupView_Mode_PerspectiveInfiniteFarClip(double frustumx, double frustumy, double zNear);
 void GL_SetupView_Mode_Ortho(double x1, double y1, double x2, double y2, double zNear, double zFar);
 void GL_SetupView_Mode_Perspective(double frustumx, double frustumy, double zNear, double zFar);
 void GL_SetupView_Mode_PerspectiveInfiniteFarClip(double frustumx, double frustumy, double zNear);
 void GL_SetupView_Mode_Ortho(double x1, double y1, double x2, double y2, double zNear, double zFar);
@@ -29,7 +30,7 @@ void GL_Scissor(int x, int y, int width, int height);
 void GL_ScissorTest(int state);
 void GL_Clear(int mask);
 
 void GL_ScissorTest(int state);
 void GL_Clear(int mask);
 
-unsigned int GL_Backend_CompileProgram(int vertexstrings_count, const char **vertexstrings_list, int fragmentstrings_count, const char **fragmentstrings_list);
+unsigned int GL_Backend_CompileProgram(int vertexstrings_count, const char **vertexstrings_list, int geometrystrings_count, const char **geometrystrings_list, int fragmentstrings_count, const char **fragmentstrings_list);
 void GL_Backend_FreeProgram(unsigned int prog);
 
 extern cvar_t gl_lockarrays;
 void GL_Backend_FreeProgram(unsigned int prog);
 
 extern cvar_t gl_lockarrays;
@@ -71,11 +72,11 @@ void R_Mesh_Finish(void);
 // sets up the requested vertex transform matrix
 void R_Mesh_Matrix(const matrix4x4_t *matrix);
 // sets the vertex array pointer
 // sets up the requested vertex transform matrix
 void R_Mesh_Matrix(const matrix4x4_t *matrix);
 // sets the vertex array pointer
-void R_Mesh_VertexPointer(const float *vertex3f);
+void R_Mesh_VertexPointer(const float *vertex3f, int bufferobject, size_t bufferoffset);
 // sets the color array pointer (GL_Color only works when this is NULL)
 // sets the color array pointer (GL_Color only works when this is NULL)
-void R_Mesh_ColorPointer(const float *color4f);
+void R_Mesh_ColorPointer(const float *color4f, int bufferobject, size_t bufferoffset);
 // sets the texcoord array pointer for an array unit
 // sets the texcoord array pointer for an array unit
-void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, const float *texcoord);
+void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, const float *texcoord, int bufferobject, size_t bufferoffset);
 // sets all textures bound to an image unit (multiple can be non-zero at once, according to OpenGL rules the highest one overrides the others)
 void R_Mesh_TexBindAll(unsigned int unitnum, int tex1d, int tex2d, int tex3d, int texcubemap);
 // sets these are like TexBindAll with only one of the texture indices non-zero
 // sets all textures bound to an image unit (multiple can be non-zero at once, according to OpenGL rules the highest one overrides the others)
 void R_Mesh_TexBindAll(unsigned int unitnum, int tex1d, int tex2d, int tex3d, int texcubemap);
 // sets these are like TexBindAll with only one of the texture indices non-zero
@@ -94,7 +95,7 @@ void R_Mesh_TextureState(const rmeshstate_t *m);
 void R_Mesh_ResetTextureState(void);
 
 // renders a mesh
 void R_Mesh_ResetTextureState(void);
 
 // renders a mesh
-void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int *elements);
+void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int *elements, int bufferobject, size_t bufferoffset);
 // renders a mesh as lines
 void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, int numtriangles, const int *elements);
 
 // renders a mesh as lines
 void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, int numtriangles, const int *elements);
 
@@ -102,8 +103,6 @@ void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, int numtriangles, co
 qboolean SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, unsigned char *buffer3, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg, qboolean gammacorrect);
 // used by R_Envmap_f and internally in backend, clears the frame
 void R_ClearScreen(void);
 qboolean SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, unsigned char *buffer3, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg, qboolean gammacorrect);
 // used by R_Envmap_f and internally in backend, clears the frame
 void R_ClearScreen(void);
-// invoke refresh of frame
-void SCR_UpdateScreen(void);
 // invoke refresh of loading plaque (nothing else seen)
 void SCR_UpdateLoadingScreen(qboolean clear);
 
 // invoke refresh of loading plaque (nothing else seen)
 void SCR_UpdateLoadingScreen(qboolean clear);