static void gl_backend_start(void)
{
- Con_Print("OpenGL Backend starting...\n");
CHECKGLERROR
if (qglDrawRangeElements != NULL)
CHECKGLERROR
qglGetIntegerv(GL_MAX_ELEMENTS_INDICES, &gl_maxdrawrangeelementsindices);
CHECKGLERROR
- Con_Printf("glDrawRangeElements detected (max vertices %i, max indices %i)\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices);
+ Con_DPrintf("GL_MAX_ELEMENTS_VERTICES = %i\nGL_MAX_ELEMENTS_INDICES = %i\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices);
}
backendunits = bound(1, gl_textureunits, MAX_TEXTUREUNITS);
CHECKGLERROR
qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, (int *)&backendarrayunits);
CHECKGLERROR
- Con_Printf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits);
+ Con_DPrintf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits);
backendimageunits = bound(1, backendimageunits, MAX_TEXTUREUNITS);
backendarrayunits = bound(1, backendarrayunits, MAX_TEXTUREUNITS);
}
- else if (backendunits > 1)
- Con_Printf("multitexture detected: texture units = %i\n", backendunits);
else
- Con_Printf("singletexture\n");
+ Con_DPrintf("GL_MAX_TEXTUREUNITS = %i\n", backendunits);
GL_Backend_AllocArrays();
Mem_ExpandableArray_NewArray(&gl_bufferobjectinfoarray, r_main_mempool, sizeof(gl_bufferobjectinfo_t), 128);
- Con_Printf("OpenGL backend started.\n");
+ Con_DPrintf("OpenGL backend started.\n");
CHECKGLERROR
backendarrayunits = 0;
backendactive = false;
- Con_Print("OpenGL Backend shutting down\n");
+ Con_DPrint("OpenGL Backend shutting down\n");
Mem_ExpandableArray_FreeArray(&gl_bufferobjectinfoarray);
Cvar_RegisterVariable(&gl_mesh_testarrayelement);
Cvar_RegisterVariable(&gl_mesh_testmanualfeeding);
- Cmd_AddCommand("gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them\n");
+ Cmd_AddCommand("gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them");
R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap);
}
//Matrix4x4_ConcatRotate(&backend_viewmatrix, -angles[0], 0, 1, 0);
//Matrix4x4_ConcatRotate(&backend_viewmatrix, -angles[1], 0, 0, 1);
//Matrix4x4_ConcatTranslate(&backend_viewmatrix, -origin[0], -origin[1], -origin[2]);
+
+ // force an update of the model matrix by copying it off, resetting it, and then calling the R_Mesh_Matrix function with it
+ tempmatrix = backend_modelmatrix;
memset(&backend_modelmatrix, 0, sizeof(backend_modelmatrix));
+ R_Mesh_Matrix(&tempmatrix);
}
void GL_SetupView_Mode_Perspective (double frustumx, double frustumy, double zNear, double zFar)
unit->matrix = *matrix;
CHECKGLERROR
Matrix4x4_ToArrayDoubleGL(&unit->matrix, glmatrix);
- qglMatrixMode(GL_TEXTURE);CHECKGLERROR
GL_ActiveTexture(unitnum);
+ GL_ClientActiveTexture(unitnum);
+ qglMatrixMode(GL_TEXTURE);CHECKGLERROR
qglLoadMatrixd(glmatrix);CHECKGLERROR
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}
{
unit->texmatrixenabled = false;
CHECKGLERROR
- qglMatrixMode(GL_TEXTURE);CHECKGLERROR
GL_ActiveTexture(unitnum);
+ GL_ClientActiveTexture(unitnum);
+ qglMatrixMode(GL_TEXTURE);CHECKGLERROR
qglLoadIdentity();CHECKGLERROR
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}