on Carbon, dynamically find and load the OpenGL library on carbon
This commit is contained in:
parent
8cd2b8263b
commit
70cac7ef85
|
@ -1,3 +1,8 @@
|
|||
2005-01-24 Chris Taylor <c.taylor@student.curtin.edu.au>
|
||||
|
||||
* arch/carbon/conf.h, arch/ogl/gr.c, include/loadgl.h: on Carbon,
|
||||
dynamically find and load the OpenGL library on carbon
|
||||
|
||||
2005-01-24 Chris Taylor <c.taylor@student.curtin.edu.au>
|
||||
|
||||
* 2d/font.c: fix bug #2167: some characters would not display because
|
||||
|
|
|
@ -141,6 +141,8 @@
|
|||
# define inline
|
||||
# endif
|
||||
|
||||
#define OGL_RUNTIME_LOAD // avoids corruption of OpenGL
|
||||
|
||||
//#define TARGET_API_MAC_CARBON 1
|
||||
/* Define to 1 if the system has the type `struct timespec'. */
|
||||
#define HAVE_STRUCT_TIMESPEC 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: gr.c,v 1.40 2005-01-23 14:38:04 schaffner Exp $ */
|
||||
/* $Id: gr.c,v 1.41 2005-01-25 19:23:58 schaffner Exp $ */
|
||||
/*
|
||||
*
|
||||
* OGL video functions. - Added 9/15/99 Matthew Mueller
|
||||
|
@ -161,9 +161,9 @@ const char *gl_vendor, *gl_renderer, *gl_version, *gl_extensions;
|
|||
|
||||
void ogl_get_verinfo(void)
|
||||
{
|
||||
int t, arb_max_textures = -1, sgi_max_textures = -1;
|
||||
long t, arb_max_textures = -1, sgi_max_textures = -1;
|
||||
#ifdef GL_NV_register_combiners
|
||||
int nv_register_combiners = -1;
|
||||
long nv_register_combiners = -1;
|
||||
#endif
|
||||
float anisotropic_max = 0;
|
||||
|
||||
|
@ -392,6 +392,9 @@ char *OglLibPath="opengl32.dll";
|
|||
#ifdef __unix__
|
||||
char *OglLibPath="libGL.so";
|
||||
#endif
|
||||
#ifdef macintosh
|
||||
char *OglLibPath = NULL;
|
||||
#endif
|
||||
|
||||
int ogl_rt_loaded=0;
|
||||
int ogl_init_load_library(void)
|
||||
|
@ -412,7 +415,7 @@ int ogl_init_load_library(void)
|
|||
Error("Opengl: Functions not imported\n");
|
||||
}
|
||||
}else{
|
||||
Error("Opengl: error loading %s\n",OglLibPath);
|
||||
Error("Opengl: error loading %s\n", OglLibPath? OglLibPath : SDL_GetError());
|
||||
}
|
||||
ogl_rt_loaded=1;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: loadgl.h,v 1.11 2004-12-02 08:52:59 btb Exp $ */
|
||||
/* $Id: loadgl.h,v 1.12 2005-01-25 19:23:58 schaffner Exp $ */
|
||||
/*
|
||||
*
|
||||
* dynamic opengl loading - courtesy of Jeff Slutter
|
||||
|
@ -1275,6 +1275,23 @@ void *dll_GetSymbol(void *dllhandle,const char *symname)
|
|||
return dlsym(dllhandle,symname);
|
||||
}
|
||||
#endif
|
||||
#ifdef macintosh
|
||||
#include <SDL.h>
|
||||
void *dll_LoadModule(const char *name)
|
||||
{
|
||||
return SDL_GL_LoadLibrary(name) ? NULL : (void *) -1; // return pointer is not dereferenced
|
||||
}
|
||||
void dll_UnloadModule(void *hdl)
|
||||
{
|
||||
hdl = hdl; // SDL_GL_UnloadLibrary not exported by SDL
|
||||
}
|
||||
void *dll_GetSymbol(void *dllhandle,const char *symname)
|
||||
{
|
||||
if(!dllhandle)
|
||||
return NULL;
|
||||
return SDL_GL_GetProcAddress(symname);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DECLARE_VARS
|
||||
|
||||
|
|
Loading…
Reference in a new issue