summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSteven Fuller <relnev@icculus.org>2007-01-12 08:19:57 +0000
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-20 02:22:37 +0200
commit0e484b73da4e8b577a0c7e368c52cfee281c1ef7 (patch)
treeaf4ceb5c908ddc2567469a06876ea2d17c94af09 /src/main.c
parent785c016a2867676a041e27ce25e33c67f026fa4e (diff)
disabled some more assembly.
trying out passing NULL to SDL_GL_LoadLibrary by default.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 0d91aca..91f64e5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -73,7 +73,7 @@ static int WantCDRom = 1;
static int WantJoystick = 1;
/* originally was "/usr/lib/libGL.so.1:/usr/lib/tls/libGL.so.1:/usr/X11R6/lib/libGL.so" */
-static const char * opengl_library = "libGL.so.1";
+static const char * opengl_library = NULL;
/* ** */
@@ -432,11 +432,16 @@ static void load_opengl_library(const char *lib)
size_t len, copylen;
if (lib == NULL) {
- fprintf(stderr, "ERROR: no opengl libraries given\n");
- exit(EXIT_FAILURE);
+ if (SDL_GL_LoadLibrary(NULL) == 0) {
+ /* success */
+ return;
+ }
+
+ fprintf( stderr, "ERROR: no opengl libraries given\n" );
+ exit( EXIT_FAILURE );
}
- while (*lib) {
+ while (lib != NULL && *lib) {
len = strcspn(lib, ":");
copylen = min(len, PATH_MAX-1);
@@ -448,7 +453,7 @@ static void load_opengl_library(const char *lib)
/* success */
return;
}
-
+
lib += len;
lib += strspn(lib, ":");
}