28 #include "../idlib/precompiled.h"
90 qglTexGenf( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
91 qglTexGenf( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
92 qglTexGenf( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
93 qglTexGenf( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR );
120 va_start( marker, comment );
147 RB_LogComment(
"glActiveTextureARB( %i );\nglClientActiveTextureARB( %i );\n", unit, unit );
200 if ( env == tmu->
texEnv ) {
212 qglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env );
215 common->
Error(
"GL_TexEnv: invalid env '%d' passed\n", env );
272 GLenum srcFactor, dstFactor;
282 srcFactor = GL_DST_COLOR;
285 srcFactor = GL_ONE_MINUS_DST_COLOR;
288 srcFactor = GL_SRC_ALPHA;
291 srcFactor = GL_ONE_MINUS_SRC_ALPHA;
294 srcFactor = GL_DST_ALPHA;
297 srcFactor = GL_ONE_MINUS_DST_ALPHA;
300 srcFactor = GL_SRC_ALPHA_SATURATE;
304 common->
Error(
"GL_State: invalid src blend state bits\n" );
316 dstFactor = GL_SRC_COLOR;
319 dstFactor = GL_ONE_MINUS_SRC_COLOR;
322 dstFactor = GL_SRC_ALPHA;
325 dstFactor = GL_ONE_MINUS_SRC_ALPHA;
328 dstFactor = GL_DST_ALPHA;
331 dstFactor = GL_ONE_MINUS_DST_ALPHA;
335 common->
Error(
"GL_State: invalid dst blend state bits\n" );
346 if ( stateBits & GLS_DEPTHMASK ) {
369 if ( stateBits & GLS_POLYMODE_LINE ) {
380 switch ( stateBits & GLS_ATEST_BITS ) {
453 static void RB_SetBuffer(
const void *
data ) {
469 if ( sscanf(
r_clear.
GetString(),
"%f %f %f", &c[0], &c[1], &c[2] ) == 3 ) {
539 common->
Printf(
"%i msec to draw all images\n", end - start );
560 RB_LogComment(
"***************** RB_SwapBuffers *****************\n\n\n" );
584 RB_LogComment(
"***************** RB_CopyRender *****************\n" );
602 int c_draw3d = 0, c_draw2d = 0, c_setBuffers = 0, c_swapBuffers = 0, c_copyRenders = 0;
630 RB_SetBuffer( cmds );
642 common->
Error(
"RB_ExecuteBackEndCommands: bad commandId" );
656 common->
Printf(
"3d: %i, 2d: %i, SetBuf: %i, SwpBuf: %i, CpyRenders: %i, CpyFrameBuf: %i\n", c_draw3d, c_draw2d, c_setBuffers, c_swapBuffers, c_copyRenders, backEnd.
c_copyFrameBuffer );
idCVar r_showImages("r_showImages","0", CVAR_RENDERER|CVAR_INTEGER,"1 = show all images instead of rendering, 2 = show in proportional size", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
const int GLS_DSTBLEND_ONE
const int GLS_SRCBLEND_ONE_MINUS_DST_ALPHA
const int GLS_DEPTHFUNC_LESS
assert(prefInfo.fullscreenBtn)
idCVar r_frontBuffer("r_frontBuffer","0", CVAR_RENDERER|CVAR_BOOL,"draw to front buffer for debugging")
#define qglEnableClientState
const int GLS_DSTBLEND_ONE_MINUS_DST_ALPHA
#define qglDisableClientState
const int GLS_DSTBLEND_DST_ALPHA
const int GLS_SRCBLEND_SRC_ALPHA
const int GLS_POLYMODE_LINE
const int GLS_SRCBLEND_ONE_MINUS_DST_COLOR
float GetFloat(void) const
idCVar r_useStateCaching("r_useStateCaching","1", CVAR_RENDERER|CVAR_BOOL,"avoid redundant state changes in GL_*() calls")
const int GLS_SRCBLEND_ALPHA_SATURATE
const int GLS_DSTBLEND_SRC_COLOR
idCVar r_finish("r_finish","0", CVAR_RENDERER|CVAR_BOOL,"force a call to glFinish() every frame")
idCVar r_debugRenderToTexture("r_debugRenderToTexture","0", CVAR_RENDERER|CVAR_INTEGER,"")
int Sys_Milliseconds(void)
const int GLS_DSTBLEND_SRC_ALPHA
GLenum GLsizei GLenum GLenum const GLvoid * image
const int GLS_DEPTHFUNC_ALWAYS
void CompleteBackgroundImageLoads()
idCVar r_lockSurfaces("r_lockSurfaces","0", CVAR_RENDERER|CVAR_BOOL,"allow moving the view point without changing the composition of the scene, including culling")
idCVar r_showOverDraw("r_showOverDraw","0", CVAR_RENDERER|CVAR_INTEGER,"1 = geometry overdraw, 2 = light interaction overdraw, 3 = geometry and light interaction overdraw", 0, 3, idCmdSystem::ArgCompletion_Integer< 0, 3 >)
void CopyFramebuffer(int x, int y, int width, int height, bool useOversizedBuffer)
void GL_Cull(int cullType)
const int GLS_DEPTHFUNC_EQUAL
const int GLS_SRCBLEND_BITS
typedef GLboolean(APIENTRYP PFNGLISQUERYPROC)(GLuint id)
GLubyte GLubyte GLubyte GLubyte w
const int GLS_ATEST_EQ_255
const int GLS_DSTBLEND_ONE_MINUS_SRC_COLOR
GLsizei GLsizei GLenum GLenum const GLvoid * data
int GetInteger(void) const
const int GLS_SRCBLEND_ONE
idImageManager * globalImages
void RB_SetDefaultGLState(void)
GLubyte GLubyte GLubyte a
virtual void Printf(const char *fmt,...) id_attribute((format(printf
void GL_ClearStateDelta(void)
const int GLS_SRCBLEND_DST_ALPHA
const int GLS_ATEST_GE_128
const int GLS_DSTBLEND_ZERO
void RB_ExecuteBackEndCommands(const emptyCommand_t *cmds)
const char * GetString(void) const
void RB_LogComment(const char *comment,...)
GLdouble GLdouble GLdouble r
const int GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA
idList< idImage * > images
idCVar r_clear("r_clear","2", CVAR_RENDERER,"force screen clear every frame, 1 = purple, 2 = black, 'r g b' = custom")
const int GLS_ATEST_LT_128
const void RB_SwapBuffers(const void *data)
renderCommand_t commandId
void RB_DrawView(const void *data)
const void RB_CopyRender(const void *data)
const int GLS_SRCBLEND_ZERO
static const int TEXTURE_NOT_LOADED
#define GL_TEXTURE_CUBE_MAP_EXT
const int GLS_SRCBLEND_DST_COLOR
void GL_State(int stateBits)
idCVar r_useScissor("r_useScissor","1", CVAR_RENDERER|CVAR_BOOL,"scissor clip as portals and lights are processed")
void GL_SelectTexture(int unit)
virtual void Error(const char *fmt,...) id_attribute((format(printf
idCVar r_singleArea("r_singleArea","0", CVAR_RENDERER|CVAR_BOOL,"only draw the portal area the view is actually in")
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
const int GLS_DSTBLEND_BITS
void GLimp_SwapBuffers(void)
const int GLS_SRCBLEND_ONE_MINUS_SRC_ALPHA
idCVar r_skipCopyTexture("r_skipCopyTexture","0", CVAR_RENDERER|CVAR_BOOL,"do all rendering, but don't actually copyTexSubImage2D")
tmu_t tmu[MAX_MULTITEXTURE_UNITS]
const viewDef_t * viewDef