Fix:graphics_opengl:Better integration of opengl and es
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 3 Mar 2012 23:18:45 +0000 (23:18 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 3 Mar 2012 23:18:45 +0000 (23:18 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4959 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/graphics/opengl/graphics_opengl.c

index 46f5686..40a959a 100644 (file)
 #if USE_OPENGLES2
 #include <GLES2/gl2.h>
 #include <EGL/egl.h>
-#define glF(x)  x
-#define GL_F    GL_FLOAT
-typedef GLfloat GLf;
+#undef USE_FLOAT
+#define USE_FLOAT 1
 #else
 #include <GLES/gl.h>
 #include <GLES/egl.h>
+#endif
+extern EGLSurface eglwindow;
+extern EGLDisplay egldisplay;
+#else
+#define glOrthof       glOrtho
+#undef USE_FLOAT
+#define USE_FLOAT 1
+#ifdef __APPLE__
+#include <GLUT/glut.h>
+#else
+#include <GL/glut.h>           /* glut.h includes gl.h and glu.h */
+#endif
+#endif
 
 #if USE_FLOAT
 #define glF(x)  x
@@ -88,17 +100,6 @@ typedef GLfixed GLf;
 #endif
 #define glTexParameteri       glTexParameterx
 
-#endif
-extern EGLSurface eglwindow;
-extern EGLDisplay egldisplay;
-#else
-#ifdef __APPLE__
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>           /* glut.h includes gl.h and glu.h */
-#endif
-#endif
-
 #define SCREEN_WIDTH 700
 #define SCREEN_HEIGHT 700
 
@@ -1658,20 +1659,11 @@ resize_callback(int w, int h)
        glViewport(0, 0, w, h);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
-#if USE_OPENGLES
 #ifdef MIRRORED_VIEW
        glOrthof(glF(w), glF(0), glF(h), glF(0), glF(1), glF(-1));
 #else
        glOrthof(glF(0), glF(w), glF(h), glF(0), glF(1), glF(-1));
 #endif
-#else
-#ifdef MIRRORED_VIEW
-       gluOrtho2D(w, 0, h, 0.0);       //mirrored mode
-#else
-       gluOrtho2D(0, w, h, 0.0);
-#endif
-#endif
-
        graphics_priv_root->width = w;
        graphics_priv_root->height = h;