DEADSOFTWARE

simple allocation counter for classes
[d2df-sdl.git] / src / engine / e_texture.pas
index 6c348baeef3d8a95551225db70058bc0b8c4c6db..62ace83b459098298fa725a7ba72a71c34070314 100644 (file)
@@ -111,7 +111,7 @@ begin
     e_WriteLog(Format('NPOT: %u is %ux%u; gl is %ux%u; u=%f; v=%f', [tex.id, Width, Height, tex.glwidth, tex.glheight, tex.u, tex.v]), MSG_NOTIFY);
 
   // texture blends with object background
-  glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
   // texture does NOT blend with object background
   //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
 
@@ -162,6 +162,10 @@ begin
 
   glBindTexture(GL_TEXTURE_2D, 0);
 
+  // so driver will really upload the texture (this is *sometimes* required for buggy videodrivers)
+  glFlush();
+  glFinish();
+
   Result := true;
 end;
 
@@ -192,7 +196,7 @@ begin
   imageSize := Width*Height*4;
   GetMem(image, imageSize);
   try
-    // it's slow, but i don't care for now
+    // it is slow, but i don't care for now
     ii := image;
     for y := height-1 downto 0 do
     begin
@@ -274,7 +278,7 @@ begin
     imageSize := img.width*img.height*4;
     GetMem(image, imageSize);
     try
-      // it's slow, but i don't care for now
+      // it is slow, but i don't care for now
       ii := image;
       for y := fY+fHeight-1 downto fY do
       begin