case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
gl_state.usevbo_staticvertex = (vid.support.arb_vertex_buffer_object && gl_vbo.integer) || vid.forcevbo;
gl_state.usevbo_staticindex = (vid.support.arb_vertex_buffer_object && (gl_vbo.integer == 1 || gl_vbo.integer == 3)) || vid.forcevbo;
gl_state.usevbo_dynamicvertex = (vid.support.arb_vertex_buffer_object && gl_vbo_dynamicvertex.integer) || vid.forcevbo;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
// fetch current fbo here (default fbo is not 0 on some GLES devices)
if (vid.support.ext_framebuffer_object)
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglFinish();
break;
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
}
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL13:
case RENDERPATH_GL11:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
{
case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GLES1:
CHECKGLERROR
qglViewport(v->x, v->y, v->width, v->height);CHECKGLERROR
// Load the projection matrix into OpenGL
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (!vid.support.ext_framebuffer_object)
return 0;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (fbo)
qglDeleteFramebuffersEXT(1, (GLuint*)&fbo);
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (gl_state.framebufferobject)
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (gl_state.framebufferobject != fbo)
{
case RENDERPATH_D3D11:
Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
CHECKGLERROR
qglColorMask(1, 1, 1, 1);CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (qglActiveTexture)
{
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (qglActiveTexture)
{
CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
qglBlendFunc(gl_state.blendfunc1, gl_state.blendfunc2);CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
qglDepthMask(gl_state.depthmask);CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
if (gl_state.depthtest)
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
qglDepthFunc(gl_state.depthfunc);CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglDepthRange(gl_state.depthrange[0], gl_state.depthrange[1]);
break;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
if (enable)
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
if (enable)
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglPolygonOffset(gl_state.polygonoffset[0], gl_state.polygonoffset[1]);
break;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglCullFace(gl_state.cullface);CHECKGLERROR
break;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
// only fixed function uses alpha test, other paths use pixel kill capability in shaders
CHECKGLERROR
if (gl_state.alphatest)
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
qglColorMask((GLboolean)r, (GLboolean)g, (GLboolean)b, (GLboolean)a);CHECKGLERROR
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
CHECKGLERROR
qglColor4f(gl_state.color4f[0], gl_state.color4f[1], gl_state.color4f[2], gl_state.color4f[3]);
CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
qglScissor(x, y,width,height);
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
if(gl_state.scissortest)
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
if (mask & GL_COLOR_BUFFER_BIT)
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
CHECKGLERROR
qglReadPixels(x, y, width, height, GL_BGRA, GL_UNSIGNED_BYTE, outpixels);CHECKGLERROR
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
// check if the user specified to ignore static index buffers
if (!gl_state.usevbo_staticindex || (gl_vbo.integer == 3 && !vid.forcevbo && (element3i_bufferoffset || element3s_bufferoffset)))
case RENDERPATH_SOFT:
DPSOFTRAST_DrawTriangles(firstvertex, numvertices, numtriangles, element3i, element3s);
break;
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
// GLES does not have glDrawRangeElements, and generally
// underperforms with index buffers, so this code path is
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (!buffer->bufferobject)
qglGenBuffersARB(1, (GLuint *)&buffer->bufferobject);
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglDeleteBuffersARB(1, (GLuint *)&buffer->bufferobject);
break;
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (gl_state.pointer_vertex_components != components || gl_state.pointer_vertex_gltype != gltype || gl_state.pointer_vertex_stride != stride || gl_state.pointer_vertex_pointer != pointer || gl_state.pointer_vertex_vertexbuffer != vertexbuffer || gl_state.pointer_vertex_offset != bufferoffset)
{
int bufferobject = vertexbuffer ? vertexbuffer->bufferobject : 0;
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
CHECKGLERROR
if (pointer)
{
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
CHECKGLERROR
if (pointer)
{
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
R_Mesh_TexBind(0, tex);
GL_ActiveTexture(0);CHECKGLERROR
case GL_TEXTURE_CUBE_MAP_ARB: if (unit->tcubemap != texnum) {GL_ActiveTexture(unitnum);unit->tcubemap = texnum;qglBindTexture(GL_TEXTURE_CUBE_MAP_ARB, unit->tcubemap);CHECKGLERROR}break;
}
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
unit->texture = tex;
tex2d = 0;
tex3d = 0;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (matrix && matrix->m[3][3])
{
// do nothing
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
// GL_ARB_texture_env_combine
if (!combinergb)
combinergb = GL_MODULATE;
case RENDERPATH_D3D11:
case RENDERPATH_SOFT:
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
for (unitnum = 0;unitnum < vid.texunits;unitnum++)
{
R_Mesh_TexCombine(unitnum, GL_MODULATE, GL_MODULATE, 1, 1);
case RENDERPATH_GL20:
case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
}
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (vertexbuffer)
{
R_Mesh_VertexPointer(3, GL_FLOAT, sizeof(float[3]), vertex3f, vertexbuffer, 0);
return;
}
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (!vid.useinterleavedarrays)
{
R_Mesh_VertexPointer(3, GL_FLOAT, sizeof(float[3]), vertex3f, NULL, 0);
}
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (vertexbuffer)
{
R_Mesh_VertexPointer( 3, GL_FLOAT , sizeof(*vertex), vertex->vertex3f , vertexbuffer, (int)((unsigned char *)vertex->vertex3f - (unsigned char *)vertex));
return;
}
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (!vid.useinterleavedarrays)
{
R_Mesh_VertexPointer(3, GL_FLOAT, sizeof(float[3]), vertex3f, NULL, 0);
}
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (vertexbuffer)
{
R_Mesh_VertexPointer( 3, GL_FLOAT , sizeof(*vertex), vertex->vertex3f , vertexbuffer, (int)((unsigned char *)vertex->vertex3f - (unsigned char *)vertex));
memset(r_glsl_permutationhash, 0, sizeof(r_glsl_permutationhash));
}
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
break;
case RENDERPATH_SOFT:
break;
R_Mesh_TexBind(r_glsl_permutation->tex_Texture_Second, second);
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
R_Mesh_TexBind(0, first );
R_Mesh_TexCombine(0, GL_MODULATE, GL_MODULATE, 1, 1);
R_Mesh_TexBind(1, second);
R_SetupShader_SetPermutationGLSL(SHADERMODE_DEPTH_OR_SHADOW, 0);
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
R_Mesh_TexBind(0, 0);
R_Mesh_TexBind(1, 0);
break;
R_SetupShader_SetPermutationGLSL(SHADERMODE_SHOWDEPTH, 0);
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
break;
case RENDERPATH_GL11:
break;
if (r_glsl_permutation->tex_Texture_BounceGrid >= 0) R_Mesh_TexBind(r_glsl_permutation->tex_Texture_BounceGrid, r_shadow_bouncegridtexture);
CHECKGLERROR
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
break;
case RENDERPATH_SOFT:
RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX | BATCHNEED_ARRAY_NORMAL | BATCHNEED_ARRAY_VECTOR | (rsurface.modellightmapcolor4f ? BATCHNEED_ARRAY_VERTEXCOLOR : 0) | BATCHNEED_ARRAY_TEXCOORD | (rsurface.uselightmaptexture ? BATCHNEED_ARRAY_LIGHTMAP : 0), texturenumsurfaces, texturesurfacelist);
if (r_glsl_permutation->tex_Texture_ShadowMap2D >= 0) R_Mesh_TexBind(r_glsl_permutation->tex_Texture_ShadowMap2D , r_shadow_shadowmap2dtexture );
if (r_glsl_permutation->tex_Texture_CubeProjection >= 0) R_Mesh_TexBind(r_glsl_permutation->tex_Texture_CubeProjection , r_shadow_shadowmapvsdcttexture );
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
break;
case RENDERPATH_SOFT:
R_SetupShader_SetPermutationGLSL(mode, permutation);
r_loadfog = false;
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
Cvar_SetValueQuick(&r_textureunits, vid.texunits);
Cvar_SetValueQuick(&gl_combine, 1);
Cvar_SetValueQuick(&r_glsl, 0);
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
if (r_maxqueries)
qglDeleteQueriesARB(r_maxqueries, r_queries);
case RENDERPATH_D3D11:
case RENDERPATH_GLES2:
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
wanttangents = false;
break;
case RENDERPATH_SOFT:
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
// non-flipped y coordinates
fny = -1.0 + 2.0 * (scissor[1] - r_refdef.view.viewport.y) / (double) (r_refdef.view.viewport.height);
case RENDERPATH_D3D11:
Con_DPrintf("FIXME D3D11 shader %s:%i\n", __FILE__, __LINE__);
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
qglLoadMatrixf(gl_modelview16f);CHECKGLERROR
break;
case RENDERPATH_SOFT:
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglEnable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
break;
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
qglEnable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
break;
case RENDERPATH_SOFT:
case RENDERPATH_GLES2:
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
return;
}
case RENDERPATH_SOFT:
case RENDERPATH_GLES2:
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
return;
}
if (r_viewfbo.integer == 3) textype = TEXTYPE_COLORBUFFER32F;
}
break;
+ case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
case RENDERPATH_D3D9:
case RENDERPATH_D3D10:
case RENDERPATH_D3D11:
case RENDERPATH_SOFT:
- case RENDERPATH_GL13:
- case RENDERPATH_GL11:
break;
}
case RENDERPATH_GL13:
case RENDERPATH_GL20:
case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
- case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
+ case RENDERPATH_SOFT:
R_Mesh_PrepareVertices_Generic_Arrays(4, r_screenvertex3f, NULL, r_bloomstate.screentexcoord2f);
break;
case RENDERPATH_D3D9:
case RENDERPATH_GL11:
case RENDERPATH_GL13:
case RENDERPATH_GL20:
- case RENDERPATH_SOFT:
+ case RENDERPATH_GLES1:
case RENDERPATH_GLES2:
+ case RENDERPATH_SOFT:
R_Mesh_PrepareVertices_Generic_Arrays(4, r_screenvertex3f, NULL, r_bloomstate.screentexcoord2f);
break;
case RENDERPATH_D3D9:
R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
r_refdef.stats.bloom_drawpixels += r_refdef.view.width * r_refdef.view.height;
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
if (r_refdef.viewblend[3] >= (1.0f / 256.0f))
{
// apply a color tint to the whole view
// remove GLSL gamma texture
}
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
break;
}
}
R_DrawTextureSurfaceList_GL20(texturenumsurfaces, texturesurfacelist, writedepth, prepass);
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
R_DrawTextureSurfaceList_GL13(texturenumsurfaces, texturesurfacelist, writedepth);
break;
case RENDERPATH_GL11:
R_DrawTextureSurfaceList_GL20(texturenumsurfaces, texturesurfacelist, writedepth, prepass);
break;
case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
R_DrawTextureSurfaceList_GL13(texturenumsurfaces, texturesurfacelist, writedepth);
break;
case RENDERPATH_GL11:
case RENDERPATH_GLES2:
RSurf_ActiveModelEntity(ent, true, true, false);
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
RSurf_ActiveModelEntity(ent, true, false, false);
break;
}
rsurface.texture = NULL;
}
- switch(vid.renderpath)
- {
- case RENDERPATH_GL11:
- case RENDERPATH_GL13:
- case RENDERPATH_GL20:
- break;
- case RENDERPATH_D3D9:
- //Con_DPrintf("FIXME D3D9 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
- return;
- case RENDERPATH_D3D10:
- Con_DPrintf("FIXME D3D10 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
- return;
- case RENDERPATH_D3D11:
- Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
- return;
- case RENDERPATH_SOFT:
- //Con_DPrintf("FIXME SOFT %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
- return;
- case RENDERPATH_GLES2:
- //Con_DPrintf("FIXME GLES2 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
- return;
- }
-
flagsmask = MATERIALFLAG_SKY | MATERIALFLAG_WALL;
// R_Mesh_ResetTextureState();
GL_PolygonOffset(r_refdef.polygonfactor, r_refdef.polygonoffset);
- if (r_showtris.integer || (r_shownormals.value != 0))
+ if (r_showtris.integer && qglPolygonMode)
{
if (r_showdisabledepthtest.integer)
{
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
}
+ qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE);CHECKGLERROR
for (i = 0, j = model->firstmodelsurface, surface = model->data_surfaces + j;i < model->nummodelsurfaces;i++, j++, surface++)
{
if (ent == r_refdef.scene.worldentity && !r_refdef.viewcache.world_surfacevisible[j])
if ((rsurface.texture->currentmaterialflags & flagsmask) && surface->num_triangles)
{
RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX | BATCHNEED_ARRAY_NORMAL | BATCHNEED_ARRAY_VECTOR | BATCHNEED_NOGAPS, 1, &surface);
- if (r_showtris.value > 0)
- {
- if (!rsurface.texture->currentlayers->depthmask)
- GL_Color(r_refdef.view.colorscale, 0, 0, r_showtris.value);
- else if (ent == r_refdef.scene.worldentity)
- GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, r_showtris.value);
- else
- GL_Color(0, r_refdef.view.colorscale, 0, r_showtris.value);
- R_Mesh_PrepareVertices_Generic_Arrays(rsurface.batchnumvertices, rsurface.batchvertex3f, NULL, NULL);
- qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- RSurf_DrawBatch();
- qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- CHECKGLERROR
- }
+ if (!rsurface.texture->currentlayers->depthmask)
+ GL_Color(r_refdef.view.colorscale, 0, 0, r_showtris.value);
+ else if (ent == r_refdef.scene.worldentity)
+ GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, r_showtris.value);
+ else
+ GL_Color(0, r_refdef.view.colorscale, 0, r_showtris.value);
+ R_Mesh_PrepareVertices_Generic_Arrays(rsurface.batchnumvertices, rsurface.batchvertex3f, NULL, NULL);
+ RSurf_DrawBatch();
+ }
+ }
+ qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);CHECKGLERROR
+ rsurface.texture = NULL;
+ }
+
+ if (r_shownormals.value != 0 && qglBegin)
+ {
+ if (r_showdisabledepthtest.integer)
+ {
+ GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ GL_DepthMask(false);
+ }
+ else
+ {
+ GL_BlendFunc(GL_ONE, GL_ZERO);
+ GL_DepthMask(true);
+ }
+ for (i = 0, j = model->firstmodelsurface, surface = model->data_surfaces + j;i < model->nummodelsurfaces;i++, j++, surface++)
+ {
+ if (ent == r_refdef.scene.worldentity && !r_refdef.viewcache.world_surfacevisible[j])
+ continue;
+ rsurface.texture = R_GetCurrentTexture(surface->texture);
+ if ((rsurface.texture->currentmaterialflags & flagsmask) && surface->num_triangles)
+ {
+ RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX | BATCHNEED_ARRAY_NORMAL | BATCHNEED_ARRAY_VECTOR | BATCHNEED_NOGAPS, 1, &surface);
+ qglBegin(GL_LINES);
if (r_shownormals.value < 0)
{
- qglBegin(GL_LINES);
for (k = 0, l = rsurface.batchfirstvertex;k < rsurface.batchnumvertices;k++, l++)
{
VectorCopy(rsurface.batchvertex3f + l * 3, v);
GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, 1);
qglVertex3f(v[0], v[1], v[2]);
}
- qglEnd();
- CHECKGLERROR
}
if (r_shownormals.value > 0 && rsurface.batchsvector3f)
{
- qglBegin(GL_LINES);
for (k = 0, l = rsurface.batchfirstvertex;k < rsurface.batchnumvertices;k++, l++)
{
VectorCopy(rsurface.batchvertex3f + l * 3, v);
GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, 1);
qglVertex3f(v[0], v[1], v[2]);
}
- qglEnd();
- CHECKGLERROR
- qglBegin(GL_LINES);
for (k = 0, l = rsurface.batchfirstvertex;k < rsurface.batchnumvertices;k++, l++)
{
VectorCopy(rsurface.batchvertex3f + l * 3, v);
GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, 1);
qglVertex3f(v[0], v[1], v[2]);
}
- qglEnd();
- CHECKGLERROR
- qglBegin(GL_LINES);
for (k = 0, l = rsurface.batchfirstvertex;k < rsurface.batchnumvertices;k++, l++)
{
VectorCopy(rsurface.batchvertex3f + l * 3, v);
GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, 1);
qglVertex3f(v[0], v[1], v[2]);
}
- qglEnd();
- CHECKGLERROR
}
+ qglEnd();
+ CHECKGLERROR
}
}
rsurface.texture = NULL;
case RENDERPATH_GLES2:
RSurf_ActiveModelEntity(ent, model->wantnormals, model->wanttangents, false);
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
RSurf_ActiveModelEntity(ent, model->wantnormals, false, false);
break;
}
case RENDERPATH_GLES2:
RSurf_ActiveModelEntity(ent, true, true, false);
break;
- case RENDERPATH_GL13:
case RENDERPATH_GL11:
+ case RENDERPATH_GL13:
+ case RENDERPATH_GLES1:
RSurf_ActiveModelEntity(ent, true, false, false);
break;
}