summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b1e7f99)
raw | patch | inline | side by side (parent: b1e7f99)
author | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Thu, 23 Mar 2023 18:02:48 +0000 (04:02 +1000) | ||
committer | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Thu, 23 Mar 2023 18:02:48 +0000 (04:02 +1000) |
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.
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.
src/game/sdl/g_system.pas | patch | blob | history | |
src/game/sdl2/g_system.pas | patch | blob | history |
index 0fcad1aec0afa596a05959c9388e5de33f7ff502..cc8704c9713e76700e0da37c4cdc14c45f9d3d2f 100644 (file)
(* --------- 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
index 9cd1ee194b0ae4b89bb587e593c689067fd477cb..b3005d56b637b464dfa8341f756ef63c12ba21f7 100644 (file)
(* --------- 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