hedgewars/uMisc.pas
changeset 2271 ca0754f0f42b
parent 2256 30797f3a4321
child 2272 c59656d7b1de
equal deleted inserted replaced
2270:71e67531f905 2271:ca0754f0f42b
   334 glGenTextures(1, @NewTexture^.id);
   334 glGenTextures(1, @NewTexture^.id);
   335 
   335 
   336 glBindTexture(GL_TEXTURE_2D, NewTexture^.id);
   336 glBindTexture(GL_TEXTURE_2D, NewTexture^.id);
   337 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
   337 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
   338 
   338 
   339 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   339 if not cReducedQuality then
   340 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
   340     begin
       
   341     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
       
   342     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
       
   343     end;
   341 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
   344 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
   342 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
   345 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
   343 end;
   346 end;
   344 
   347 
   345 function Surface2Tex(surf: PSDL_Surface): PTexture;
   348 function Surface2Tex(surf: PSDL_Surface): PTexture;