X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=gl_backend.h;h=e7183ad0c0e31754e36556f7f10cceecb3697d41;hp=1c0be7bd9786026daecd2b6bdbd1bdd99e73e456;hb=c9a530f5a0834ceafd6282aecab0c25d331e979a;hpb=bc6e12f9c8c430e98d6cf89c96c3bfeb903e90d1 diff --git a/gl_backend.h b/gl_backend.h index 1c0be7bd..e7183ad0 100644 --- a/gl_backend.h +++ b/gl_backend.h @@ -1,5 +1,8 @@ -#define MAX_TEXTUREUNITS 4 +#ifndef GL_BACKEND_H +#define GL_BACKEND_H + +#define MAX_TEXTUREUNITS 8 extern int c_meshtris, c_meshs, c_transtris, c_transmeshs; @@ -21,7 +24,7 @@ typedef struct int tex[MAX_TEXTUREUNITS]; float *texcoords[MAX_TEXTUREUNITS]; int texcoordstep[MAX_TEXTUREUNITS]; - float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present + int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present } rmeshinfo_t; @@ -36,7 +39,7 @@ typedef struct int numtriangles; int numverts; int tex[MAX_TEXTUREUNITS]; - float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present + int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present // output int *index; @@ -49,18 +52,45 @@ 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 -void R_Mesh_Clear(void); -// renders queued meshs + +// starts mesh rendering for the frame +void R_Mesh_Start(float farclip); + +// ends mesh rendering for the frame +// (only valid after R_Mesh_Start) +void R_Mesh_Finish(void); + +// clears depth buffer, used for masked sky rendering +// (only valid between R_Mesh_Start and R_Mesh_Finish) +void R_Mesh_ClearDepth(void); + +// renders current batch of meshs +// (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); -// 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); + // 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) +// (only valid between R_Mesh_Start and R_Mesh_Finish) int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m); + +// saves a section of the rendered frame to a .tga file +qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height); +// used by R_Envmap_f and internally in backend, clears the frame +void R_ClearScreen(void); +// invoke refresh of frame +void SCR_UpdateScreen (void); + +#endif +