too bad it's unusable there.
export ARM926=1
export ARM_CORTEXA8=0
# caanoo also covers Wiz
export ARM926=1
export ARM_CORTEXA8=0
# caanoo also covers Wiz
PLAT_CLEAN = caanoo_clean
PLAT_CLEAN = caanoo_clean
g_menuscreen_w = w;
g_menuscreen_h = h;
g_menuscreen_ptr = vout_fbdev_flip(main_fb);
g_menuscreen_w = w;
g_menuscreen_h = h;
g_menuscreen_ptr = vout_fbdev_flip(main_fb);
+ pl_rearmed_cbs.screen_w = w;
+ pl_rearmed_cbs.screen_h = h;
psx_width = 320;
psx_height = 240;
psx_bpp = 16;
psx_width = 320;
psx_height = 240;
psx_bpp = 16;
+
+ pl_rearmed_cbs.screen_w = 320;
+ pl_rearmed_cbs.screen_h = 240;
unsigned int *gpu_frame_count;
unsigned int *gpu_hcnt;
unsigned int flip_cnt; // increment manually if not using pl_vout_flip
unsigned int *gpu_frame_count;
unsigned int *gpu_hcnt;
unsigned int flip_cnt; // increment manually if not using pl_vout_flip
+ unsigned int screen_w, screen_h; // gles plugin wants this
struct {
int allow_interlace; // 0 off, 1 on, 2 guess
} gpu_neon;
struct {
int allow_interlace; // 0 off, 1 on, 2 guess
} gpu_neon;
SRC_GPULIB += gpulib_if.c\r
\r
CFLAGS += -I$(PREFIX)include\r
SRC_GPULIB += gpulib_if.c\r
\r
CFLAGS += -I$(PREFIX)include\r
-LDLIBS += -L$(PREFIX)lib -lGLES_CM\r
+LDLIBS += -L$(PREFIX)lib\r
+ifeq "$(PLATFORM)" "caanoo"\r
+CFLAGS += -DFAKE_WINDOW\r
+LDLIBS += -lopengles_lite -lstdc++\r
+else\r
+LDLIBS += -lGLES_CM\r
+endif\r
\r
BIN_STANDLALONE = gpuGLES.so\r
BIN_GPULIB = gpu_gles.so\r
\r
BIN_STANDLALONE = gpuGLES.so\r
BIN_GPULIB = gpu_gles.so\r
EGLint iErr = eglGetError();\r
if (iErr != EGL_SUCCESS)\r
{\r
EGLint iErr = eglGetError();\r
if (iErr != EGL_SUCCESS)\r
{\r
- printf("%s failed (%d).\n", pszLocation, iErr);\r
+ printf("%s failed (0x%x).\n", pszLocation, iErr);\r
return FALSE;\r
}\r
\r
return TRUE;\r
}\r
\r
return FALSE;\r
}\r
\r
return TRUE;\r
}\r
\r
-static void initEGL(void)\r
+static int initEGL(void)\r
+ NativeWindowType window = 0;\r
+\r
printf ("GL init\n");\r
\r
EGLint numConfigs;\r
printf ("GL init\n");\r
\r
EGLint numConfigs;\r
if (!x11Display)\r
{\r
printf("GLES Error: Unable to open X display\n");\r
if (!x11Display)\r
{\r
printf("GLES Error: Unable to open X display\n");\r
}\r
x11Screen = XDefaultScreen( x11Display );\r
}\r
x11Screen = XDefaultScreen( x11Display );\r
// Gets the display parameters so we can pass the same parameters to the window to be created.\r
sRootWindow = RootWindow(x11Display, x11Screen);\r
i32Depth = DefaultDepth(x11Display, x11Screen);\r
// Gets the display parameters so we can pass the same parameters to the window to be created.\r
sRootWindow = RootWindow(x11Display, x11Screen);\r
i32Depth = DefaultDepth(x11Display, x11Screen);\r
if (!px11Visual)\r
{\r
printf("GLES Error: Unable to acquire visual\n");\r
if (!px11Visual)\r
{\r
printf("GLES Error: Unable to acquire visual\n");\r
// Colormap of the specified visual type for the display.\r
x11Colormap = XCreateColormap( x11Display, sRootWindow, px11Visual->visual, AllocNone );\r
sWA.colormap = x11Colormap;\r
// Colormap of the specified visual type for the display.\r
x11Colormap = XCreateColormap( x11Display, sRootWindow, px11Visual->visual, AllocNone );\r
sWA.colormap = x11Colormap;\r
\r
// Display capabilities list.\r
ui32Mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;\r
\r
// Display capabilities list.\r
ui32Mask = CWBackPixel | CWBorderPixel | CWEventMask | CWColormap;\r
// Creates the X11 window\r
x11Window = XCreateWindow( x11Display, RootWindow(x11Display, x11Screen), 0, 0, iResX, iResY,\r
0, CopyFromParent, InputOutput, CopyFromParent, ui32Mask, &sWA);\r
// Creates the X11 window\r
x11Window = XCreateWindow( x11Display, RootWindow(x11Display, x11Screen), 0, 0, iResX, iResY,\r
0, CopyFromParent, InputOutput, CopyFromParent, ui32Mask, &sWA);\r
XSendEvent(x11Display, DefaultRootWindow(x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);\r
\r
display = eglGetDisplay( (EGLNativeDisplayType)x11Display );\r
XSendEvent(x11Display, DefaultRootWindow(x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);\r
\r
display = eglGetDisplay( (EGLNativeDisplayType)x11Display );\r
#else\r
display = eglGetDisplay( (EGLNativeDisplayType)0 );\r
#endif\r
#else\r
display = eglGetDisplay( (EGLNativeDisplayType)0 );\r
#endif\r
if( display == EGL_NO_DISPLAY )\r
{\r
printf( "GLES EGL Error: GL No Display\n" );\r
if( display == EGL_NO_DISPLAY )\r
{\r
printf( "GLES EGL Error: GL No Display\n" );\r
}\r
\r
if( !eglInitialize( display, &majorVersion, &minorVersion ) )\r
{\r
printf( "GLES EGL Error: eglInitialize failed\n" );\r
}\r
\r
if( !eglInitialize( display, &majorVersion, &minorVersion ) )\r
{\r
printf( "GLES EGL Error: eglInitialize failed\n" );\r
}\r
\r
if( !eglChooseConfig( display, attribList, &config, 1, &numConfigs ) )\r
{\r
printf( "GLES EGL Error: eglChooseConfig failed\n" );\r
}\r
\r
if( !eglChooseConfig( display, attribList, &config, 1, &numConfigs ) )\r
{\r
printf( "GLES EGL Error: eglChooseConfig failed\n" );\r
}\r
\r
context = eglCreateContext( display, config, NULL, NULL );\r
if( context==0 )\r
{\r
printf( "GLES EGL Error: eglCreateContext failed\n" );\r
}\r
\r
context = eglCreateContext( display, config, NULL, NULL );\r
if( context==0 )\r
{\r
printf( "GLES EGL Error: eglCreateContext failed\n" );\r
-#if defined(USE_X11)\r
- surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)x11Window, NULL );\r
-#else\r
- surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)0, NULL );\r
+#ifdef FAKE_WINDOW\r
+ // broken Caanoo libs won't accept NULL window\r
+ window = (NativeWindowType)1;\r
+ surface = eglCreateWindowSurface( display, config, window, NULL );\r
+ if (!TestEGLError("eglCreateWindowSurface"))\r
+ return -1;\r
+\r
+ eglMakeCurrent( display, surface, surface, context );\r
+ if (!TestEGLError("eglMakeCurrent"))\r
+ return -1;\r
- eglMakeCurrent( display, surface, surface, context );\r
- if (!TestEGLError("eglMakeCurrent"))\r
- printf("error eglMakeCurrent");\r
- else\r
- printf("GLES Window Opened\n");\r
+ printf("GLES init ok\n");\r
+ return 0;\r
}\r
\r
int GLinitialize() \r
{\r
}\r
\r
int GLinitialize() \r
{\r
+ if(initEGL()!=0)\r
+ return -1;\r
\r
//----------------------------------------------------// \r
\r
\r
//----------------------------------------------------// \r
\r
+static struct rearmed_cbs *cbs;
+
long GPUopen(void **dpy)
{
int ret;
long GPUopen(void **dpy)
{
int ret;
- iResX = 800; iResY = 480;
+ iResX = cbs->screen_w;
+ iResY = cbs->screen_h;
rRatioRect.left = rRatioRect.top=0;
rRatioRect.right = iResX;
rRatioRect.bottom = iResY;
rRatioRect.left = rRatioRect.top=0;
rRatioRect.right = iResX;
rRatioRect.bottom = iResY;
-static struct rearmed_cbs *cbs;
-
/* acting as both renderer and vout handler here .. */
void renderer_set_config(const struct rearmed_cbs *cbs_)
{
/* acting as both renderer and vout handler here .. */
void renderer_set_config(const struct rearmed_cbs *cbs_)
{