# HG changeset patch
# User antonc27 <antonc27@mail.ru>
# Date 1439062961 -7200
# Node ID 95f97c4d154cb31fcb4b11fcca3a264c53b9f7a9
# Parent  18722e5bd386bb9d381f9dc9896f95ab1752c0e2
- Another fix for uRender.pas

Note: SDLGLcontext not visible in scope of uRender, so moving it to uStore

diff -r 18722e5bd386 -r 95f97c4d154c hedgewars/uRender.pas
--- a/hedgewars/uRender.pas	Sat Aug 08 21:37:19 2015 +0200
+++ b/hedgewars/uRender.pas	Sat Aug 08 21:42:41 2015 +0200
@@ -434,17 +434,6 @@
     tmpint: LongInt;
     tmpn: LongInt;
 begin
-{$IFDEF MOBILE}
-    // TODO: this function creates an opengles1.1 context
-    // un-comment below and add proper logic to support opengles2.0
-    //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
-    //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
-    if SDLGLcontext = nil then
-        SDLGLcontext:= SDL_GL_CreateContext(SDLwindow);
-    SDLTry(SDLGLcontext <> nil, true);
-    SDL_GL_SetSwapInterval(1);
-{$ENDIF}
-
     // suppress hint/warning
     AuxBufNum:= AuxBufNum;
 
diff -r 18722e5bd386 -r 95f97c4d154c hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Sat Aug 08 21:37:19 2015 +0200
+++ b/hedgewars/uStore.pas	Sat Aug 08 21:42:41 2015 +0200
@@ -745,6 +745,17 @@
     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
 {$ENDIF}
 
+{$IFDEF MOBILE}
+    // TODO: this function creates an opengles1.1 context
+    // un-comment below and add proper logic to support opengles2.0
+    //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
+    //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
+    if SDLGLcontext = nil then
+        SDLGLcontext:= SDL_GL_CreateContext(SDLwindow);
+    SDLTry(SDLGLcontext <> nil, true);
+    SDL_GL_SetSwapInterval(1);
+{$ENDIF}
+
     RendererSetup();
 end;