23 #if SDL_VIDEO_DRIVER_PANDORA
26 #include "../SDL_sysvideo.h"
31 #include "../../events/SDL_mouse_c.h"
32 #include "../../events/SDL_keyboard_c.h"
70 status = PND_available();
98 device->current_display = 0;
101 device->
free = PND_destroy;
142 "SDL Wiz Video Driver",
145 "SDL Pandora Video Driver",
162 current_mode.
w = 320;
163 current_mode.
h = 240;
165 current_mode.
w = 800;
166 current_mode.
h = 480;
232 return SDL_SetError(
"PND: Can't get connection to OpenGL ES");
237 return SDL_SetError(
"PND: Can't init OpenGL ES library");
314 SDL_SetError(
"application not compiled with SDL %d.%d\n",
344 path =
"/lib/libopengles_lite.so";
346 path =
"/usr/lib/libGLES_CM.so";
354 return SDL_SetError(
"PND: Failed to locate OpenGL ES library");
369 void *function_address;
373 if (function_address !=
NULL) {
374 return function_address;
381 if (function_address !=
NULL) {
382 return function_address;
387 SDL_SetError(
"PND: Cannot locate OpenGL ES function name");
403 SDL_SetError(
"PND: GF initialization failed, no OpenGL ES support");
423 SDL_SetError(
"PND: EGL initialization failed, no OpenGL ES support");
471 wdata->gles_attributes[attr_pos++] =
478 wdata->gles_attributes[attr_pos++] =
483 wdata->gles_attributes[attr_pos] =
EGL_NONE;
487 wdata->gles_configs, 1, &configs);
489 SDL_SetError(
"PND: Can't find closest configuration for OpenGL ES");
499 for (it = 0; it < 4; it++) {
500 for (jt = 16; jt >= 0; jt--) {
520 wdata->gles_attributes[attr_pos++] = depthbits[it];
528 wdata->gles_attributes[attr_pos++] = jt;
538 wdata->gles_attributes[attr_pos] =
EGL_NONE;
543 wdata->gles_attributes,
544 wdata->gles_configs, 1, &configs);
548 (
"PND: Can't find closest configuration for OpenGL ES");
562 SDL_SetError(
"PND: Can't find any configuration for OpenGL ES");
568 wdata->gles_config = 0;
571 for (cit = 0; cit < configs; cit++) {
584 if (attr_value != 0) {
598 if (attr_value != 0) {
607 if ((depth_found != 0) && (stencil_found != 0)) {
613 if (cit == configs) {
616 wdata->gles_config = cit;
619 wdata->gles_context =
621 wdata->gles_configs[wdata->gles_config],
NULL,
NULL);
623 SDL_SetError(
"PND: OpenGL ES context creation has been failed");
632 printf(
"Error : Wiz framebuffer allocatation failed\n" );
634 printf(
"SDL13: Wiz framebuffer allocated: %X\n", hNativeWnd );
637 printf(
"SDL13: Wiz framebuffer already allocated: %X\n", hNativeWnd );
640 wdata->gles_surface =
642 wdata->gles_configs[wdata->gles_config],
645 wdata->gles_surface =
647 wdata->gles_configs[wdata->gles_config],
652 if (wdata->gles_surface == 0) {
653 SDL_SetError(
"Error : eglCreateWindowSurface failed;\n");
660 wdata->gles_surface, wdata->gles_context);
666 SDL_SetError(
"PND: Can't set OpenGL ES context on creation");
679 wdata->gles_configs[wdata->gles_config],
686 wdata->gles_configs[wdata->gles_config],
695 wdata->gles_configs[wdata->gles_config],
702 wdata->gles_configs[wdata->gles_config],
712 return wdata->gles_context;
723 return SDL_SetError(
"PND: GF initialization failed, no OpenGL ES support");
726 if ((window ==
NULL) && (context ==
NULL)) {
732 return SDL_SetError(
"PND: Can't set OpenGL ES context");
738 (
"PND: OpenGL ES surface is not initialized for this window");
742 (
"PND: OpenGL ES context is not initialized for this window");
744 if (wdata->gles_context != context) {
746 (
"PND: OpenGL ES context is not belong to this window");
750 wdata->gles_surface, wdata->gles_context);
753 return SDL_SetError(
"PND: Can't set OpenGL ES context");
766 return SDL_SetError(
"PND: EGL initialization failed, no OpenGL ES support");
800 SDL_SetError(
"PND: GLES initialization failed, no OpenGL ES support");
820 SDL_SetError(
"PND: GLES initialization failed, no OpenGL ES support");
837 if( hNativeWnd != 0 )
841 printf(
"SDL13: Wiz framebuffer released\n" );
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
void PND_gl_swapwindow(_THIS, SDL_Window *window)
void(* MinimizeWindow)(_THIS, SDL_Window *window)
#define SDL_MINOR_VERSION
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
void(* RaiseWindow)(_THIS, SDL_Window *window)
int PND_gl_setswapinterval(_THIS, int interval)
DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size)
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
void PND_raisewindow(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
void(* HideWindow)(_THIS, SDL_Window *window)
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
#define SDL_MAJOR_VERSION
void PND_restorewindow(_THIS, SDL_Window *window)
void PND_gl_deletecontext(_THIS, SDL_GLContext context)
void PND_destroywindow(_THIS, SDL_Window *window)
int PND_createwindowfrom(_THIS, SDL_Window *window, const void *data)
#define EGL_SAMPLE_BUFFERS
A collection of pixels used in software blitting.
void PND_gl_unloadlibrary(_THIS)
DECLSPEC void SDLCALL SDL_free(void *mem)
void(* SetWindowGrab)(_THIS, SDL_Window *window, SDL_bool grabbed)
The structure that defines a display mode.
void(* SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon)
void * SDL_GLContext
An opaque handle to an OpenGL context.
int PND_createwindow(_THIS, SDL_Window *window)
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
int(* CreateWindowFrom)(_THIS, SDL_Window *window, const void *data)
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
int PND_gl_getswapinterval(_THIS)
GLsizei const GLchar *const * path
void PND_getdisplaymodes(_THIS, SDL_VideoDisplay *display)
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display)
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
int(* GL_SetSwapInterval)(_THIS, int interval)
static SDL_VideoDevice * _this
void PND_maximizewindow(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
void PND_setwindowsize(_THIS, SDL_Window *window)
int(* CreateWindow)(_THIS, SDL_Window *window)
void(* GL_UnloadLibrary)(_THIS)
void PND_setwindowicon(_THIS, SDL_Window *window, SDL_Surface *icon)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void PND_videoquit(_THIS)
DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile)
DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen)
void PND_hidewindow(_THIS, SDL_Window *window)
SDL_DisplayMode current_mode
DECLSPEC void SDLCALL SDL_UnloadObject(void *handle)
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
void(* SetWindowPosition)(_THIS, SDL_Window *window)
void(* PumpEvents)(_THIS)
int PND_gl_loadlibrary(_THIS, const char *path)
int(* GL_GetSwapInterval)(_THIS)
#define SDL_OutOfMemory()
SDL_DisplayMode desktop_mode
#define SDL_arraysize(array)
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
void(* MaximizeWindow)(_THIS, SDL_Window *window)
void(* DestroyWindow)(_THIS, SDL_Window *window)
int PND_setdisplaymode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
void PND_PumpEvents(_THIS)
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
void(* SetWindowSize)(_THIS, SDL_Window *window)
void PND_setwindowgrab(_THIS, SDL_Window *window)
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
int PND_gl_makecurrent(_THIS, SDL_Window *window, SDL_GLContext context)
void PND_setwindowtitle(_THIS, SDL_Window *window)
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void)
int(* GL_LoadLibrary)(_THIS, const char *path)
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
void(* GL_SwapWindow)(_THIS, SDL_Window *window)
void(* ShowWindow)(_THIS, SDL_Window *window)
SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window *window)
DECLSPEC char *SDLCALL SDL_getenv(const char *name)
void(* SetWindowTitle)(_THIS, SDL_Window *window)
SDL_bool PND_getwindowwminfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, const char *name)
void PND_showwindow(_THIS, SDL_Window *window)
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
void * PND_gl_getprocaddres(_THIS, const char *proc)
struct SDL_VideoDevice::@87 gl_config
void *(* GL_GetProcAddress)(_THIS, const char *proc)
void PND_minimizewindow(_THIS, SDL_Window *window)
void(* RestoreWindow)(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
void PND_setwindowposition(_THIS, SDL_Window *window)