summaryrefslogtreecommitdiff
path: root/navit/graphics/opengl/graphics_opengl.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-03-03 23:18:45 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-03-03 23:18:45 +0000
commit8d42bcbce304868bcd6df03e5b7596ff969c0c17 (patch)
treebce0144c399c4d4e4918272503dc116b511b446b /navit/graphics/opengl/graphics_opengl.c
parentba40a28285798ac5a4f3fb9450e009bae2c90e5f (diff)
downloadnavit-8d42bcbce304868bcd6df03e5b7596ff969c0c17.tar.gz
Fix:graphics_opengl:Better integration of opengl and es
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4959 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/graphics/opengl/graphics_opengl.c')
-rw-r--r--navit/graphics/opengl/graphics_opengl.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c
index 46f5686ef..40a959a57 100644
--- a/navit/graphics/opengl/graphics_opengl.c
+++ b/navit/graphics/opengl/graphics_opengl.c
@@ -59,12 +59,24 @@
#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;