HGLRC GLCONTEXT=NULL;\r
#endif\r
\r
-#ifdef MAEMO_CHANGES\r
#define MODE_RAW 0\r
#define MODE_X11 1\r
#define MODE_SDL 2\r
-int pandora_driver_mode = MODE_RAW;\r
int use_fsaa = 0;\r
\r
EGLDisplay display;\r
\r
EGLint attrib_list[] =\r
{\r
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,\r
- EGL_BUFFER_SIZE, 0,\r
- EGL_DEPTH_SIZE, 16,\r
+// EGL_DEPTH_SIZE, 16,\r
EGL_NONE\r
};\r
\r
return TRUE;\r
}\r
\r
-void maemoGLinit(){\r
+static void initEGL(void)\r
+{\r
printf ("GL init\n");\r
\r
EGLint numConfigs;\r
}\r
\r
#if defined(USE_X11)\r
- pandora_driver_mode = MODE_X11; // TODO make configurable\r
-#else\r
- pandora_driver_mode = MODE_RAW; // TODO make configurable\r
-#endif\r
- \r
- switch(pandora_driver_mode)\r
- { \r
-#if defined(USE_X11)\r
- case MODE_X11:\r
// Initializes the display and screen\r
x11Display = XOpenDisplay( ":0" );\r
if (!x11Display)\r
XSendEvent(x11Display, DefaultRootWindow(x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);\r
\r
display = eglGetDisplay( (EGLNativeDisplayType)x11Display );\r
- break;\r
-#endif\r
- case MODE_RAW:\r
- default:\r
+#else\r
display = eglGetDisplay( (EGLNativeDisplayType)0 );\r
- break;\r
- }\r
+#endif\r
\r
if( display == EGL_NO_DISPLAY )\r
{\r
printf( "GLES EGL Error: eglCreateContext failed\n" );\r
}\r
\r
- switch(pandora_driver_mode)\r
- {\r
#if defined(USE_X11)\r
- case MODE_X11:\r
surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)x11Window, NULL );\r
- break;\r
-#endif\r
- case MODE_RAW:\r
- default:\r
+#else\r
surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)0, NULL );\r
- break;\r
- }\r
+#endif\r
\r
eglMakeCurrent( display, surface, surface, context );\r
if (!TestEGLError("eglMakeCurrent"))\r
else\r
printf("GLES Window Opened\n");\r
}\r
-#endif\r
\r
int GLinitialize() \r
{\r
// CheckWGLExtensions(dcGlobal);\r
if(bWindowMode) ReleaseDC(hWWindow,dcGlobal); // win mode: release dc again\r
#endif\r
-#ifdef MAEMO_CHANGES\r
- maemoGLinit();\r
-#endif\r
+ initEGL();\r
+\r
//----------------------------------------------------// \r
\r
glViewport(rRatioRect.left, // init viewport by ratio rect\r
eglTerminate( display );\r
\r
#if defined(USE_X11)\r
- if (pandora_driver_mode == MODE_X11)\r
- {\r
if (x11Window) XDestroyWindow(x11Display, x11Window);\r
if (x11Colormap) XFreeColormap( x11Display, x11Colormap );\r
if (x11Display) XCloseDisplay(x11Display);\r
- }\r
#endif\r
}\r
\r
#define GREEN(x) ((x>>8) & 0xff)\r
#define COLOR(x) (x & 0xffffff)\r
\r
-#ifdef _WINDOWS\r
-#include "Externals.h"\r
-#include "plugin.h"\r
-#include <gl/gl.h>\r
-#else\r
-//#ifndef MAEMO_CHANGES\r
-// #include "psxCommon.h"\r
-//#else\r
-// #include "../psxCommon.h"\r
-//#endif\r
+\r
#include "gpuExternals.h"\r
-#ifdef __NANOGL__\r
-#include <gl/gl.h>\r
-#else\r
-#ifdef SOFT_LINKAGE\r
-#pragma softfp_linkage\r
-#endif\r
-#ifndef MAEMO_CHANGES\r
- #include <gles/gl.h> // for opengl es types \r
- #include <gles/egltypes.h>\r
-#else\r
-#include "gpuStdafx.h"\r
-#endif\r
-#ifdef SOFT_LINKAGE\r
-#pragma no_softfp_linkage\r
-#endif\r
-#endif\r
-#endif\r
+\r
/////////////////////////////////////////////////////////////////////////////\r
\r
#define CALLBACK\r
#ifdef SOFT_LINKAGE\r
#pragma softfp_linkage\r
#endif\r
-#ifdef MAEMO_CHANGES\r
-\r
- //#include <GLES/glplatform.h>\r
- #include <GLES/gl.h>\r
- //#include <GLES/glext.h>\r
- #include <GLES/EGL/egl.h>\r
- //#include "../maemo/minimal.h"\r
- //#include <gdk/gdkx.h>\r
- //#include <gdk/gdk.h>\r
-\r
-\r
-#else\r
- #include <gles/gl.h> // for opengl es types \r
- #include <gles/egltypes.h>\r
-#endif\r
+#include <GLES/gl.h> // for opengl es types \r
+//#include <GLES/egltypes.h>\r
+#include <EGL/egl.h>\r
#ifdef SOFT_LINKAGE\r
#pragma no_softfp_linkage\r
#endif\r