Date: Mon, 24 Jan 2005 21:37:56 +0800
authorSam Lantinga <slouken@libsdl.org>
Tue, 25 Jan 2005 16:57:11 +0000
changeset 1032c1c2efca4548
parent 1031 3cf036d8861f
child 1033 aebfa3ce2a53
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.
src/video/SDL_video.c
src/video/macdsp/SDL_dspvideo.c
src/video/macrom/SDL_romvideo.c
     1.1 --- a/src/video/SDL_video.c	Tue Jan 18 18:40:48 2005 +0000
     1.2 +++ b/src/video/SDL_video.c	Tue Jan 25 16:57:11 2005 +0000
     1.3 @@ -743,9 +743,7 @@
     1.4  	/* Load GL symbols (before MakeCurrent, where we need glGetString). */
     1.5  	if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
     1.6  
     1.7 -#if (defined(macintosh) && !defined(__MWERKS__))
     1.8 -#define __SDL_NOGETPROCADDR__
     1.9 -#elif defined(__QNXNTO__) && (_NTO_VERSION < 630)
    1.10 +#if defined(__QNXNTO__) && (_NTO_VERSION < 630)
    1.11  #define __SDL_NOGETPROCADDR__
    1.12  #elif defined(__MINT__)
    1.13  #define __SDL_NOGETPROCADDR__
     2.1 --- a/src/video/macdsp/SDL_dspvideo.c	Tue Jan 18 18:40:48 2005 +0000
     2.2 +++ b/src/video/macdsp/SDL_dspvideo.c	Tue Jan 25 16:57:11 2005 +0000
     2.3 @@ -298,6 +298,8 @@
     2.4  #ifdef HAVE_OPENGL
     2.5  	device->GL_MakeCurrent  = Mac_GL_MakeCurrent;
     2.6  	device->GL_SwapBuffers  = DSp_GL_SwapBuffers;
     2.7 +	device->GL_LoadLibrary = Mac_GL_LoadLibrary;
     2.8 +	device->GL_GetProcAddress = Mac_GL_GetProcAddress;
     2.9  #endif
    2.10  	device->SetCaption = NULL;
    2.11  	device->SetIcon = NULL;
    2.12 @@ -790,7 +792,7 @@
    2.13  		SDL_SetError ("Display Manager couldn't associate GDevice with display_id");
    2.14  		return NULL;
    2.15  	}	
    2.16 -	if ( DSpFindBestContextOnDisplayID (&attrib, &dsp_context, display_id) != noErr ) {
    2.17 +	if ( DSpFindBestContextOnDisplayID(&attrib, &dsp_context, display_id) != noErr ) {
    2.18  		SDL_SetError ("DrawSprocket couldn't find a suitable context on given display");
    2.19  		return NULL;
    2.20  	}
     3.1 --- a/src/video/macrom/SDL_romvideo.c	Tue Jan 18 18:40:48 2005 +0000
     3.2 +++ b/src/video/macrom/SDL_romvideo.c	Tue Jan 25 16:57:11 2005 +0000
     3.3 @@ -163,13 +163,8 @@
     3.4  #ifdef HAVE_OPENGL
     3.5  	device->GL_MakeCurrent = Mac_GL_MakeCurrent;
     3.6  	device->GL_SwapBuffers = Mac_GL_SwapBuffers;
     3.7 -#ifdef __MWERKS__
     3.8  	device->GL_LoadLibrary = Mac_GL_LoadLibrary;
     3.9  	device->GL_GetProcAddress = Mac_GL_GetProcAddress;
    3.10 -#else
    3.11 -	device->GL_LoadLibrary = NULL;
    3.12 -	device->GL_GetProcAddress = NULL;
    3.13 -#endif	// CodeWarrior
    3.14  #endif	// Have OpenGL
    3.15  	device->SetCaption = Mac_SetCaption;
    3.16  	device->SetIcon = NULL;