hedgewars/uStore.pas
changeset 5045 f215eb5d4b75
parent 5043 2df62e1a6c02
child 5052 74a81c276d67
equal deleted inserted replaced
5043:2df62e1a6c02 5045:f215eb5d4b75
   625     glTranslatef(0, -cScreenHeight / 2, 0);
   625     glTranslatef(0, -cScreenHeight / 2, 0);
   626 
   626 
   627     // enable alpha blending
   627     // enable alpha blending
   628     glEnable(GL_BLEND);
   628     glEnable(GL_BLEND);
   629     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   629     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   630     // disable/lower perspective correction (won't need it anyway)
   630     // disable/lower perspective correction (will not need it anyway)
   631     glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
   631     glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
   632     // disable dithering
   632     // disable dithering
   633     glDisable(GL_DITHER);
   633     glDisable(GL_DITHER);
   634     // enable common states by default as they save a lot
   634     // enable common states by default as they save a lot
   635     glEnable(GL_TEXTURE_2D);
   635     glEnable(GL_TEXTURE_2D);
   869     DrawTexture(x, y, WeaponTooltipTex)
   869     DrawTexture(x, y, WeaponTooltipTex)
   870 end;
   870 end;
   871 
   871 
   872 procedure FreeWeaponTooltip;
   872 procedure FreeWeaponTooltip;
   873 begin
   873 begin
   874 // free the existing texture (if there's any)
   874 // free the existing texture (if there is any)
   875 if WeaponTooltipTex = nil then
   875 if WeaponTooltipTex = nil then
   876     exit;
   876     exit;
   877 FreeTexture(WeaponTooltipTex);
   877 FreeTexture(WeaponTooltipTex);
   878 WeaponTooltipTex:= nil
   878 WeaponTooltipTex:= nil
   879 end;
   879 end;
   936     end;
   936     end;
   937 
   937 
   938     SDL_SetRenderDrawColor(SDLrender, 0, 0, 0, 255);
   938     SDL_SetRenderDrawColor(SDLrender, 0, 0, 0, 255);
   939     SDL_RenderClear(SDLrender);
   939     SDL_RenderClear(SDLrender);
   940     SDL_RenderPresent(SDLrender);
   940     SDL_RenderPresent(SDLrender);
       
   941 
       
   942     // we need to reset the gl context from the one created by SDL as we have our own drawing system
       
   943     glMatrixMode(GL_PROJECTION);
       
   944     glLoadIdentity();
   941 {$ELSE}
   945 {$ELSE}
   942     SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags);
   946     SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags);
   943     SDLTry(SDLPrimSurface <> nil, true);
   947     SDLTry(SDLPrimSurface <> nil, true);
   944     PixelFormat:= SDLPrimSurface^.format;
       
   945 {$ENDIF}
   948 {$ENDIF}
   946 
   949 
   947     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
   950     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
   948     SetupOpenGL();
   951     SetupOpenGL();
   949 end;
   952 end;
   952 var ai: TAmmoType;
   955 var ai: TAmmoType;
   953     i: LongInt;
   956     i: LongInt;
   954 begin
   957 begin
   955     RegisterVariable('fullscr', vtCommand, @chFullScr, true);
   958     RegisterVariable('fullscr', vtCommand, @chFullScr, true);
   956 
   959 
   957     PixelFormat:= nil;
       
   958     SDLPrimSurface:= nil;
   960     SDLPrimSurface:= nil;
   959 
   961 
   960 {$IFNDEF IPHONEOS}
   962 {$IFNDEF IPHONEOS}
   961     rotationQt:= 0;
   963     rotationQt:= 0;
   962     cGPUVendor:= gvUnknown;
   964     cGPUVendor:= gvUnknown;