# HG changeset patch # User Stepan777 # Date 1341566553 -14400 # Node ID 1dbf3f4340e09580ee12c5ac506dfbf93cc84e66 # Parent 88685fbb26791d6083a98b6dc20295bbaf3d3b90 When compiling with sdl2 use it instead of glut for creating hidden window (as suggested by koda). This is not tested but it should work. diff -r 88685fbb2679 -r 1dbf3f4340e0 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Fri Jul 06 12:50:18 2012 +0400 +++ b/hedgewars/uStore.pas Fri Jul 06 13:22:33 2012 +0400 @@ -49,7 +49,8 @@ implementation uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands, - uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} {$IFDEF USE_VIDEO_RECORDING}, glut {$ENDIF}; + uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} + {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF}; //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple); @@ -1025,6 +1026,18 @@ end; {$IFDEF USE_VIDEO_RECORDING} +{$IFDEF SDL13} +procedure InitOffscreenOpenGL; +begin + // create hidden window + SDLwindow:= SDL_CreateWindow('hedgewars (you don''t see this)', + SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK, + cScreenWidth, cScreenHeight, + SDL_WINDOW_HIDDEN or SDL_WINDOW_OPENGL); + SDLTry(SDLwindow <> nil, true); + SetupOpenGL(); +end; +{$ELSE} procedure InitOffscreenOpenGL; var ArgCount: LongInt; PrgName: pchar; @@ -1033,11 +1046,12 @@ PrgName:= 'hwengine'; glutInit(@ArgCount, @PrgName); glutInitWindowSize(cScreenWidth, cScreenHeight); - glutCreateWindow('You don''t see this'); // we don't need a window, but if this function is not called then OpenGL will not be initialized + glutCreateWindow('hedgewars (you don''t see this)'); // we don't need a window, but if this function is not called then OpenGL will not be initialized glutHideWindow(); SetupOpenGL(); end; -{$ENDIF} +{$ENDIF} // SDL13 +{$ENDIF} // USE_VIDEO_RECORDING procedure chFullScr(var s: shortstring); var flags: Longword = 0;