Przeglądaj źródła

try to add some extra error handling -- try to create a compatible kate config for editting

edA-qa mort-ora-y 13 lat temu
rodzic
commit
b87a0a9060
2 zmienionych plików z 7 dodań i 1 usunięć
  1. 1 0
      .kateconfig
  2. 6 1
      gameplay/src/PlatformLinux.cpp

+ 1 - 0
.kateconfig

@@ -0,0 +1 @@
+kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; show-tabs: on; replace-tabs-save: off; replace-trailing-space-save: off;

+ 6 - 1
gameplay/src/PlatformLinux.cpp

@@ -453,11 +453,16 @@ Platform* Platform::create(Game* game, void* attachToWindow)
     __window = XCreateWindow(__display, DefaultRootWindow(__display), 0, 0, 1280, 720, 0, 
     __window = XCreateWindow(__display, DefaultRootWindow(__display), 0, 0, 1280, 720, 0, 
                             visualInfo->depth, InputOutput, visualInfo->visual, winMask,
                             visualInfo->depth, InputOutput, visualInfo->visual, winMask,
                             &winAttribs); 
                             &winAttribs); 
-   
+    
     XMapWindow(__display, __window);
     XMapWindow(__display, __window);
     XStoreName(__display, __window, "");
     XStoreName(__display, __window, "");
 
 
     __context = glXCreateContext(__display, visualInfo, NULL, True);
     __context = glXCreateContext(__display, visualInfo, NULL, True);
+    if(!__context)
+    {
+        perror("glXCreateContext");
+        return NULL;
+    }
     glXMakeCurrent(__display, __window, __context);
     glXMakeCurrent(__display, __window, __context);
 
 
     // Use OpenGL 2.x with GLEW  (TODO: Currently crashing here...)
     // Use OpenGL 2.x with GLEW  (TODO: Currently crashing here...)