]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.h
you can now (try to) play in maps you don't have, and models you don't have are shown...
[xonotic/darkplaces.git] / gl_backend.h
index 01dc10602c7d973bed2e0ec96b97327fc952b278..eac1e6d7a6237baf5bfc8965f7e794c351cf68df 100644 (file)
@@ -6,32 +6,9 @@
 
 extern int c_meshtris, c_meshs, c_transtris, c_transmeshs;
 
-typedef struct
-{
-       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 *index;
-       int numverts;
-       float *vertex;
-       int vertexstep;
-       float *color;
-       int colorstep;
-       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];
-       int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
-}
-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;
@@ -40,6 +17,7 @@ typedef struct
        int numverts;
        int tex[MAX_TEXTUREUNITS];
        int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
+       matrix4x4_t matrix; // model to world transform matrix
 
        // output
        int *index;
@@ -68,20 +46,9 @@ void R_Mesh_ClearDepth(void);
 // (only valid between R_Mesh_Start and R_Mesh_Finish)
 void R_Mesh_Render(void);
 
-// queues a mesh to be rendered (invokes Render if queue is full)
-// (only valid between R_Mesh_Start and R_Mesh_Finish)
-void R_Mesh_Draw(const rmeshinfo_t *m);
-
-// renders the queued transparent meshs
-// (only valid between R_Mesh_Start and R_Mesh_Finish)
-void R_Mesh_AddTransparent(void);
-
-// ease-of-use frontend to R_Mesh_Draw, set up meshinfo, except for index and numtriangles and numverts, then call this
-// (only valid between R_Mesh_Start and R_Mesh_Finish)
-void R_Mesh_DrawPolygon(rmeshinfo_t *m, int numverts);
-
 // 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)
+// (it is up to the caller to fill in the geometry data)
+// (make sure you scale your colors by the colorscale field)
 // (only valid between R_Mesh_Start and R_Mesh_Finish)
 int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m, int wantoverbright);