aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/gpu-gles/Makefile43
-rw-r--r--plugins/gpu-gles/gpuDraw.c229
-rw-r--r--plugins/gpu-gles/gpuDraw.h3
-rw-r--r--plugins/gpu-gles/gpuExternals.h21
-rw-r--r--plugins/gpu-gles/gpuPlugin.c71
-rw-r--r--plugins/gpu-gles/gpuPlugin.h56
-rw-r--r--plugins/gpu-gles/gpuPrim.c8
-rw-r--r--plugins/gpu-gles/gpuStdafx.h16
-rw-r--r--plugins/gpu-gles/gpuTexture.c21
9 files changed, 317 insertions, 151 deletions
diff --git a/plugins/gpu-gles/Makefile b/plugins/gpu-gles/Makefile
new file mode 100644
index 0000000..48f84b8
--- /dev/null
+++ b/plugins/gpu-gles/Makefile
@@ -0,0 +1,43 @@
+##############################################################################
+# MAKEFILE FOR PETE'S MESAGL GPU... just run "make"
+##############################################################################
+
+##############################################################################
+# 1. SETS (CCFLAGS3 is used)
+##############################################################################
+
+PREFIX = /mythtv/media/devel/toolchains/pandora/arm-2007q3
+TARGET = arm-none-linux-gnueabi-
+
+CC = $(PREFIX)/bin/$(TARGET)gcc
+
+CCFLAGS = -fPIC -c -Wall -O3 -ffast-math -fomit-frame-pointer -DMAEMO_CHANGES -DUSE_X11
+
+
+INCLUDE = -I$(PREFIX)/include
+LINK = $(PREFIX)/bin/$(TARGET)gcc
+LINKFLAGS = -shared -Wl,-soname,libgpuGLES.so -o libgpuGLES.so.1.0.0
+OBJ = gpuDraw.o gpuFps.o gpuPlugin.o gpuPrim.o gpuTexture.o
+
+LIB = -L$(PREFIX)/lib -lGLES_CM -lX11 -lXau -lXdmcp -lstdc++
+
+##############################################################################
+# 2. MAIN RULE
+##############################################################################
+
+gpuPeopsMesaGL : $(OBJ)
+ $(LINK) $(LINKFLAGS) $(OBJ) $(LIB)
+
+##############################################################################
+# 3. GENERAL RULES
+##############################################################################
+
+%.o : %.c
+ $(CC) $(CCFLAGS) $(INCLUDE) $<
+
+##############################################################################
+# 4. SPECIFIC RULES
+##############################################################################
+
+clean:
+ rm *.o libgpuGLES.so* \ No newline at end of file
diff --git a/plugins/gpu-gles/gpuDraw.c b/plugins/gpu-gles/gpuDraw.c
index 3d09c33..597f286 100644
--- a/plugins/gpu-gles/gpuDraw.c
+++ b/plugins/gpu-gles/gpuDraw.c
@@ -39,7 +39,7 @@
#include "texture.h"
#else
#include "gpuExternals.h"
-#include "GPUPlugin.h"
+#include "gpuPlugin.h"
#include "gpuDraw.h"
#include "gpuPrim.h"
#include "gpuTexture.h"
@@ -309,6 +309,48 @@ HGLRC GLCONTEXT=NULL;
#endif
#ifdef MAEMO_CHANGES
+#define MODE_RAW 0
+#define MODE_X11 1
+#define MODE_SDL 2
+int pandora_driver_mode = MODE_RAW;
+int use_fsaa = 0;
+
+EGLDisplay display;
+EGLConfig config;
+EGLContext context;
+EGLSurface surface;
+
+#if defined(USE_X11)
+#include "X11/Xlib.h"
+#include "X11/Xutil.h"
+#include "X11/Xatom.h"
+
+Window x11Window = 0;
+Display* x11Display = 0;
+long x11Screen = 0;
+XVisualInfo x11Visual;
+XVisualInfo* px11Visual = 0;
+Colormap x11Colormap = 0;
+#endif
+
+EGLint attrib_list_fsaa[] =
+{
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_BUFFER_SIZE, 0,
+ EGL_DEPTH_SIZE, 16,
+ EGL_SAMPLE_BUFFERS, 1,
+ EGL_SAMPLES, 4,
+ EGL_NONE
+};
+
+EGLint attrib_list[] =
+{
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_BUFFER_SIZE, 0,
+ EGL_DEPTH_SIZE, 16,
+ EGL_NONE
+};
+
bool TestEGLError(const char* pszLocation)
{
/*
@@ -320,79 +362,154 @@ bool TestEGLError(const char* pszLocation)
if (iErr != EGL_SUCCESS)
{
printf("%s failed (%d).\n", pszLocation, iErr);
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
void maemoGLinit(){
- iResX= 800;
- iResY =480;
+ printf ("GL init\n");
+ EGLint numConfigs;
+ EGLint majorVersion;
+ EGLint minorVersion;
+#if defined(USE_X11)
+ enum
+ {
+ _NET_WM_STATE_REMOVE =0,
+ _NET_WM_STATE_ADD = 1,
+ _NET_WM_STATE_TOGGLE =2
+ };
- printf ("maemo GL init\n");
- long int winxid=GDK_WINDOW_XID(GTK_WIDGET(windowG)->window);
- printf ("%d\n",winxid);
+ Window sRootWindow;
+ XSetWindowAttributes sWA;
+ unsigned int ui32Mask;
+ int i32Depth;
+#endif
- EGLContext context = 0;
- EGLConfig eglConfig = 0;
- EGLContext eglContext = 0;
- display = eglGetDisplay( EGL_DEFAULT_DISPLAY );
+ EGLint *attribList = NULL;
+ if (use_fsaa)
+ {
+ printf( "GLES: Using Full Scene Antialiasing\n" );
+ attribList = attrib_list_fsaa;
+ }
+ else
+ {
+ attribList = attrib_list;
+ }
+
+#if defined(USE_X11)
+ pandora_driver_mode = MODE_X11; // TODO make configurable
+#else
+ pandora_driver_mode = MODE_RAW; // TODO make configurable
+#endif
- if( eglInitialize( display, NULL, NULL ) == EGL_FALSE )
+ switch(pandora_driver_mode)
{
- printf( "EGL Initialize failed!\n" );
+#if defined(USE_X11)
+ case MODE_X11:
+ // Initializes the display and screen
+ x11Display = XOpenDisplay( ":0" );
+ if (!x11Display)
+ {
+ printf("GLES Error: Unable to open X display\n");
+ }
+ x11Screen = XDefaultScreen( x11Display );
+ // Gets the display parameters so we can pass the same parameters to the window to be created.
+ sRootWindow = RootWindow(x11Display, x11Screen);
+ i32Depth = DefaultDepth(x11Display, x11Screen);
+ px11Visual = &x11Visual;
+ XMatchVisualInfo( x11Display, x11Screen, i32Depth, TrueColor, px11Visual);
+ if (!px11Visual)
+ {
+ printf("GLES Error: Unable to acquire visual\n");
}
+ // Colormap of the specified visual type for the display.
+ x11Colormap = XCreateColormap( x11Display, sRootWindow, px11Visual->visual, AllocNone );
+ sWA.colormap = x11Colormap;
+
+ // List of events to be handled by the application. Add to these for handling other events.
+ sWA.event_mask = StructureNotifyMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask;
-const EGLint attributeList[] = {
- EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- /*EGL_BUFFER_SIZE, 32, */
- EGL_NONE
- };
+ // Display capabilities list.
+ ui32Mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;
- EGLint pi32ConfigAttribs[5];
- pi32ConfigAttribs[0] = EGL_SURFACE_TYPE;
- pi32ConfigAttribs[1] = EGL_WINDOW_BIT;
- pi32ConfigAttribs[2] = EGL_RENDERABLE_TYPE;
- pi32ConfigAttribs[3] = EGL_OPENGL_ES2_BIT;
- pi32ConfigAttribs[4] = EGL_NONE;
-
- EGLint pi32ContextAttribs[3];
- pi32ContextAttribs[0] = EGL_CONTEXT_CLIENT_VERSION;
- pi32ContextAttribs[1] = 2;
- pi32ContextAttribs[2] = EGL_NONE;
-
- int iConfigs;
- if (!eglChooseConfig(display, attributeList, &eglConfig, 1, &iConfigs) || (iConfigs != 1))
+ // Creates the X11 window
+ x11Window = XCreateWindow( x11Display, RootWindow(x11Display, x11Screen), 0, 0, iResX, iResY,
+ 0, CopyFromParent, InputOutput, CopyFromParent, ui32Mask, &sWA);
+
+ // Make the window viewable and flush the output buffer.
+ XMapWindow(x11Display, x11Window);
+ XFlush(x11Display);
+
+ // Make the window fullscreen
+ unsigned char fullScreen = 1;
+ Atom wmState = XInternAtom(x11Display, "_NET_WM_STATE", False);
+ Atom wmFullScreen = XInternAtom(x11Display,"_NET_WM_STATE_FULLSCREEN", False);
+
+ XEvent xev;
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
+ xev.xclient.window = x11Window;
+ xev.xclient.message_type = wmState;
+ xev.xclient.format = 32;
+ xev.xclient.data.l[0] = (fullScreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE);
+ xev.xclient.data.l[1] = wmFullScreen;
+ xev.xclient.data.l[2] = 0;
+
+ XSendEvent(x11Display, DefaultRootWindow(x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+
+ display = eglGetDisplay( (EGLNativeDisplayType)x11Display );
+ break;
+#endif
+ case MODE_RAW:
+ default:
+ display = eglGetDisplay( (EGLNativeDisplayType)0 );
+ break;
+ }
+
+ if( display == EGL_NO_DISPLAY )
{
- printf("Error: eglChooseConfig() failed.\n");
+ printf( "GLES EGL Error: GL No Display\n" );
}
- printf ("%d\n",iConfigs);
- surface = eglCreateWindowSurface(display, eglConfig, (void*)winxid, NULL);
- printf ("%d\n",surface);
- if (!TestEGLError("eglCreateWindowSurface"))
+
+ if( !eglInitialize( display, &majorVersion, &minorVersion ) )
{
- printf ("eglCreateWindowSurface fail");
+ printf( "GLES EGL Error: eglInitialize failed\n" );
}
- //context = eglCreateContext(display, eglConfig, NULL, pi32ContextAttribs);
- context =eglCreateContext( display, eglConfig,
- EGL_NO_CONTEXT, NULL
- );
-printf ("%d\n",context);
- if (!TestEGLError("eglCreateContext"))
+ if( !eglChooseConfig( display, attribList, &config, 1, &numConfigs ) )
{
- printf("error eglCreateContext");
+ printf( "GLES EGL Error: eglChooseConfig failed\n" );
}
- eglMakeCurrent(display, surface, surface, context);
+ context = eglCreateContext( display, config, NULL, NULL );
+ if( context==0 )
+ {
+ printf( "GLES EGL Error: eglCreateContext failed\n" );
+ }
- if (!TestEGLError("eglMakeCurrent"))
+ switch(pandora_driver_mode)
{
- printf("error eglMakeCurrent");
+#if defined(USE_X11)
+ case MODE_X11:
+ surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)x11Window, NULL );
+ break;
+#endif
+ case MODE_RAW:
+ default:
+ surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)0, NULL );
+ break;
}
+
+ eglMakeCurrent( display, surface, surface, context );
+ if (!TestEGLError("eglMakeCurrent"))
+ printf("error eglMakeCurrent");
+ else
+ printf("GLES Window Opened\n");
}
#endif
@@ -505,6 +622,20 @@ void GLcleanup()
if(!bWindowMode && dcGlobal)
ReleaseDC(hWWindow,dcGlobal);
#endif
+
+ eglMakeCurrent( display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
+ eglDestroySurface( display, surface );
+ eglDestroyContext( display, context );
+ eglTerminate( display );
+
+#if defined(USE_X11)
+ if (pandora_driver_mode == MODE_X11)
+ {
+ if (x11Window) XDestroyWindow(x11Display, x11Window);
+ if (x11Colormap) XFreeColormap( x11Display, x11Colormap );
+ if (x11Display) XCloseDisplay(x11Display);
+ }
+#endif
}
////////////////////////////////////////////////////////////////////////
diff --git a/plugins/gpu-gles/gpuDraw.h b/plugins/gpu-gles/gpuDraw.h
index f5f0426..c59927d 100644
--- a/plugins/gpu-gles/gpuDraw.h
+++ b/plugins/gpu-gles/gpuDraw.h
@@ -33,8 +33,7 @@
extern "C" {
#endif
-#include "minimal.h"
-#include <gdk/gdkx.h>
+
// internally used defines
diff --git a/plugins/gpu-gles/gpuExternals.h b/plugins/gpu-gles/gpuExternals.h
index f24c31a..977d74d 100644
--- a/plugins/gpu-gles/gpuExternals.h
+++ b/plugins/gpu-gles/gpuExternals.h
@@ -32,7 +32,16 @@
#ifdef __cplusplus
extern "C" {
#endif
-#define _GPU_API_
+
+typedef unsigned char u8;
+typedef signed char s8;
+typedef unsigned short int u16;
+typedef signed short int s16;
+typedef unsigned long u32;
+typedef signed long s32;
+typedef unsigned long long int u64;
+typedef signed long long int s64;
+
#ifndef _WINDOWS
#ifdef __NANOGL__
#include <gl/gl.h>
@@ -41,19 +50,13 @@ extern "C" {
#ifdef SOFT_LINKAGE
#pragma softfp_linkage
#endif
-#include <gles/gl.h> // for opengl es types
+#include <GLES/gl.h> // for opengl es types
#ifdef SOFT_LINKAGE
#pragma no_softfp_linkage
#endif
#endif
#endif
-#ifdef MAEMO_CHANGES
- #include "../psxCommon.h"
-#else
- #include "psxCommon.h"
-#endif
-
#ifdef __NANOGL__
#define glTexParameteri(x,y,z) glTexParameterf(x,y,z)
#define glAlphaFuncx(x,y) glAlphaFunc(x,y)
@@ -529,7 +532,7 @@ typedef struct {
int x;
int y;
} Vec2f;
-/**/
+*/
typedef struct {
Vec3f xyz;
diff --git a/plugins/gpu-gles/gpuPlugin.c b/plugins/gpu-gles/gpuPlugin.c
index 07f158c..d6e6fbb 100644
--- a/plugins/gpu-gles/gpuPlugin.c
+++ b/plugins/gpu-gles/gpuPlugin.c
@@ -396,7 +396,7 @@ void DoSnapShot(void)
#ifdef _WINDOWS
void CALLBACK GPUmakeSnapshot(void)
#else
-void CALLBACK GPU_makeSnapshot(void)
+void CALLBACK GPUmakeSnapshot(void)
#endif
{
//bSnapShot = TRUE;
@@ -409,7 +409,7 @@ void CALLBACK GPU_makeSnapshot(void)
#ifdef _WINDOWS
long CALLBACK GPUinit()
#else
-long CALLBACK GPU_init()
+long CALLBACK GPUinit()
#endif
{
memset(ulStatusControl,0,256*sizeof(unsigned long));
@@ -543,7 +543,7 @@ HMENU hPSEMenu=NULL;
long CALLBACK GPUopen(HWND hwndGPU)
#else
-long CALLBACK GPU_open(int hwndGPU)
+long CALLBACK GPUopen(int hwndGPU)
#endif
{
#ifdef _WINDOWS
@@ -555,12 +555,13 @@ long CALLBACK GPU_open(int hwndGPU)
-
-
#ifdef _WINDOWS
iResX=240;iResY=320;
#endif
- iColDepth=32;
+#ifdef MAEMO_CHANGES
+ iResX=640;iResY=480;
+#endif
+ iColDepth=8;
bChangeRes=FALSE;
#ifdef _WINDOWS
bWindowMode=TRUE;
@@ -705,7 +706,7 @@ long CALLBACK GPUclose() // WINDOWS CLOSE
#else
-long GPU_close() // LINUX CLOSE
+long GPUclose() // LINUX CLOSE
{
GLcleanup(); // close OGL
@@ -725,7 +726,7 @@ long GPU_close() // LINUX CLOSE
#ifdef _WINDOWS
long CALLBACK GPUshutdown()
#else
-long CALLBACK GPU_shutdown()
+long CALLBACK GPUshutdown()
#endif
{
if(psxVSecure) free(psxVSecure); // kill emulated vram memory
@@ -783,7 +784,7 @@ void SetScanLines(void)
int iLastRGB24=0; // special vars for checking when to skip two display updates
int iSkipTwo=0;
-void GPU_vSinc(void){
+void GPUvSinc(void){
updateDisplay();
}
void updateDisplay(void) // UPDATE DISPLAY
@@ -1314,7 +1315,7 @@ static unsigned short usFirstPos=2;
#ifdef _WINDOWS
void CALLBACK GPUupdateLace(void)
#else
-void CALLBACK GPU_updateLace(void)
+void CALLBACK GPUupdateLace(void)
#endif
{
if(!(dwActFixes&0x1000))
@@ -1356,7 +1357,7 @@ if(bChangeWinMode) ChangeWindowMode();
#ifdef _WINDOWS
unsigned long CALLBACK GPUreadStatus(void)
#else
-unsigned long CALLBACK GPU_readStatus(void)
+unsigned long CALLBACK GPUreadStatus(void)
#endif
{
if(dwActFixes&0x1000) // CC game fix
@@ -1396,7 +1397,7 @@ return STATUSREG;
#ifdef _WINDOWS
void CALLBACK GPUwriteStatus(unsigned long gdata)
#else
-void CALLBACK GPU_writeStatus(unsigned long gdata)
+void CALLBACK GPUwriteStatus(unsigned long gdata)
#endif
{
unsigned long lCommand=(gdata>>24)&0xff;
@@ -2012,7 +2013,7 @@ void CheckVRamRead(int x, int y, int dx, int dy, bool bFront)
#ifdef _WINDOWS
void CALLBACK GPUreadDataMem(unsigned int * pMem, int iSize)
#else
-void CALLBACK GPU_readDataMem(unsigned long * pMem, int iSize)
+void CALLBACK GPUreadDataMem(unsigned long * pMem, int iSize)
#endif
{
int i;
@@ -2088,14 +2089,14 @@ GPUIsIdle;
#ifdef _WINDOWS
unsigned long CALLBACK GPUreadData(void)
#else
-unsigned long CALLBACK GPU_readData(void)
+unsigned long CALLBACK GPUreadData(void)
#endif
{
unsigned long l;
#ifdef _WINDOWS
GPUreadDataMem(&l,1);
#else
- GPU_readDataMem(&l,1);
+ GPUreadDataMem(&l,1);
#endif
return GPUdataRet;
}
@@ -2181,7 +2182,7 @@ const u8 primTableCX[256] =
#ifdef _WINDOWS
void CALLBACK GPUwriteDataMem(unsigned long * pMem, int iSize)
#else
-void CALLBACK GPU_writeDataMem(unsigned long * pMem, int iSize)
+void CALLBACK GPUwriteDataMem(unsigned long * pMem, int iSize)
#endif
{
u8 command;
@@ -2304,13 +2305,13 @@ GPUIsIdle;
#ifdef _WINDOWS
void CALLBACK GPUwriteData(unsigned long gdata)
#else
-void CALLBACK GPU_writeData(unsigned long gdata)
+void CALLBACK GPUwriteData(unsigned long gdata)
#endif
{
#ifdef _WINDOWS
GPUwriteDataMem(&gdata,1);
#else
- GPU_writeDataMem(&gdata,1);
+ GPUwriteDataMem(&gdata,1);
#endif
}
@@ -2398,7 +2399,7 @@ void StartCfgTool(s8 * pCmdLine) // linux: start external cf
#ifdef _WINDOWS
long CALLBACK GPUconfigure(void)
#else
-long CALLBACK GPU_configure(void)
+long CALLBACK GPUconfigure(void)
#endif
{
@@ -2452,7 +2453,7 @@ return FALSE;
#ifdef _WINDOWS
long CALLBACK GPUdmaChain(unsigned long * baseAddrL, unsigned long addr)
#else
-long CALLBACK GPU_dmaChain(unsigned long * baseAddrL, unsigned long addr)
+long CALLBACK GPUdmaChain(unsigned long * baseAddrL, unsigned long addr)
#endif
{
unsigned long dmaMem;
@@ -2481,7 +2482,7 @@ do
#ifdef _WINDOWS
if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count);
#else
- if(count>0) GPU_writeDataMem(&baseAddrL[dmaMem>>2],count);
+ if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count);
#endif
addr = baseAddrL[addr>>2]&0xffffff;
@@ -2500,7 +2501,7 @@ return 0;
#ifdef _WINDOWS
void CALLBACK GPUabout(void)
#else
-void CALLBACK GPU_about(void)
+void CALLBACK GPUabout(void)
#endif
{
@@ -2513,7 +2514,7 @@ void CALLBACK GPU_about(void)
#ifdef _WINDOWS
long CALLBACK GPUtest(void)
#else
-long CALLBACK GPU_test(void)
+long CALLBACK GPUtest(void)
#endif
{
// if test fails this function should return negative value for error (unable to continue)
@@ -2531,7 +2532,7 @@ long CALLBACK GPU_test(void)
#ifdef _WINDOWS
long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF)
#else
-long CALLBACK GPU_freeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF)
+long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF)
#endif
{
if(ulGetFreezeData==2)
@@ -2574,15 +2575,15 @@ ResetTextureArea(TRUE);
GPUwriteStatus(ulStatusControl[5]);
GPUwriteStatus(ulStatusControl[4]);
#else
- GPU_writeStatus(ulStatusControl[0]);
- GPU_writeStatus(ulStatusControl[1]);
- GPU_writeStatus(ulStatusControl[2]);
- GPU_writeStatus(ulStatusControl[3]);
- GPU_writeStatus(ulStatusControl[8]);
- GPU_writeStatus(ulStatusControl[6]);
- GPU_writeStatus(ulStatusControl[7]);
- GPU_writeStatus(ulStatusControl[5]);
- GPU_writeStatus(ulStatusControl[4]);
+ GPUwriteStatus(ulStatusControl[0]);
+ GPUwriteStatus(ulStatusControl[1]);
+ GPUwriteStatus(ulStatusControl[2]);
+ GPUwriteStatus(ulStatusControl[3]);
+ GPUwriteStatus(ulStatusControl[8]);
+ GPUwriteStatus(ulStatusControl[6]);
+ GPUwriteStatus(ulStatusControl[7]);
+ GPUwriteStatus(ulStatusControl[5]);
+ GPUwriteStatus(ulStatusControl[4]);
#endif
return 1;
}
@@ -2834,7 +2835,7 @@ void PaintPicDot(u8 * p,u8 c)
#ifdef _WINDOWS
void CALLBACK GPUgetScreenPic(u8 * pMem)
#else
-long CALLBACK GPU_getScreenPic(u8 * pMem)
+long CALLBACK GPUgetScreenPic(u8 * pMem)
#endif
{
float XS,YS;int x,y,v;
@@ -2917,7 +2918,7 @@ long CALLBACK GPU_getScreenPic(u8 * pMem)
#ifdef _WINDOWS
void CALLBACK GPUshowScreenPic(u8 * pMem)
#else
-long CALLBACK GPU_showScreenPic(u8 * pMem)
+long CALLBACK GPUshowScreenPic(u8 * pMem)
#endif
{
// DestroyPic();
diff --git a/plugins/gpu-gles/gpuPlugin.h b/plugins/gpu-gles/gpuPlugin.h
index c452032..f5e9182 100644
--- a/plugins/gpu-gles/gpuPlugin.h
+++ b/plugins/gpu-gles/gpuPlugin.h
@@ -51,11 +51,11 @@ extern "C" {
#include "plugin.h"
#include <gl/gl.h>
#else
-#ifndef MAEMO_CHANGES
- #include "psxCommon.h"
-#else
- #include "../psxCommon.h"
-#endif
+//#ifndef MAEMO_CHANGES
+// #include "psxCommon.h"
+//#else
+// #include "../psxCommon.h"
+//#endif
#include "gpuExternals.h"
#ifdef __NANOGL__
#include <gl/gl.h>
@@ -87,32 +87,32 @@ typedef struct {
u8 psxVRam[1024*1024*2];
} GPUFreeze_t;
-long CALLBACK GPU_init();
-long CALLBACK GPU_shutdown();
-long CALLBACK GPU_open(int hwndGPU);
-long CALLBACK GPU_close();
-unsigned long CALLBACK GPU_readData(void);
-void CALLBACK GPU_readDataMem(unsigned long * pMem, int iSize);
-unsigned long CALLBACK GPU_readStatus(void);
-void CALLBACK GPU_writeData(unsigned long gdata);
-void CALLBACK GPU_writeDataMem(unsigned long * pMem, int iSize);
-void CALLBACK GPU_writeStatus(unsigned long gdata);
-long CALLBACK GPU_dmaChain(unsigned long * baseAddrL, unsigned long addr);
-void CALLBACK GPU_updateLace(void);
-void CALLBACK GPU_makeSnapshot(void);
-long CALLBACK GPU_freeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF);
-long CALLBACK GPU_getScreenPic(u8 * pMem);
-long CALLBACK GPU_showScreenPic(u8 * pMem);
-//void CALLBACK GPU_keypressed(int keycode);
-//void CALLBACK GPU_displayText(s8 * pText);
-//void CALLBACK GPU_clearDynarec(void (CALLBACK *callback)(void));
-long CALLBACK GPU_configure(void);
-long CALLBACK GPU_test(void);
-void CALLBACK GPU_about(void);
+long CALLBACK GPUinit();
+long CALLBACK GPUshutdown();
+long CALLBACK GPUopen(int hwndGPU);
+long CALLBACK GPUclose();
+unsigned long CALLBACK GPUreadData(void);
+void CALLBACK GPUreadDataMem(unsigned long * pMem, int iSize);
+unsigned long CALLBACK GPUreadStatus(void);
+void CALLBACK GPUwriteData(unsigned long gdata);
+void CALLBACK GPUwriteDataMem(unsigned long * pMem, int iSize);
+void CALLBACK GPUwriteStatus(unsigned long gdata);
+long CALLBACK GPUdmaChain(unsigned long * baseAddrL, unsigned long addr);
+void CALLBACK GPUupdateLace(void);
+void CALLBACK GPUmakeSnapshot(void);
+long CALLBACK GPUfreeze(unsigned long ulGetFreezeData,GPUFreeze_t * pF);
+long CALLBACK GPUgetScreenPic(u8 * pMem);
+long CALLBACK GPUshowScreenPic(u8 * pMem);
+//void CALLBACK GPUkeypressed(int keycode);
+//void CALLBACK GPUdisplayText(s8 * pText);
+//void CALLBACK GPUclearDynarec(void (CALLBACK *callback)(void));
+long CALLBACK GPUconfigure(void);
+long CALLBACK GPUtest(void);
+void CALLBACK GPUabout(void);
void DoSnapShot(void);
-void GPU_vSinc(void);
+void GPUvSinc(void);
void updateDisplay(void);
void updateFrontDisplay(void);
void SetAutoFrameCap(void);
diff --git a/plugins/gpu-gles/gpuPrim.c b/plugins/gpu-gles/gpuPrim.c
index 9b718a5..980d3dd 100644
--- a/plugins/gpu-gles/gpuPrim.c
+++ b/plugins/gpu-gles/gpuPrim.c
@@ -53,10 +53,10 @@
// globals
////////////////////////////////////////////////////////////////////////
-#ifndef _WINDOWS
-EGLSurface surface;
-EGLDisplay display;
-#endif
+//#ifndef _WINDOWS
+//EGLSurface surface;
+//EGLDisplay display;
+//#endif
BOOL bDrawTextured; // current active drawing states
BOOL bDrawSmoothShaded;
diff --git a/plugins/gpu-gles/gpuStdafx.h b/plugins/gpu-gles/gpuStdafx.h
index fc7ee3d..bc34898 100644
--- a/plugins/gpu-gles/gpuStdafx.h
+++ b/plugins/gpu-gles/gpuStdafx.h
@@ -31,7 +31,9 @@
extern "C" {
#endif
-
+#ifndef _GPU_API_
+#define _GPU_API_ 1
+#endif
@@ -65,10 +67,16 @@ extern "C" {
#pragma softfp_linkage
#endif
#ifdef MAEMO_CHANGES
- #include <GLES/glplatform.h>
+
+ //#include <GLES/glplatform.h>
#include <GLES/gl.h>
- #include <GLES/glext.h>
- #include <EGL/egl.h>
+ //#include <GLES/glext.h>
+ #include <GLES/EGL/egl.h>
+ //#include "../maemo/minimal.h"
+ //#include <gdk/gdkx.h>
+ //#include <gdk/gdk.h>
+
+
#else
#include <gles/gl.h> // for opengl es types
#include <gles/egltypes.h>
diff --git a/plugins/gpu-gles/gpuTexture.c b/plugins/gpu-gles/gpuTexture.c
index d047a62..98f8c9c 100644
--- a/plugins/gpu-gles/gpuTexture.c
+++ b/plugins/gpu-gles/gpuTexture.c
@@ -76,26 +76,7 @@
#include "prim.h"
#else
#include "gpuStdafx.h"
-#ifdef __NANOGL__
-#include <gl/gl.h>
-#include <gl/gl.h>
-#else
-#ifdef SOFT_LINKAGE
-#pragma softfp_linkage
-#endif
-#ifdef MAEMO_CHANGES
- #include <GLES/glplatform.h>
- #include <GLES/gl.h>
- #include <GLES/glext.h>
- #include <EGL/egl.h>
-#else
- #include <gles/gl.h> // for opengl es types
- #include <gles/egltypes.h>
-#endif
-#ifdef SOFT_LINKAGE
-#pragma no_softfp_linkage
-#endif
-#endif
+
#include "gpuDraw.h"
//#include "plugins.h"
#include "gpuExternals.h"