X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_window.pas;h=e7cc9cd5bb37b42372c61a8bc8e9c9000630e066;hp=6dfa778096ff33f616b553c00539c81b542227fd;hb=7d312543a62c1a290f329110d16835c9065f0147;hpb=3e3656b8e0aae5d48e61910bcbed1652457b4fa9 diff --git a/src/game/g_window.pas b/src/game/g_window.pas index 6dfa778..e7cc9cd 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -39,6 +39,7 @@ function g_Window_SetSize(W, H: Word; FScreen: Boolean): Boolean; var gwin_dump_extensions: Boolean = false; gwin_has_stencil: Boolean = false; + gwin_k8_enable_light_experiments: Boolean = false; implementation @@ -641,7 +642,10 @@ begin SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1); // lights; it is enough to have 1-bit stencil buffer for lighting + if gwin_k8_enable_light_experiments then + begin + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1); // lights; it is enough to have 1-bit stencil buffer for lighting + end; SDL_GL_SetSwapInterval(v); end; @@ -695,6 +699,12 @@ begin e_NoGraphics := True; {$ENDIF} + for idx := 1 to ParamCount do + begin + if ParamStr(idx) = '--opengl-dump-exts' then gwin_dump_extensions := true; + if ParamStr(idx) = '--twinkletwinkle' then gwin_k8_enable_light_experiments := true; + end; + e_WriteLog('Initializing OpenGL', MSG_NOTIFY); InitOpenGL(gVSync); @@ -707,16 +717,17 @@ begin {EnumDisplayModes();} - for idx := 1 to ParamCount do + if gwin_k8_enable_light_experiments then begin - if ParamStr(idx) = '--opengl-dump-exts' then gwin_dump_extensions := true; + SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, @ltmp); + e_WriteLog(Format('stencil buffer size: %d', [ltmp]), MSG_WARNING); + gwin_has_stencil := (ltmp > 0); + end + else + begin + gwin_has_stencil := false; end; - SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, @ltmp); - e_WriteLog(Format('stencil buffer size: %d', [ltmp]), MSG_WARNING); - - gwin_has_stencil := (ltmp > 0); - if not glHasExtension('GL_ARB_texture_non_power_of_two') then begin e_WriteLog('Driver DID''T advertised NPOT textures support', MSG_WARNING);