21 #include "../../SDL_internal.h" 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" 68 status = PND_available();
98 device->
free = PND_destroy;
141 "SDL Wiz Video Driver",
144 "SDL Pandora Video Driver",
161 current_mode.
w = 320;
162 current_mode.
h = 240;
164 current_mode.
w = 800;
165 current_mode.
h = 480;
227 return SDL_SetError(
"PND: Can't get connection to OpenGL ES");
232 return SDL_SetError(
"PND: Can't init OpenGL ES library");
339 path =
"/lib/libopengles_lite.so";
341 path =
"/usr/lib/libGLES_CM.so";
349 return SDL_SetError(
"PND: Failed to locate OpenGL ES library");
363 void *function_address;
367 if (function_address !=
NULL) {
368 return function_address;
375 if (function_address !=
NULL) {
376 return function_address;
381 SDL_SetError(
"PND: Cannot locate OpenGL ES function name");
397 SDL_SetError(
"PND: GF initialization failed, no OpenGL ES support");
414 SDL_SetError(
"PND: EGL initialization failed, no OpenGL ES support");
462 wdata->gles_attributes[attr_pos++] =
469 wdata->gles_attributes[attr_pos++] =
474 wdata->gles_attributes[attr_pos] =
EGL_NONE;
478 wdata->gles_configs, 1, &configs);
480 SDL_SetError(
"PND: Can't find closest configuration for OpenGL ES");
490 for (it = 0; it < 4; it++) {
491 for (jt = 16; jt >= 0; jt--) {
511 wdata->gles_attributes[attr_pos++] = depthbits[it];
519 wdata->gles_attributes[attr_pos++] = jt;
529 wdata->gles_attributes[attr_pos] =
EGL_NONE;
534 wdata->gles_attributes,
535 wdata->gles_configs, 1, &configs);
539 (
"PND: Can't find closest configuration for OpenGL ES");
553 SDL_SetError(
"PND: Can't find any configuration for OpenGL ES");
559 wdata->gles_config = 0;
562 for (cit = 0; cit < configs; cit++) {
575 if (attr_value != 0) {
589 if (attr_value != 0) {
598 if ((depth_found != 0) && (stencil_found != 0)) {
604 if (cit == configs) {
607 wdata->gles_config = cit;
610 wdata->gles_context =
612 wdata->gles_configs[wdata->gles_config],
NULL,
NULL);
614 SDL_SetError(
"PND: OpenGL ES context creation has been failed");
623 printf(
"Error: Wiz framebuffer allocatation failed\n" );
625 printf(
"SDL: Wiz framebuffer allocated: %X\n", hNativeWnd );
628 printf(
"SDL: Wiz framebuffer already allocated: %X\n", hNativeWnd );
631 wdata->gles_surface =
633 wdata->gles_configs[wdata->gles_config],
636 wdata->gles_surface =
638 wdata->gles_configs[wdata->gles_config],
643 if (wdata->gles_surface == 0) {
651 wdata->gles_surface, wdata->gles_context);
657 SDL_SetError(
"PND: Can't set OpenGL ES context on creation");
670 wdata->gles_configs[wdata->gles_config],
677 wdata->gles_configs[wdata->gles_config],
686 wdata->gles_configs[wdata->gles_config],
693 wdata->gles_configs[wdata->gles_config],
703 return wdata->gles_context;
714 return SDL_SetError(
"PND: GF initialization failed, no OpenGL ES support");
717 if ((window ==
NULL) && (context ==
NULL)) {
723 return SDL_SetError(
"PND: Can't set OpenGL ES context");
729 (
"PND: OpenGL ES surface is not initialized for this window");
733 (
"PND: OpenGL ES context is not initialized for this window");
735 if (wdata->gles_context != context) {
737 (
"PND: OpenGL ES context is not belong to this window");
741 wdata->gles_surface, wdata->gles_context);
744 return SDL_SetError(
"PND: Can't set OpenGL ES context");
757 return SDL_SetError(
"PND: EGL initialization failed, no OpenGL ES support");
788 return SDL_SetError(
"PND: GLES initialization failed, no OpenGL ES support");
808 SDL_SetError(
"PND: GLES initialization failed, no OpenGL ES support");
825 if( hNativeWnd != 0 )
829 printf(
"SDL: Wiz framebuffer released\n" );
#define SDL_MINOR_VERSION
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
void(* RestoreWindow)(_THIS, SDL_Window *window)
int PND_gl_setswapinterval(_THIS, int interval)
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)
#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.
GLAPI void GLAPIENTRY glFinish(void)
int(* GL_SetSwapInterval)(_THIS, int interval)
void PND_gl_unloadlibrary(_THIS)
void(* ShowWindow)(_THIS, SDL_Window *window)
static screen_context_t context
The structure that defines a display mode.
void(* SetWindowSize)(_THIS, SDL_Window *window)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
int PND_createwindow(_THIS, SDL_Window *window)
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
int PND_gl_getswapinterval(_THIS)
void PND_getdisplaymodes(_THIS, SDL_VideoDisplay *display)
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display)
int(* GL_LoadLibrary)(_THIS, const char *path)
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
static SDL_VideoDevice * _this
void PND_maximizewindow(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
void(* HideWindow)(_THIS, SDL_Window *window)
static SDL_AudioDeviceID device
void PND_setwindowsize(_THIS, SDL_Window *window)
void PND_setwindowgrab(_THIS, SDL_Window *window, SDL_bool grabbed)
void(* RaiseWindow)(_THIS, SDL_Window *window)
void * SDL_GLContext
An opaque handle to an OpenGL context.
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
void PND_setwindowicon(_THIS, SDL_Window *window, SDL_Surface *icon)
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
void PND_videoquit(_THIS)
void PND_hidewindow(_THIS, SDL_Window *window)
SDL_DisplayMode current_mode
void(* DestroyWindow)(_THIS, SDL_Window *window)
int PND_gl_swapwindow(_THIS, SDL_Window *window)
void(* SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon)
int PND_gl_loadlibrary(_THIS, const char *path)
void(* GL_UnloadLibrary)(_THIS)
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
int(* CreateSDLWindow)(_THIS, SDL_Window *window)
#define SDL_OutOfMemory()
SDL_DisplayMode desktop_mode
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
int PND_setdisplaymode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
void PND_PumpEvents(_THIS)
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
EGLSurface EGLNativeWindowType * window
void(* SetWindowPosition)(_THIS, SDL_Window *window)
int(* GL_SwapWindow)(_THIS, SDL_Window *window)
int PND_gl_makecurrent(_THIS, SDL_Window *window, SDL_GLContext context)
The type used to identify a window.
void PND_setwindowtitle(_THIS, SDL_Window *window)
void(* MinimizeWindow)(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void)
VideoBootStrap PND_bootstrap
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
int(* CreateSDLWindowFrom)(_THIS, SDL_Window *window, const void *data)
#define SDL_arraysize(array)
SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window *window)
GLsizei const GLchar *const * path
struct SDL_VideoDevice::@34 gl_config
void * SDL_LoadFunction(void *handle, const char *name)
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
SDL_bool PND_getwindowwminfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void(* SetWindowTitle)(_THIS, SDL_Window *window)
int(* GL_GetSwapInterval)(_THIS)
void(* MaximizeWindow)(_THIS, SDL_Window *window)
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)
void(* SetWindowGrab)(_THIS, SDL_Window *window, SDL_bool grabbed)
void *(* GL_GetProcAddress)(_THIS, const char *proc)
void PND_minimizewindow(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
void(* PumpEvents)(_THIS)
void PND_setwindowposition(_THIS, SDL_Window *window)