hedgewars/uStore.pas
changeset 10275 6c91047f59b6
parent 10266 a90a55ec5b98
child 10276 89056c7254ef
--- a/hedgewars/uStore.pas	Wed Jun 11 00:35:23 2014 +0400
+++ b/hedgewars/uStore.pas	Tue Jun 10 23:21:22 2014 +0200
@@ -63,14 +63,13 @@
 
 {$IFDEF GL2}
 procedure UpdateModelviewProjection;
+{$ENDIF}
+
 procedure EnableTexture(enable:Boolean);
-{$ENDIF}
 
 procedure SetTexCoordPointer(p: Pointer;n: Integer);
 procedure SetVertexPointer(p: Pointer;n: Integer);
 procedure SetColorPointer(p: Pointer;n: Integer);
-procedure BeginWater;
-procedure EndWater;
 
 procedure updateViewLimits();
 
@@ -1094,15 +1093,20 @@
     // disable/lower perspective correction (will not need it anyway)
 end;
 
-{$IFDEF GL2}
 procedure EnableTexture(enable:Boolean);
 begin
+    {$IFDEF GL2}
     if enable then
         glUniform1i(glGetUniformLocation(shaderMain, pchar('enableTexture')), 1)
     else
         glUniform1i(glGetUniformLocation(shaderMain, pchar('enableTexture')), 0);
+    {$ELSE}
+    if enable then
+        glEnable(GL_TEXTURE_2D)
+    else
+        glDisable(GL_TEXTURE_2D);
+    {$ENDIF}
 end;
-{$ENDIF}
 
 procedure SetTexCoordPointer(p: Pointer; n: Integer);
 begin
@@ -1225,34 +1229,6 @@
 {$ENDIF}
 end;
 
-procedure BeginWater;
-begin
-{$IFDEF GL2}
-    glUseProgram(shaderWater);
-    uCurrentMVPLocation:=uWaterMVPLocation;
-    UpdateModelviewProjection;
-    glDisableVertexAttribArray(aTexCoord);
-    glEnableVertexAttribArray(aColor);
-{$ELSE}
-    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-    glEnableClientState(GL_COLOR_ARRAY);
-{$ENDIF}
-end;
-
-procedure EndWater;
-begin
-{$IFDEF GL2}
-    glUseProgram(shaderMain);
-    uCurrentMVPLocation:=uMainMVPLocation;
-    UpdateModelviewProjection;
-    glDisableVertexAttribArray(aColor);
-    glEnableVertexAttribArray(aTexCoord);
-{$ELSE}
-    glDisableClientState(GL_COLOR_ARRAY);
-    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-{$ENDIF}
-end;
-
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure AddProgress;