Browse Source

support wiregl

David Rose 24 years ago
parent
commit
1117e9a497

+ 4 - 0
panda/src/wgldisplay/config_wgldisplay.cxx

@@ -40,6 +40,10 @@ int gl_forced_pixfmt=config_wgldisplay.GetInt("gl-force-pixfmt", 0);
 
 
 bool bResponsive_minimized_fullscreen_window = config_wgldisplay.GetBool("responsive-minimized-fullscreen-window",false);
 bool bResponsive_minimized_fullscreen_window = config_wgldisplay.GetBool("responsive-minimized-fullscreen-window",false);
 
 
+// Set this true to not attempt to use any of the function calls that
+// will crab out WireGL.
+bool support_wiregl = config_wgldisplay.GetBool("support-wiregl", false);
+
 extern void AtExitFn(void);
 extern void AtExitFn(void);
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 0
panda/src/wgldisplay/config_wgldisplay.h

@@ -36,6 +36,7 @@ extern float gl_fps_meter_update_interval;
 extern bool gl_sync_video;
 extern bool gl_sync_video;
 extern int gl_forced_pixfmt;
 extern int gl_forced_pixfmt;
 extern bool bResponsive_minimized_fullscreen_window;
 extern bool bResponsive_minimized_fullscreen_window;
+extern bool support_wiregl;
 
 
 extern EXPCL_PANDAGL void init_libwgldisplay();
 extern EXPCL_PANDAGL void init_libwgldisplay();
 
 

+ 7 - 4
panda/src/wgldisplay/wglGraphicsWindow.cxx

@@ -567,10 +567,13 @@ void wglGraphicsWindow::config(void) {
 
 
   _extensions_str = tmpstr;
   _extensions_str = tmpstr;
 
 
-  PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT;
-  PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
-  wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
-  wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)wglGetProcAddress("wglGetExtensionsStringEXT");
+  PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT = NULL;
+  PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = NULL;
+
+  if (!support_wiregl) {
+    wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
+    wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)wglGetProcAddress("wglGetExtensionsStringEXT");
+  }
 
 
   if(wglGetExtensionsStringARB!=NULL) {
   if(wglGetExtensionsStringARB!=NULL) {
        _extensions_str += " ";
        _extensions_str += " ";