X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fsdl2%2Fg_system.pas;h=3ab85d2ab804130ecfc8e282c9c4898a9b533b6e;hb=541bba4ec498539ae13827e2c821b1eb8bca7db8;hp=9cd1ee194b0ae4b89bb587e593c689067fd477cb;hpb=a280ce1ab3f2d28a227e7cf492a12c749e4d5290;p=d2df-sdl.git diff --git a/src/game/sdl2/g_system.pas b/src/game/sdl2/g_system.pas index 9cd1ee1..3ab85d2 100644 --- a/src/game/sdl2/g_system.pas +++ b/src/game/sdl2/g_system.pas @@ -41,7 +41,7 @@ implementation uses SysUtils, SDL2, Math, ctypes, - e_log, e_graphics, e_input, e_sound, + e_log, r_graphics, e_input, e_sound, {$INCLUDE ../nogl/noGLuses.inc} {$IFDEF ENABLE_HOLMES} g_holmes, sdlcarcass, fui_ctls, @@ -75,17 +75,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;