DEADSOFTWARE

Game: Use proper syntax of sets for game options instead of raw bitwise operations
[d2df-sdl.git] / src / game / sdl / g_system.pas
index 0fcad1aec0afa596a05959c9388e5de33f7ff502..9f562621fe8d1366775a56d3d78ffa7178e5860d 100644 (file)
@@ -78,17 +78,27 @@ implementation
   (* --------- Graphics --------- *)
 
   function LoadGL: Boolean;
+    var ltmp: Integer;
   begin
     result := true;
     {$IFDEF NOGL_INIT}
-    nogl_Init;
-    if glRenderToFBO and (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) then
+      nogl_Init;
+      if glRenderToFBO and (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) then
+      begin
+        e_LogWriteln('GL: framebuffer objects not supported; disabling FBO rendering');
+        glRenderToFBO := false;
+      end;
     {$ELSE}
-    if glRenderToFBO and (not Load_GL_ARB_framebuffer_object) then
+      if glRenderToFBO and (not Load_GL_ARB_framebuffer_object) then
+      begin
+        e_LogWriteln('GL: framebuffer objects not supported; disabling FBO rendering');
+        glRenderToFBO := false;
+      end;
     {$ENDIF}
+    if SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, ltmp) = 0 then
     begin
-      e_LogWriteln('GL: framebuffer objects not supported; disabling FBO rendering');
-      glRenderToFBO := false;
+      e_LogWritefln('stencil buffer size: %s', [ltmp]);
+      gwin_has_stencil := (ltmp > 0);
     end;
   end;