Don't load non-core GL functions for OpenGL 3.2 core context

Also declare the GL functions in tr_local.h so there is compile error
for non-core GL functions instead of SEGFAULT from dereferencing a NULL
pointer.

Disable the non-functional stencil shadow code that hasn't been updated
to use OpenGL 3.2 core compatible drawing.
This commit is contained in:
Zack Middleton 2018-07-20 23:40:17 -05:00
parent 255c33b367
commit 7391215bd4
5 changed files with 74 additions and 27 deletions

View file

@ -36,6 +36,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../renderercommon/iqm.h"
#include "../renderercommon/qgl.h"
#define GLE(ret, name, ...) extern name##proc * qgl##name;
QGL_1_1_PROCS;
QGL_DESKTOP_1_1_PROCS;
QGL_1_3_PROCS;
QGL_1_5_PROCS;
QGL_2_0_PROCS;
QGL_3_0_PROCS;
QGL_ARB_framebuffer_object_PROCS;
QGL_ARB_vertex_array_object_PROCS;
QGL_EXT_direct_state_access_PROCS;
#undef GLE
#define GL_INDEX_TYPE GL_UNSIGNED_INT
typedef unsigned int glIndex_t;

View file

@ -43,8 +43,8 @@ typedef struct {
static edgeDef_t edgeDefs[SHADER_MAX_VERTEXES][MAX_EDGE_DEFS];
static int numEdgeDefs[SHADER_MAX_VERTEXES];
static int facing[SHADER_MAX_INDEXES/3];
static vec3_t shadowXyz[SHADER_MAX_VERTEXES];
//static int facing[SHADER_MAX_INDEXES/3];
//static vec3_t shadowXyz[SHADER_MAX_VERTEXES];
void R_AddEdgeDef( int i1, int i2, int facing ) {
int c;
@ -60,6 +60,8 @@ void R_AddEdgeDef( int i1, int i2, int facing ) {
}
void R_RenderShadowEdges( void ) {
// FIXME: implement this
#if 0
int i;
#if 0
@ -138,6 +140,7 @@ void R_RenderShadowEdges( void ) {
}
}
#endif
#endif
}
/*
@ -153,6 +156,8 @@ triangleFromEdge[ v1 ][ v2 ]
=================
*/
void RB_ShadowTessEnd( void ) {
// FIXME: implement this
#if 0
int i;
int numTris;
vec3_t lightDir;
@ -230,6 +235,7 @@ void RB_ShadowTessEnd( void ) {
// reenable writing to the color buffer
qglColorMask(rgba[0], rgba[1], rgba[2], rgba[3]);
#endif
}
@ -244,6 +250,8 @@ overlap and double darken.
=================
*/
void RB_ShadowFinish( void ) {
// FIXME: implement this
#if 0
if ( r_shadows->integer != 2 ) {
return;
}
@ -275,6 +283,7 @@ void RB_ShadowFinish( void ) {
qglColor4f(1,1,1,1);
qglDisable( GL_STENCIL_TEST );
#endif
}