mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
fix a nasty seg on gl startup causes by looped function pointers
This commit is contained in:
parent
d4396dfa78
commit
8417d23a94
2 changed files with 24 additions and 24 deletions
|
@ -75,10 +75,10 @@ static const char rcsid[] =
|
|||
|
||||
typedef struct tfxMesaContext *fxMesaContext;
|
||||
|
||||
void (* fxMesaDestroyContext) (fxMesaContext ctx);
|
||||
void (* fxMesaSwapBuffers) (void);
|
||||
fxMesaContext (* fxMesaCreateContext) (GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
|
||||
void (* fxMesaMakeCurrent) (fxMesaContext ctx);
|
||||
void (* qf_fxMesaDestroyContext) (fxMesaContext ctx);
|
||||
void (* qf_fxMesaSwapBuffers) (void);
|
||||
fxMesaContext (* qf_fxMesaCreateContext) (GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
|
||||
void (* qf_fxMesaMakeCurrent) (fxMesaContext ctx);
|
||||
|
||||
// FIXME!!!!! This belongs in include/qfgl_ext.h -- deek
|
||||
typedef void (GLAPIENTRY * QF_3DfxSetDitherModeEXT) (GrDitherMode_t mode);
|
||||
|
@ -101,7 +101,7 @@ VID_Shutdown (void)
|
|||
if (!fc)
|
||||
return;
|
||||
|
||||
fxMesaDestroyContext (fc);
|
||||
qf_fxMesaDestroyContext (fc);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -161,7 +161,7 @@ void
|
|||
GL_EndRendering (void)
|
||||
{
|
||||
qfglFlush ();
|
||||
fxMesaSwapBuffers ();
|
||||
qf_fxMesaSwapBuffers ();
|
||||
Sbar_Changed ();
|
||||
}
|
||||
|
||||
|
@ -265,13 +265,13 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
GL_Pre_Init ();
|
||||
|
||||
fxMesaCreateContext = QFGL_ProcAddress (libgl_handle,
|
||||
qf_fxMesaCreateContext = QFGL_ProcAddress (libgl_handle,
|
||||
"fxMesaCreateContext", true);
|
||||
fxMesaDestroyContext = QFGL_ProcAddress (libgl_handle,
|
||||
qf_fxMesaDestroyContext = QFGL_ProcAddress (libgl_handle,
|
||||
"fxMesaDestroyContext", true);
|
||||
fxMesaMakeCurrent = QFGL_ProcAddress (libgl_handle,
|
||||
qf_fxMesaMakeCurrent = QFGL_ProcAddress (libgl_handle,
|
||||
"fxMesaMakeCurrent", true);
|
||||
fxMesaSwapBuffers = QFGL_ProcAddress (libgl_handle,
|
||||
qf_fxMesaSwapBuffers = QFGL_ProcAddress (libgl_handle,
|
||||
"fxMesaSwapBuffers", true);
|
||||
|
||||
VID_GetWindowSize (640, 480);
|
||||
|
@ -309,12 +309,12 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
vid.conheight = max (vid.conheight, 200);
|
||||
|
||||
fc = fxMesaCreateContext (0, findres (&scr_width, &scr_height),
|
||||
fc = qf_fxMesaCreateContext (0, findres (&scr_width, &scr_height),
|
||||
GR_REFRESH_75Hz, attribs);
|
||||
if (!fc)
|
||||
Sys_Error ("Unable to create 3DFX context.\n");
|
||||
|
||||
fxMesaMakeCurrent (fc);
|
||||
qf_fxMesaMakeCurrent (fc);
|
||||
|
||||
vid.width = vid.conwidth = min (vid.conwidth, scr_width);
|
||||
vid.height = vid.conheight = min (vid.conheight, scr_height);
|
||||
|
|
|
@ -81,10 +81,10 @@ typedef struct __GLXcontextRec *GLXContext;
|
|||
static GLXContext ctx = NULL;
|
||||
typedef XID GLXDrawable;
|
||||
|
||||
void (* glXSwapBuffers) (Display *dpy, GLXDrawable drawable);
|
||||
XVisualInfo* (* glXChooseVisual) (Display *dpy, int screen, int *attribList);
|
||||
GLXContext (* glXCreateContext) (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
|
||||
Bool (* glXMakeCurrent) (Display *dpy, GLXDrawable drawable, GLXContext ctx);
|
||||
void (* qfglXSwapBuffers) (Display *dpy, GLXDrawable drawable);
|
||||
XVisualInfo* (* qfglXChooseVisual) (Display *dpy, int screen, int *attribList);
|
||||
GLXContext (* qfglXCreateContext) (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
|
||||
Bool (* qfglXMakeCurrent) (Display *dpy, GLXDrawable drawable, GLXContext ctx);
|
||||
|
||||
extern void GL_Pre_Init (void);
|
||||
extern void GL_Init_Common (void);
|
||||
|
@ -120,7 +120,7 @@ void
|
|||
GL_EndRendering (void)
|
||||
{
|
||||
qfglFlush ();
|
||||
glXSwapBuffers (x_disp, x_win);
|
||||
qfglXSwapBuffers (x_disp, x_win);
|
||||
Sbar_Changed ();
|
||||
}
|
||||
|
||||
|
@ -145,11 +145,11 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
GL_Pre_Init ();
|
||||
|
||||
glXSwapBuffers = QFGL_ProcAddress (libgl_handle, "glXSwapBuffers", true);
|
||||
glXChooseVisual = QFGL_ProcAddress (libgl_handle, "glXChooseVisual", true);
|
||||
glXCreateContext = QFGL_ProcAddress (libgl_handle, "glXCreateContext",
|
||||
qfglXSwapBuffers = QFGL_ProcAddress (libgl_handle, "glXSwapBuffers", true);
|
||||
qfglXChooseVisual = QFGL_ProcAddress (libgl_handle, "glXChooseVisual", true);
|
||||
qfglXCreateContext = QFGL_ProcAddress (libgl_handle, "glXCreateContext",
|
||||
true);
|
||||
glXMakeCurrent = QFGL_ProcAddress (libgl_handle, "glXMakeCurrent", true);
|
||||
qfglXMakeCurrent = QFGL_ProcAddress (libgl_handle, "glXMakeCurrent", true);
|
||||
|
||||
Cmd_AddCommand ("vid_center", VID_Center_f, "Center the view port on the "
|
||||
"quake window in a virtual desktop.\n");
|
||||
|
@ -184,7 +184,7 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
X11_OpenDisplay ();
|
||||
|
||||
x_visinfo = glXChooseVisual (x_disp, x_screen, attrib);
|
||||
x_visinfo = qfglXChooseVisual (x_disp, x_screen, attrib);
|
||||
if (!x_visinfo) {
|
||||
Sys_Error ("Error couldn't get an RGB, Double-buffered, Depth "
|
||||
"visual\n");
|
||||
|
@ -198,9 +198,9 @@ VID_Init (unsigned char *palette)
|
|||
|
||||
XSync (x_disp, 0);
|
||||
|
||||
ctx = glXCreateContext (x_disp, x_visinfo, NULL, True);
|
||||
ctx = qfglXCreateContext (x_disp, x_visinfo, NULL, True);
|
||||
|
||||
glXMakeCurrent (x_disp, x_win, ctx);
|
||||
qfglXMakeCurrent (x_disp, x_win, ctx);
|
||||
|
||||
vid.height = vid.conheight = min (vid.conheight, scr_height);
|
||||
vid.width = vid.conwidth = min (vid.conwidth, scr_width);
|
||||
|
|
Loading…
Reference in a new issue