[SDL] [dryice at uswest.net: sdl errors]

Joseph Carter knghtbrd at debian.org
Sun Aug 26 11:57:00 PDT 2001

We're having problems using SDL_GL_LoadLibrary on win32 systems.  It works
fine here in Linux, but nothing we've tried has worked for win32 yet.
What we have is very similar to what SDL itself uses, which is even more
infuriating.  Our native win32 porting person hasn't a clue how any of
this works.  =/  I'd greatly appreciate it if someone could explain where
we are going wrong here.

First, the list of functions:

#define TWIGL_DONT_NEED(ret, func, params)

TWIGL_DONT_NEED (void, glAccum, (GLenum op, GLfloat value));
TWIGL_DONT_NEED (void, glActiveTextureARB, (GLenum texture));
TWIGL_NEED (void, glAlphaFunc, (GLenum func, GLclampf ref));


Then the externs:

#define TWIGL_NEED(ret, name, args) extern ret (* q##name) args
#include "TGL_funcs_list.h"

Then in a .c file:

// First we need all the function pointers.
#define TWIGL_NEED(ret, name, args) \
ret APIENTRY (* q##name) args = NULL;
#include "TGL_funcs_list.h"

and an init function:

	... SDL_GL_LoadLibrary ( ... ) ...

	#define TWIGL_NEED(ret, name, args)                 \
		if (!(q##name = SDL_GL_GetProcAddress(#name))) {    \
			Sys_Error ("Can't load func %s: %s\n", #name, \
			SDL_GetError()); \
			return false; \

	#include "TGL_funcs_list.h"
	#undef TWIGL_NEED

	return true;

Is there anything inherently wrong with this?  It works fine for Linux, as
I said.  It works in win32 if APIENTRY is defined to nothing but then will
not run.  If APIENTRY is defined to __stdcall it will not compile due to a
syntax error.

I wish I could offer more than that to help debug the problem.  Our win32
guy unfortunately has not been able to really provide me with anything
else useful to debug the problem.  If it'd be better to try and compile
it, the code's in CVS on sourceforge (http://sf.net/projects/twilight/),
but I can make a zip of my working directory if it's really needed.

At this point, I'm probably even more frustrated with it than Vic is.
Win32 compiler issues are outside my field, so there's nothing I can do to
fix it.

Joseph Carter <knghtbrd at debian.org>                 Free software developer

* joeyh_ runs ps and sees 10 lines of awk code
* joeyh_ recoils in horror

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010813/efffe4e7/attachment-0008.pgp>

More information about the SDL mailing list