Fixed OpenGL library loading functions
authorNathan Heisey <nathanheisey@gmail.com>
Tue, 09 Aug 2011 16:34:25 +0000
changeset 5935d52ded852194
parent 5934 01531d8d1e01
child 5936 116b7457e73a
Fixed OpenGL library loading functions
configure.in
src/video/bwindow/SDL_bopengl.cc
     1.1 --- a/configure.in	Mon Aug 08 17:00:38 2011 +0000
     1.2 +++ b/configure.in	Tue Aug 09 16:34:25 2011 +0000
     1.3 @@ -1238,7 +1238,6 @@
     1.4  {
     1.5      if test x$enable_video = xyes; then
     1.6          AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW, 1, [ ])
     1.7 -        # SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc" .cc sources have been removed
     1.8          SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
     1.9          have_video=yes
    1.10      fi
     2.1 --- a/src/video/bwindow/SDL_bopengl.cc	Mon Aug 08 17:00:38 2011 +0000
     2.2 +++ b/src/video/bwindow/SDL_bopengl.cc	Tue Aug 09 16:34:25 2011 +0000
     2.3 @@ -42,11 +42,28 @@
     2.4  /* Passing a NULL path means load pointers from the application */
     2.5  int BE_GL_LoadLibrary(_THIS, const char *path)
     2.6  {
     2.7 +	image_info info;
     2.8 +			int32 cookie = 0;
     2.9 +	while (get_next_image_info(0, &cookie, &info) == B_OK) {
    2.10 +		void *location = NULL;
    2.11 +		if( get_image_symbol(info.id, "glBegin", B_SYMBOL_TYPE_ANY,
    2.12 +				&location) == B_OK) {
    2.13 +					
    2.14 +			printf("HERE2\n");
    2.15 +			_this->gl_config.dll_handle = (void *) info.id;
    2.16 +			_this->gl_config.driver_loaded = 1;
    2.17 +			SDL_strlcpy(_this->gl_config.driver_path, "libGL.so",
    2.18 +					SDL_arraysize(_this->gl_config.driver_path));
    2.19 +		}
    2.20 +	}
    2.21 +#if 0
    2.22 +printf("\n\nLibrary loading: %s\n\n", path);
    2.23  	if (path == NULL) {
    2.24  		if (_this->gl_config.dll_handle == NULL) {
    2.25  			image_info info;
    2.26  			int32 cookie = 0;
    2.27  			while (get_next_image_info(0, &cookie, &info) == B_OK) {
    2.28 +				printf(__FILE__": %d - Inside while\n",__LINE__);
    2.29  				void *location = NULL;
    2.30  				if (get_image_symbol
    2.31  				((image_id) cookie, "glBegin",
    2.32 @@ -69,7 +86,6 @@
    2.33          if (_this->gl_config.dll_handle == NULL) {
    2.34          	return BE_GL_LoadLibrary(_this, NULL);
    2.35          }
    2.36 -
    2.37              /* Unload old first */
    2.38              /*if (_this->gl_config.dll_handle != NULL) { */
    2.39              /* Do not try to unload application itself (if LoadLibrary was called before with NULL ;) */
    2.40 @@ -91,11 +107,13 @@
    2.41  	if (_this->gl_config.dll_handle != NULL) {
    2.42  		return 0;
    2.43  	} else {
    2.44 +printf(__FILE__": %d- gl_config.driver_loaded = 0\n", __LINE__);
    2.45  		_this->gl_config.dll_handle = NULL;
    2.46  		_this->gl_config.driver_loaded = 0;
    2.47  		*_this->gl_config.driver_path = '\0';
    2.48  		return -1;
    2.49  	}
    2.50 +#endif
    2.51  }
    2.52  
    2.53  void *BE_GL_GetProcAddress(_THIS, const char *proc)