hedgewars/uStore.pas
changeset 11151 5c40c65b619d
parent 11046 47a8c19ecb60
parent 11106 2953f858a196
child 11317 62287d4044e7
equal deleted inserted replaced
11077:1fb80cd8ba7b 11151:5c40c65b619d
   368 
   368 
   369 if not cOnlyStats then
   369 if not cOnlyStats then
   370     begin
   370     begin
   371     MakeCrossHairs;
   371     MakeCrossHairs;
   372     LoadGraves;
   372     LoadGraves;
       
   373 {$IFDEF IPHONEOS}
       
   374     tmpHatSurf:= LoadDataImage(ptHats, 'chef', ifNone);
       
   375 {$ELSE}
   373     tmpHatSurf:= LoadDataImage(ptHats, 'Reserved/chef', ifNone);
   376     tmpHatSurf:= LoadDataImage(ptHats, 'Reserved/chef', ifNone);
       
   377 {$ENDIF}
   374     ChefHatTexture:= Surface2Tex(tmpHatSurf, true);
   378     ChefHatTexture:= Surface2Tex(tmpHatSurf, true);
   375     freeTmpHatSurf();
   379     freeTmpHatSurf();
   376     end;
   380     end;
   377 
   381 
   378 if not reload then
   382 if not reload then
   717 procedure SetupOpenGLAttributes;
   721 procedure SetupOpenGLAttributes;
   718 begin
   722 begin
   719 {$IFDEF IPHONEOS}
   723 {$IFDEF IPHONEOS}
   720     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
   724     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
   721     SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
   725     SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
       
   726  
       
   727     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
       
   728     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
   722 {$ELSE}
   729 {$ELSE}
   723     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
   730     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
   724 {$ENDIF}
   731 {$ENDIF}
   725 {$IFNDEF SDL2} // vsync is default in SDL2
   732 {$IFNDEF SDL2} // vsync is default in SDL2
   726     SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, LongInt((cReducedQuality and rqDesyncVBlank) = 0));
   733     SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, LongInt((cReducedQuality and rqDesyncVBlank) = 0));
   741 {$IFDEF SDL2}
   748 {$IFDEF SDL2}
   742     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_GetCurrentVideoDriver()) + ')');
   749     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_GetCurrentVideoDriver()) + ')');
   743 {$ELSE}
   750 {$ELSE}
   744     buf[0]:= char(0); // avoid compiler hint
   751     buf[0]:= char(0); // avoid compiler hint
   745     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
   752     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
       
   753 {$ENDIF}
       
   754 
       
   755 {$IFDEF MOBILE}
       
   756     // TODO: this function creates an opengles1.1 context
       
   757     // un-comment below and add proper logic to support opengles2.0
       
   758     //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
       
   759     //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
       
   760     if SDLGLcontext = nil then
       
   761         SDLGLcontext:= SDL_GL_CreateContext(SDLwindow);
       
   762     SDLTry(SDLGLcontext <> nil, true);
       
   763     SDL_GL_SetSwapInterval(1);
   746 {$ENDIF}
   764 {$ENDIF}
   747 
   765 
   748     RendererSetup();
   766     RendererSetup();
   749 end;
   767 end;
   750 
   768