Move the gl util functions into viddef_t.

Static plugins almost link now, just two more symbols to sort out.
This commit is contained in:
Bill Currie 2012-02-23 09:15:50 +09:00
parent 7ed33f6345
commit e08d5ccb41
10 changed files with 16 additions and 20 deletions

View File

@ -47,7 +47,4 @@ qboolean GLF_Init (void);
qboolean GLF_FindFunctions (void);
void *QFGL_ProcAddress (void *handle, const char *name, qboolean);
void *QFGL_LoadLibrary (void);
void *QFGL_GetProcAddress (void *handle, const char *name);
#endif // __QF_GL_funcs_h_

View File

@ -54,7 +54,6 @@ extern int gl_tess;
extern int gl_max_lights;
void GL_EndRendering (void);
void GL_Init_Common (void);
#endif // __QF_GL_vid_h

View File

@ -48,7 +48,4 @@ qboolean EGLF_Init (void);
qboolean EGLF_FindFunctions (void);
void *QFEGL_ProcAddress (void *handle, const char *name, qboolean);
void *QFEGL_LoadLibrary (void);
void *QFEGL_GetProcAddress (void *handle, const char *name);
#endif // __QF_GLSL_funcs_h_

View File

@ -40,7 +40,6 @@ typedef struct shaderparam_s {
extern int glsl_palette;
extern int glsl_colormap;
void GLSL_EndRendering (void);
void GLSL_Init_Common (void);
int GLSL_CompileShader (const char *name, const char *shader_src, int type);
int GLSL_LinkProgram (const char *name, int vert, int frag);

View File

@ -68,6 +68,10 @@ typedef struct {
void (*flush_caches)(void);
void (*init_caches)(void *cache, int size);
void (*do_screen_buffer)(void);
void (*end_rendering)(void);
void *(*load_library)(void);
void *(*get_proc_address)(void *handle, const char *name);
} viddef_t;
extern viddef_t viddef;

View File

@ -123,7 +123,7 @@ R_Envmap_f (void)
gl_envmap = false;
qfglDrawBuffer (GL_BACK);
qfglReadBuffer (GL_BACK);
GL_EndRendering ();
vid.end_rendering ();
}
void
@ -247,13 +247,13 @@ gl_R_TimeRefresh_f (void)
double start, stop, time;
int i;
GL_EndRendering ();
vid.end_rendering ();
start = Sys_DoubleTime ();
for (i = 0; i < 128; i++) {
r_refdef.viewangles[1] = i * (360.0 / 128.0);
gl_R_RenderView ();
GL_EndRendering ();
vid.end_rendering ();
}
stop = Sys_DoubleTime ();

View File

@ -210,7 +210,7 @@ gl_SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
return;
if (begun)
GL_EndRendering ();
vid.end_rendering ();
vr_data.realtime = realtime;
@ -267,7 +267,7 @@ gl_SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
qfglFlush ();
if (gl_finish->int_val) {
GL_EndRendering ();
vid.end_rendering ();
begun = 0;
}
}

View File

@ -62,7 +62,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "QF/GL/extensions.h"
#include "QF/GL/funcs.h"
#include "r_cvar.h"
#include "r_internal.h"
void *
@ -72,7 +72,7 @@ QFGL_ProcAddress (void *handle, const char *name, qboolean crit)
Sys_MaskPrintf (SYS_VID, "DEBUG: Finding symbol %s ... ", name);
glfunc = QFGL_GetProcAddress (handle, name);
glfunc = vid.get_proc_address (handle, name);
if (glfunc) {
Sys_MaskPrintf (SYS_VID, "found [%p]\n", glfunc);
return glfunc;
@ -105,7 +105,7 @@ static void *libgl_handle;
qboolean
GLF_Init (void)
{
libgl_handle = QFGL_LoadLibrary ();
libgl_handle = vid.load_library ();
return true;
}

View File

@ -167,7 +167,7 @@ glsl_SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc,
if (begun) {
begun = 0;
GLSL_EndRendering ();
vid.end_rendering ();
}
vr_data.realtime = realtime;

View File

@ -62,7 +62,7 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/sys.h"
#include "QF/GLSL/funcs.h"
#include "r_cvar.h"
#include "r_internal.h"
void *
@ -72,7 +72,7 @@ QFEGL_ProcAddress (void *handle, const char *name, qboolean crit)
Sys_MaskPrintf (SYS_VID, "DEBUG: Finding symbol %s ... ", name);
glfunc = QFEGL_GetProcAddress (handle, name);
glfunc = vid.get_proc_address (handle, name);
if (glfunc) {
Sys_MaskPrintf (SYS_VID, "found [%p]\n", glfunc);
return glfunc;
@ -105,7 +105,7 @@ static void *libgl_handle;
qboolean
EGLF_Init (void)
{
libgl_handle = QFEGL_LoadLibrary ();
libgl_handle = vid.load_library ();
return true;
}