GL1.x fixes
authorWolfgang Steffens <WolfgangSteff@gmail.com>
Mon, 25 Jun 2012 16:22:03 +0200
changeset 7301 bea42438a2ec
parent 7299 c633d00dc593
child 7304 8b3575750cd2
GL1.x fixes
hedgewars/uAtlas.pas
hedgewars/uWorld.pas
--- a/hedgewars/uAtlas.pas	Mon Jun 25 15:46:49 2012 +0200
+++ b/hedgewars/uAtlas.pas	Mon Jun 25 16:22:03 2012 +0200
@@ -127,13 +127,18 @@
         if not Info[i].allocated then
             continue;
         glGetIntegerv(GL_VIEWPORT, @vp);
+{$IFDEF GL2}
         glGetIntegerv(GL_CURRENT_PROGRAM, @prog);
-
         glUseProgram(0);
+{$ENDIF}
+        glPushMatrix;
+        glLoadIdentity;
+        glMatrixMode(GL_PROJECTION);
         glPushMatrix;
         glLoadIdentity;
         glOrtho(0, vp[2], vp[3], 0, -1, 1);
 
+        glDisable(GL_CULL_FACE);
 
         glBindTexture(GL_TEXTURE_2D, Info[i].TextureInfo.id);
         glBegin(GL_QUADS);
@@ -148,6 +153,8 @@
         glEnd();
 
         glPopMatrix;
+        glMatrixMode(GL_MODELVIEW);
+        glPopMatrix;
 
         inc(x);
         if (x = 2) then
@@ -156,8 +163,9 @@
             inc(y);
         end;
      
-
+{$IFDEF GL2}
         glUseProgram(prog);
+{$ENDIF}
     end;
 end;
 
--- a/hedgewars/uWorld.pas	Mon Jun 25 15:46:49 2012 +0200
+++ b/hedgewars/uWorld.pas	Mon Jun 25 16:22:03 2012 +0200
@@ -957,7 +957,7 @@
         begin
         glClear(GL_COLOR_BUFFER_BIT);
         DrawWorldStereo(Lag, rmDefault)
-        end;
+        end
 {$IFNDEF S3D_DISABLED}
     else if (cStereoMode = smAFR) then
         begin
@@ -1066,6 +1066,8 @@
             glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE);
         DrawWorldStereo(Lag, rmRightEye);
         end;
+{$ELSE}
+    ;
 {$ENDIF}
     DebugAtlas;
 end;