Date: Wed, 28 Apr 2004 16:52:41 -0400
authorSam Lantinga <slouken@libsdl.org>
Fri, 30 Apr 2004 18:33:30 +0000
changeset 8859f6ad2286011
parent 884 20d3a599f601
child 886 05c551e5bc64
Date: Wed, 28 Apr 2004 16:52:41 -0400
From: "Damien A"
Subject: testdyngl fix

The test program you included in the latest version of SDL crashes on startup in Window (XP). The reason for this is that OpenGL functions on Windows use the __stdcall calling convention, not the C convention. Placing APIENTRY infront of the * operator solves this problem.
test/testdyngl.c
     1.1 --- a/test/testdyngl.c	Fri Apr 23 14:00:08 2004 +0000
     1.2 +++ b/test/testdyngl.c	Fri Apr 30 18:33:30 2004 +0000
     1.3 @@ -39,23 +39,23 @@
     1.4  
     1.5  typedef struct
     1.6  {
     1.7 -	void(*glBegin)(GLenum);
     1.8 -	void(*glEnd)();
     1.9 -	void(*glVertex3f)(GLfloat, GLfloat, GLfloat);
    1.10 -	void(*glClearColor)(GLfloat, GLfloat, GLfloat, GLfloat);
    1.11 -	void(*glClear)(GLbitfield);
    1.12 -	void(*glDisable)(GLenum);
    1.13 -	void(*glEnable)(GLenum);
    1.14 -	void(*glColor4ub)(GLubyte,GLubyte,GLubyte,GLubyte);
    1.15 -	void(*glPointSize)(GLfloat);
    1.16 -	void(*glHint)(GLenum,GLenum);
    1.17 -	void(*glBlendFunc)(GLenum,GLenum);
    1.18 -	void(*glMatrixMode)(GLenum);
    1.19 -	void(*glLoadIdentity)();
    1.20 -	void(*glOrtho)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
    1.21 -	void(*glRotatef)(GLfloat,GLfloat,GLfloat,GLfloat);
    1.22 -	void(*glViewport)(GLint,GLint,GLsizei,GLsizei);
    1.23 -	void(*glFogf)(GLenum,GLfloat);
    1.24 +	void(APIENTRY*glBegin)(GLenum);
    1.25 +	void(APIENTRY*glEnd)();
    1.26 +	void(APIENTRY*glVertex3f)(GLfloat, GLfloat, GLfloat);
    1.27 +	void(APIENTRY*glClearColor)(GLfloat, GLfloat, GLfloat, GLfloat);
    1.28 +	void(APIENTRY*glClear)(GLbitfield);
    1.29 +	void(APIENTRY*glDisable)(GLenum);
    1.30 +	void(APIENTRY*glEnable)(GLenum);
    1.31 +	void(APIENTRY*glColor4ub)(GLubyte,GLubyte,GLubyte,GLubyte);
    1.32 +	void(APIENTRY*glPointSize)(GLfloat);
    1.33 +	void(APIENTRY*glHint)(GLenum,GLenum);
    1.34 +	void(APIENTRY*glBlendFunc)(GLenum,GLenum);
    1.35 +	void(APIENTRY*glMatrixMode)(GLenum);
    1.36 +	void(APIENTRY*glLoadIdentity)();
    1.37 +	void(APIENTRY*glOrtho)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
    1.38 +	void(APIENTRY*glRotatef)(GLfloat,GLfloat,GLfloat,GLfloat);
    1.39 +	void(APIENTRY*glViewport)(GLint,GLint,GLsizei,GLsizei);
    1.40 +	void(APIENTRY*glFogf)(GLenum,GLfloat);
    1.41  }
    1.42  glfuncs;
    1.43