This fixes experimental dynamic light effects ('light_enabled 1' and 'light_player_halo') which were broken by
0e101bd452c40da601236aaa2dd4106be47ddce1.
It's worth noting that they even work on my laptop's integrated video if I just set 'gwin_has_stencil' to True, even though the driver says it doesn't support stencils.
The discrete GPU on the same laptop reports it correctly.
(* --------- Graphics --------- *)
function LoadGL: Boolean;
+ {$IFNDEF NOGL_INIT}
+ var
+ ltmp: Integer;
+ {$ENDIF}
begin
result := true;
{$IFDEF NOGL_INIT}
nogl_Init;
if glRenderToFBO and (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) then
{$ELSE}
+ if SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, @ltmp) = 0 then
+ begin
+ e_LogWritefln('stencil buffer size: %s', [ltmp]);
+ gwin_has_stencil := (ltmp > 0);
+ end;
+
if glRenderToFBO and (not Load_GL_ARB_framebuffer_object) then
{$ENDIF}
begin
(* --------- Graphics --------- *)
function LoadGL: Boolean;
+ {$IFNDEF NOGL_INIT}
+ var
+ ltmp: Integer;
+ {$ENDIF}
begin
result := true;
{$IFDEF NOGL_INIT}
nogl_Init;
if glRenderToFBO and (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) then
{$ELSE}
+ if SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, @ltmp) = 0 then
+ begin
+ e_LogWritefln('stencil buffer size: %s', [ltmp]);
+ gwin_has_stencil := (ltmp > 0);
+ end;
+
if glRenderToFBO and (not Load_GL_ARB_framebuffer_object) then
{$ENDIF}
begin