Commit 67f01941 authored by Sam Lantinga's avatar Sam Lantinga

Load the correct library on Windows

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40843
parent dfd19930
...@@ -89,15 +89,17 @@ int main(int argc,char *argv[]) ...@@ -89,15 +89,17 @@ int main(int argc,char *argv[])
SDL_Event event; SDL_Event event;
int done=0; int done=0;
GLfloat pixels[NB_PIXELS*3]; GLfloat pixels[NB_PIXELS*3];
char default_gl_lib[]="/usr/lib/libGL.so"; #ifdef _WIN32
char* current_gl_lib=default_gl_lib; char *gl_library = "OpenGL32.DLL";
#else
char *gl_library = "libGL.so.1";
#endif
if (argc==2) if (argv[1]) {
{ gl_library = argv[1];
current_gl_lib=argv[1];
} }
if (SDL_Init(SDL_INIT_EVERYTHING)<0) if (SDL_Init(SDL_INIT_VIDEO)<0)
{ {
printf("Unable to init SDL : %s\n",SDL_GetError()); printf("Unable to init SDL : %s\n",SDL_GetError());
exit(1); exit(1);
...@@ -109,7 +111,7 @@ int main(int argc,char *argv[]) ...@@ -109,7 +111,7 @@ int main(int argc,char *argv[])
exit(1); exit(1);
} }
if (SDL_GL_LoadLibrary(current_gl_lib)<0) if (SDL_GL_LoadLibrary(gl_library)<0)
{ {
printf("Unable to dynamically open GL lib : %s\n",SDL_GetError()); printf("Unable to dynamically open GL lib : %s\n",SDL_GetError());
exit(1); exit(1);
......
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