Go to the documentation of this file.
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();
89 device->driverdata = phdata;
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;
213 window->driverdata = wdata;
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");
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" );
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id)
A collection of pixels used in software blitting.
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
void PND_setwindowicon(_THIS, SDL_Window *window, SDL_Surface *icon)
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
void PND_raisewindow(_THIS, SDL_Window *window)
struct SDL_VideoDevice::@262 gl_config
void PND_PumpEvents(_THIS)
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
void * SDL_GLContext
An opaque handle to an OpenGL context.
GLsizei const GLchar *const * path
SDL_DisplayMode desktop_mode
int PND_gl_getswapinterval(_THIS)
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
int PND_setdisplaymode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
The type used to identify a window.
The structure that defines a display mode.
int PND_gl_swapwindow(_THIS, SDL_Window *window)
int PND_gl_makecurrent(_THIS, SDL_Window *window, SDL_GLContext context)
void PND_hidewindow(_THIS, SDL_Window *window)
static screen_context_t context
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
static SDL_VideoDevice * _this
#define SDL_MINOR_VERSION
EGLSurface EGLNativeWindowType * window
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx)
void PND_restorewindow(_THIS, SDL_Window *window)
#define EGL_SAMPLE_BUFFERS
SDL_bool PND_getwindowwminfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void PND_gl_unloadlibrary(_THIS)
void PND_showwindow(_THIS, SDL_Window *window)
void PND_destroywindow(_THIS, SDL_Window *window)
void PND_gl_deletecontext(_THIS, SDL_GLContext context)
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
void PND_setwindowgrab(_THIS, SDL_Window *window, SDL_bool grabbed)
void PND_maximizewindow(_THIS, SDL_Window *window)
void PND_minimizewindow(_THIS, SDL_Window *window)
int PND_gl_setswapinterval(_THIS, int interval)
GLAPI void GLAPIENTRY glFinish(void)
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
int PND_gl_loadlibrary(_THIS, const char *path)
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display)
void PND_setwindowsize(_THIS, SDL_Window *window)
#define SDL_OutOfMemory()
void PND_setwindowposition(_THIS, SDL_Window *window)
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval)
#define SDL_arraysize(array)
void PND_videoquit(_THIS)
void * SDL_LoadFunction(void *handle, const char *name)
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy)
void PND_setwindowtitle(_THIS, SDL_Window *window)
void PND_getdisplaymodes(_THIS, SDL_VideoDisplay *display)
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void)
int PND_createwindow(_THIS, SDL_Window *window)
SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window *window)
int PND_createwindowfrom(_THIS, SDL_Window *window, const void *data)
SDL_DisplayMode current_mode
VideoBootStrap PND_bootstrap
#define SDL_MAJOR_VERSION
static SDL_AudioDeviceID device
void * PND_gl_getprocaddres(_THIS, const char *proc)
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)