]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.h
removed a few CheckSentinelsGlobal calls to get a loading speedup
[xonotic/darkplaces.git] / gl_backend.h
index 004e7f43dab88db20e24edfeb4353e2bd05fe6e3..1c0be7bd9786026daecd2b6bdbd1bdd99e73e456 100644 (file)
@@ -12,14 +12,12 @@ typedef struct
        int blendfunc2;
        int numtriangles;
        int *index;
-       int indexbase; // adjustment to add to the index values
        int numverts;
        float *vertex;
        int vertexstep;
        float *color;
        int colorstep;
-       // if color is NULL, these are used for all vertices
-       float cr, cg, cb, ca;
+       float cr, cg, cb, ca; // if color is NULL, these are used for all vertices
        int tex[MAX_TEXTUREUNITS];
        float *texcoords[MAX_TEXTUREUNITS];
        int texcoordstep[MAX_TEXTUREUNITS];
@@ -27,6 +25,28 @@ typedef struct
 }
 rmeshinfo_t;
 
+typedef struct
+{
+       //input to R_Mesh_Draw_GetBuffer
+       int transparent;
+       int depthwrite; // force depth writing enabled even if polygon is not opaque
+       int depthdisable; // disable depth read/write entirely
+       int blendfunc1;
+       int blendfunc2;
+       int numtriangles;
+       int numverts;
+       int tex[MAX_TEXTUREUNITS];
+       float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
+
+       // output
+       int *index;
+       float *vertex;
+       float *color;
+       float colorscale;
+       float *texcoords[MAX_TEXTUREUNITS];
+}
+rmeshbufferinfo_t;
+
 // adds console variables and registers the render module (only call from GL_Init)
 void gl_backend_init(void);
 // sets up mesh renderer for the frame
@@ -41,5 +61,6 @@ void R_Mesh_AddTransparent(void);
 void R_Mesh_DrawPolygon(rmeshinfo_t *m, int numverts);
 // same as normal, except for harsh format restrictions (vertex must be 4 float, color must be 4 float, texcoord must be 2 float, flat color not supported)
 void R_Mesh_Draw_NativeOnly(const rmeshinfo_t *m);
-// faster hardwired version of R_Mesh_Draw specifically for decals (has close ties to decal code)
-//void R_Mesh_DrawDecal(const rmeshinfo_t *m);
+// allocates space in geometry buffers, and fills in pointers to the buffers in passsed struct
+// (this is used for very high speed rendering, no copying)
+int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m);