Commit b98f9d6f authored by Sam Lantinga's avatar Sam Lantinga

Date: Mon, 24 Jan 2005 21:37:56 +0800

From: Chris Taylor
Subject: Patch to put back dynamic OpenGL loading for MPW

I sent a patch a while ago that removes dynamic OpenGL loading for
Macintosh Programmer's Workshop. Dynamic loading DOES actually work
when an SDL program is built with MPW, it just has to be set up for it.
(Whoops!!) This is the ideal way to get OpenGL extensions to work,
which D2X uses quite a few of.

This patch puts dynamic loading back in SDL for Mac OS 9. It applies to
current CVS. I noticed that two members need to be set when
DrawSprocket is used.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401033
parent b56b326a
...@@ -743,9 +743,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) ...@@ -743,9 +743,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
/* Load GL symbols (before MakeCurrent, where we need glGetString). */ /* Load GL symbols (before MakeCurrent, where we need glGetString). */
if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) { if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
#if (defined(macintosh) && !defined(__MWERKS__)) #if defined(__QNXNTO__) && (_NTO_VERSION < 630)
#define __SDL_NOGETPROCADDR__
#elif defined(__QNXNTO__) && (_NTO_VERSION < 630)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#elif defined(__MINT__) #elif defined(__MINT__)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
......
...@@ -298,6 +298,8 @@ static SDL_VideoDevice *DSp_CreateDevice(int devindex) ...@@ -298,6 +298,8 @@ static SDL_VideoDevice *DSp_CreateDevice(int devindex)
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
device->GL_MakeCurrent = Mac_GL_MakeCurrent; device->GL_MakeCurrent = Mac_GL_MakeCurrent;
device->GL_SwapBuffers = DSp_GL_SwapBuffers; device->GL_SwapBuffers = DSp_GL_SwapBuffers;
device->GL_LoadLibrary = Mac_GL_LoadLibrary;
device->GL_GetProcAddress = Mac_GL_GetProcAddress;
#endif #endif
device->SetCaption = NULL; device->SetCaption = NULL;
device->SetIcon = NULL; device->SetIcon = NULL;
...@@ -790,7 +792,7 @@ rebuild: ...@@ -790,7 +792,7 @@ rebuild:
SDL_SetError ("Display Manager couldn't associate GDevice with display_id"); SDL_SetError ("Display Manager couldn't associate GDevice with display_id");
return NULL; return NULL;
} }
if ( DSpFindBestContextOnDisplayID (&attrib, &dsp_context, display_id) != noErr ) { if ( DSpFindBestContextOnDisplayID(&attrib, &dsp_context, display_id) != noErr ) {
SDL_SetError ("DrawSprocket couldn't find a suitable context on given display"); SDL_SetError ("DrawSprocket couldn't find a suitable context on given display");
return NULL; return NULL;
} }
......
...@@ -163,13 +163,8 @@ static SDL_VideoDevice *ROM_CreateDevice(int devindex) ...@@ -163,13 +163,8 @@ static SDL_VideoDevice *ROM_CreateDevice(int devindex)
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
device->GL_MakeCurrent = Mac_GL_MakeCurrent; device->GL_MakeCurrent = Mac_GL_MakeCurrent;
device->GL_SwapBuffers = Mac_GL_SwapBuffers; device->GL_SwapBuffers = Mac_GL_SwapBuffers;
#ifdef __MWERKS__
device->GL_LoadLibrary = Mac_GL_LoadLibrary; device->GL_LoadLibrary = Mac_GL_LoadLibrary;
device->GL_GetProcAddress = Mac_GL_GetProcAddress; device->GL_GetProcAddress = Mac_GL_GetProcAddress;
#else
device->GL_LoadLibrary = NULL;
device->GL_GetProcAddress = NULL;
#endif // CodeWarrior
#endif // Have OpenGL #endif // Have OpenGL
device->SetCaption = Mac_SetCaption; device->SetCaption = Mac_SetCaption;
device->SetIcon = NULL; device->SetIcon = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment