hedgewars/uStore.pas
changeset 7350 1dbf3f4340e0
parent 7235 baa69bd025d9
child 7371 911b53e8c00a
equal deleted inserted replaced
7347:88685fbb2679 7350:1dbf3f4340e0
    47 procedure WarpMouse(x, y: Word); inline;
    47 procedure WarpMouse(x, y: Word); inline;
    48 procedure SwapBuffers; inline;
    48 procedure SwapBuffers; inline;
    49 
    49 
    50 implementation
    50 implementation
    51 uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands,
    51 uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands,
    52      uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} {$IFDEF USE_VIDEO_RECORDING}, glut {$ENDIF};
    52      uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF}
       
    53      {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF};
    53 
    54 
    54 //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple);
    55 //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple);
    55 
    56 
    56 var MaxTextureSize: LongInt;
    57 var MaxTextureSize: LongInt;
    57 {$IFDEF SDL13}
    58 {$IFDEF SDL13}
  1023 FreeTexture(WeaponTooltipTex);
  1024 FreeTexture(WeaponTooltipTex);
  1024 WeaponTooltipTex:= nil
  1025 WeaponTooltipTex:= nil
  1025 end;
  1026 end;
  1026 
  1027 
  1027 {$IFDEF USE_VIDEO_RECORDING}
  1028 {$IFDEF USE_VIDEO_RECORDING}
       
  1029 {$IFDEF SDL13}
       
  1030 procedure InitOffscreenOpenGL;
       
  1031 begin
       
  1032     // create hidden window
       
  1033     SDLwindow:= SDL_CreateWindow('hedgewars (you don''t see this)',
       
  1034                                  SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK,
       
  1035                                  cScreenWidth, cScreenHeight,
       
  1036                                  SDL_WINDOW_HIDDEN or SDL_WINDOW_OPENGL);
       
  1037     SDLTry(SDLwindow <> nil, true);
       
  1038     SetupOpenGL();
       
  1039 end;
       
  1040 {$ELSE}
  1028 procedure InitOffscreenOpenGL;
  1041 procedure InitOffscreenOpenGL;
  1029 var ArgCount: LongInt;
  1042 var ArgCount: LongInt;
  1030     PrgName: pchar;
  1043     PrgName: pchar;
  1031 begin
  1044 begin
  1032     ArgCount:= 1;
  1045     ArgCount:= 1;
  1033     PrgName:= 'hwengine';
  1046     PrgName:= 'hwengine';
  1034     glutInit(@ArgCount, @PrgName);
  1047     glutInit(@ArgCount, @PrgName);
  1035     glutInitWindowSize(cScreenWidth, cScreenHeight);
  1048     glutInitWindowSize(cScreenWidth, cScreenHeight);
  1036     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
  1049     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
  1037     glutHideWindow();
  1050     glutHideWindow();
  1038     SetupOpenGL();
  1051     SetupOpenGL();
  1039 end;
  1052 end;
  1040 {$ENDIF}
  1053 {$ENDIF} // SDL13
       
  1054 {$ENDIF} // USE_VIDEO_RECORDING
  1041 
  1055 
  1042 procedure chFullScr(var s: shortstring);
  1056 procedure chFullScr(var s: shortstring);
  1043 var flags: Longword = 0;
  1057 var flags: Longword = 0;
  1044     reinit: boolean = false;
  1058     reinit: boolean = false;
  1045     {$IFNDEF DARWIN}ico: PSDL_Surface;{$ENDIF}
  1059     {$IFNDEF DARWIN}ico: PSDL_Surface;{$ENDIF}