Mercurial > sdl-ios-xcode
annotate src/video/pandora/SDL_pandora.c @ 3168:6338b7f2d024
Hi,
I have prepared a set of patches to readd WindowsCE support to SDL 1.3.
I've created a new GAPI/Rawframebuffer and a DirectDraw renderer.
Both renderers are work in progress and there are several unimplemented
cases. (Notably
RenderLine/RenderPoint/RenderFill/QueryTexturePixels/UpdateTexture and
texture blending )
Nevertheless I am successfully using these renderers together with the
SDL software renderer. (On most devices the SDL software renderer will
be much faster as there are only badly optimized vendor drivers available)
I send these patches now in this unpolished state because there seems to
be some interest in win ce and someone has to start supporting SDL 1.3
Now on to the patches:
wince_events_window_fixes.patch
fixes some wince incompatibilities and adds fullscreen support via
SHFullScreen. NOTE: This patch shouldn't have any side effects on
Windows, but I have NOT tested it on Windows, so please double-check.
This patch doesn't dependent on the following ones.
wince_renderers_system.patch
This patch does all necessary modifications to the SDL system.
- it adds the renderers to the configure system
- it adds the renderers to win32video
SDL_ceddrawrender.c
SDL_ceddrawrender.h
SDL_gapirender_c.h
SDL_gapirender.c
SDL_gapirender.h
these files add the new render drivers and should be placed in
src/video/win32
Some notes to people who want to test this:
- I have only compiled sdl with ming32ce, so the VisualC files are not
up to date
- As mingw32ce has no ddraw.h this file must be taken from the MS SDK
and modified to work with gcc
- I had to modify line 2611 in configure.in to
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer
-Wl,--image-base -Wl,0x10000"
otherwise GetCPinfo wouldn't link. If someone knows whats causing this
I'd be happy to hear about it.
It would be great if these patches could make their way into SVN as this
would make collaboration much much easier.
I'm out of office for the next week and therefore will be unavailable
via email.
Regards
Stefan
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 07 Jun 2009 02:44:46 +0000 |
parents | 494559cc723b |
children | d35b649858e0 |
rev | line source |
---|---|
3161
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
3 Copyright (C) 1997-2009 Sam Lantinga |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
20 slouken@libsdl.org |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
21 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
22 Open Pandora SDL driver |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 Copyright (C) 2009 David Carré |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 (cpasjuste@gmail.com) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 /* SDL internals */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 #include "SDL_config.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 #include "../SDL_sysvideo.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
30 #include "SDL_version.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
31 #include "SDL_syswm.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
32 #include "SDL_loadso.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 #include "SDL_events.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 #include "../../events/SDL_mouse_c.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
35 #include "../../events/SDL_keyboard_c.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
36 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
37 /* PND declarations */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
38 #include "SDL_pandora.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
39 #include "SDL_pandora_events.h" |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
41 static SDL_bool PND_initialized = SDL_FALSE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
42 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
43 static int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
44 PND_available(void) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
45 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
46 return 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
47 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
48 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
49 static void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
50 PND_destroy(SDL_VideoDevice * device) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
51 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
52 SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
53 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
54 if (device->driverdata != NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
55 device->driverdata = NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
56 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
57 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
58 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
59 static SDL_VideoDevice * |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
60 PND_create() |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
61 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
62 SDL_VideoDevice *device; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
63 SDL_VideoData *phdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
64 int status; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
65 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
66 /* Check if pandora could be initialized */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
67 status = PND_available(); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 if (status == 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 /* PND could not be used */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
70 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
71 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
73 /* Initialize SDL_VideoDevice structure */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
74 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
75 if (device == NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
76 SDL_OutOfMemory(); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
77 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
78 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
79 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
80 /* Initialize internal Pandora specific data */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
81 phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 if (phdata == NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
83 SDL_OutOfMemory(); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
84 SDL_free(device); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
85 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
86 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
87 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
88 device->driverdata = phdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
89 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 phdata->egl_initialized = SDL_TRUE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
91 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
93 /* Setup amount of available displays and current display */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
94 device->num_displays = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
95 device->current_display = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
96 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
97 /* Set device free function */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
98 device->free = PND_destroy; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
99 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
100 /* Setup all functions which we can handle */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
101 device->VideoInit = PND_videoinit; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
102 device->VideoQuit = PND_videoquit; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
103 device->GetDisplayModes = PND_getdisplaymodes; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
104 device->SetDisplayMode = PND_setdisplaymode; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
105 device->SetDisplayPalette = PND_setdisplaypalette; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
106 device->GetDisplayPalette = PND_getdisplaypalette; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
107 device->SetDisplayGammaRamp = PND_setdisplaygammaramp; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
108 device->GetDisplayGammaRamp = PND_getdisplaygammaramp; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
109 device->CreateWindow = PND_createwindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
110 device->CreateWindowFrom = PND_createwindowfrom; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
111 device->SetWindowTitle = PND_setwindowtitle; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
112 device->SetWindowIcon = PND_setwindowicon; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
113 device->SetWindowPosition = PND_setwindowposition; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
114 device->SetWindowSize = PND_setwindowsize; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
115 device->ShowWindow = PND_showwindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
116 device->HideWindow = PND_hidewindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
117 device->RaiseWindow = PND_raisewindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
118 device->MaximizeWindow = PND_maximizewindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
119 device->MinimizeWindow = PND_minimizewindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
120 device->RestoreWindow = PND_restorewindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
121 device->SetWindowGrab = PND_setwindowgrab; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
122 device->DestroyWindow = PND_destroywindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
123 device->GetWindowWMInfo = PND_getwindowwminfo; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
124 device->GL_LoadLibrary = PND_gl_loadlibrary; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
125 device->GL_GetProcAddress = PND_gl_getprocaddres; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
126 device->GL_UnloadLibrary = PND_gl_unloadlibrary; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
127 device->GL_CreateContext = PND_gl_createcontext; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
128 device->GL_MakeCurrent = PND_gl_makecurrent; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
129 device->GL_SetSwapInterval = PND_gl_setswapinterval; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
130 device->GL_GetSwapInterval = PND_gl_getswapinterval; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
131 device->GL_SwapWindow = PND_gl_swapwindow; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
132 device->GL_DeleteContext = PND_gl_deletecontext; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
133 device->PumpEvents = PND_PumpEvents; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
134 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
135 return device; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
136 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
137 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
138 VideoBootStrap PND_bootstrap = { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
139 "pandora", |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
140 "SDL Pandora Video Driver", |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
141 PND_available, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
142 PND_create |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
143 }; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
144 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
145 /*****************************************************************************/ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
146 /* SDL Video and Display initialization/handling functions */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
147 /*****************************************************************************/ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
148 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
149 PND_videoinit(_THIS) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
150 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
151 SDL_VideoDisplay display; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
152 SDL_DisplayMode current_mode; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
153 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
154 SDL_zero(current_mode); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
155 current_mode.w = 800; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
156 current_mode.h = 480; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
157 current_mode.refresh_rate = 60; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
158 current_mode.format = SDL_PIXELFORMAT_RGB565; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
159 current_mode.driverdata = NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
160 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
161 SDL_zero(display); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
162 display.desktop_mode = current_mode; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
163 display.current_mode = current_mode; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
164 display.driverdata = NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
165 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
166 SDL_AddVideoDisplay(&display); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
167 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
168 return 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
169 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
170 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
171 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
172 PND_videoquit(_THIS) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
173 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
174 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
175 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
176 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
177 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
178 PND_getdisplaymodes(_THIS) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
179 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
180 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
181 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
182 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
183 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
184 PND_setdisplaymode(_THIS, SDL_DisplayMode * mode) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
185 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
186 return 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
187 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
188 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
189 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
190 PND_setdisplaypalette(_THIS, SDL_Palette * palette) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
191 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
192 SDL_DisplayData *didata = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
193 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
194 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
195 /* Setting display palette operation has been failed */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
196 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
197 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
198 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
199 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
200 PND_getdisplaypalette(_THIS, SDL_Palette * palette) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
201 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
202 SDL_DisplayData *didata = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
203 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
204 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
205 /* Getting display palette operation has been failed */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
206 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
207 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
208 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
209 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
210 PND_setdisplaygammaramp(_THIS, Uint16 * ramp) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
211 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
212 SDL_DisplayData *didata = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
213 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
214 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
215 /* Setting display gamma ramp operation has been failed */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
216 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
217 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
218 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
219 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
220 PND_getdisplaygammaramp(_THIS, Uint16 * ramp) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
221 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
222 /* Getting display gamma ramp operation has been failed */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
223 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
224 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
225 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
226 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
227 PND_createwindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
228 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
229 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
230 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
231 SDL_WindowData *wdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
232 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
233 uint32_t winargc = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
234 int32_t status; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
235 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
236 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
237 /* Allocate window internal data */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
238 wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
239 if (wdata == NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
240 SDL_OutOfMemory(); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
241 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
242 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
243 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
244 /* Setup driver data for this window */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
245 window->driverdata = wdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
246 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
247 /* Check if window must support OpenGL ES rendering */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
248 if ((window->flags & SDL_WINDOW_OPENGL) == SDL_WINDOW_OPENGL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
249 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
250 EGLBoolean initstatus; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
251 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
252 /* Mark this window as OpenGL ES compatible */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
253 wdata->uses_gles = SDL_TRUE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
254 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
255 /* Create connection to OpenGL ES */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
256 if (phdata->egl_display == EGL_NO_DISPLAY) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
257 phdata->egl_display = eglGetDisplay((NativeDisplayType) 0); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
258 if (phdata->egl_display == EGL_NO_DISPLAY) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
259 SDL_SetError("PND: Can't get connection to OpenGL ES"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
260 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
261 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
262 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
263 initstatus = eglInitialize(phdata->egl_display, NULL, NULL); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
264 if (initstatus != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
265 SDL_SetError("PND: Can't init OpenGL ES library"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
266 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
267 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
268 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
269 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
270 phdata->egl_refcount++; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
271 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
272 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
273 /* Window has been successfully created */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
274 return 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
275 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
276 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
277 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
278 PND_createwindowfrom(_THIS, SDL_Window * window, const void *data) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
279 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
280 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
281 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
282 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
283 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
284 PND_setwindowtitle(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
285 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
286 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
287 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
288 PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
289 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
290 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
291 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
292 PND_setwindowposition(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
293 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
294 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
295 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
296 PND_setwindowsize(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
297 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
298 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
299 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
300 PND_showwindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
301 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
302 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
303 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
304 PND_hidewindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
305 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
306 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
307 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
308 PND_raisewindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
309 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
310 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
311 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
312 PND_maximizewindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
313 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
314 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
315 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
316 PND_minimizewindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
317 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
318 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
319 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
320 PND_restorewindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
321 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
322 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
323 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
324 PND_setwindowgrab(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
325 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
326 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
327 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
328 PND_destroywindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
329 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
330 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
331 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
332 /*****************************************************************************/ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
333 /* SDL Window Manager function */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
334 /*****************************************************************************/ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
335 SDL_bool |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
336 PND_getwindowwminfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
337 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
338 if (info->version.major <= SDL_MAJOR_VERSION) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
339 return SDL_TRUE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
340 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
341 SDL_SetError("application not compiled with SDL %d.%d\n", |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
342 SDL_MAJOR_VERSION, SDL_MINOR_VERSION); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
343 return SDL_FALSE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
344 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
345 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
346 /* Failed to get window manager information */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
347 return SDL_FALSE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
348 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
349 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
350 /*****************************************************************************/ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
351 /* SDL OpenGL/OpenGL ES functions */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
352 /*****************************************************************************/ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
353 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
354 PND_gl_loadlibrary(_THIS, const char *path) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
355 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
356 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
357 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
358 /* Check if OpenGL ES library is specified for GF driver */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
359 if (path == NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
360 path = SDL_getenv("SDL_OPENGL_LIBRARY"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
361 if (path == NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
362 path = SDL_getenv("SDL_OPENGLES_LIBRARY"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
363 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
364 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
365 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
366 /* Check if default library loading requested */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
367 if (path == NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
368 /* Already linked with GF library which provides egl* subset of */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
369 /* functions, use Common profile of OpenGL ES library by default */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
370 path = "/usr/lib/libGLES_CM.so"; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
371 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
372 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
373 /* Load dynamic library */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
374 _this->gl_config.dll_handle = SDL_LoadObject(path); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
375 if (!_this->gl_config.dll_handle) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
376 /* Failed to load new GL ES library */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
377 SDL_SetError("PND: Failed to locate OpenGL ES library"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
378 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
379 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
380 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
381 /* Store OpenGL ES library path and name */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
382 SDL_strlcpy(_this->gl_config.driver_path, path, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
383 SDL_arraysize(_this->gl_config.driver_path)); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
384 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
385 /* New OpenGL ES library is loaded */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
386 return 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
387 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
388 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
389 void * |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
390 PND_gl_getprocaddres(_THIS, const char *proc) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
391 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
392 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
393 void *function_address; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
394 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
395 /* Try to get function address through the egl interface */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
396 function_address = eglGetProcAddress(proc); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
397 if (function_address != NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
398 return function_address; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
399 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
400 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
401 /* Then try to get function in the OpenGL ES library */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
402 if (_this->gl_config.dll_handle) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
403 function_address = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
404 SDL_LoadFunction(_this->gl_config.dll_handle, proc); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
405 if (function_address != NULL) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
406 return function_address; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
407 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
408 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
409 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
410 /* Failed to get GL ES function address pointer */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
411 SDL_SetError("PND: Cannot locate OpenGL ES function name"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
412 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
413 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
414 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
415 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
416 PND_gl_unloadlibrary(_THIS) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
417 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
418 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
419 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
420 if (phdata->egl_initialized == SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
421 /* Unload OpenGL ES library */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
422 if (_this->gl_config.dll_handle) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
423 SDL_UnloadObject(_this->gl_config.dll_handle); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
424 _this->gl_config.dll_handle = NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
425 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
426 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
427 SDL_SetError("PND: GF initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
428 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
429 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
430 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
431 SDL_GLContext |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
432 PND_gl_createcontext(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
433 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
434 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
435 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
436 SDL_DisplayData *didata = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
437 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
438 EGLBoolean status; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
439 int32_t gfstatus; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
440 EGLint configs; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
441 uint32_t attr_pos; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
442 EGLint attr_value; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
443 EGLint cit; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
444 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
445 /* Check if EGL was initialized */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
446 if (phdata->egl_initialized != SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
447 SDL_SetError("PND: EGL initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
448 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
449 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
450 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
451 /* Prepare attributes list to pass them to OpenGL ES */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
452 attr_pos = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
453 wdata->gles_attributes[attr_pos++] = EGL_SURFACE_TYPE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
454 wdata->gles_attributes[attr_pos++] = EGL_WINDOW_BIT; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
455 wdata->gles_attributes[attr_pos++] = EGL_RED_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
456 wdata->gles_attributes[attr_pos++] = _this->gl_config.red_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
457 wdata->gles_attributes[attr_pos++] = EGL_GREEN_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
458 wdata->gles_attributes[attr_pos++] = _this->gl_config.green_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
459 wdata->gles_attributes[attr_pos++] = EGL_BLUE_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
460 wdata->gles_attributes[attr_pos++] = _this->gl_config.blue_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
461 wdata->gles_attributes[attr_pos++] = EGL_ALPHA_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
462 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
463 /* Setup alpha size in bits */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
464 if (_this->gl_config.alpha_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
465 wdata->gles_attributes[attr_pos++] = _this->gl_config.alpha_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
466 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
467 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
468 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
469 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
470 /* Setup color buffer size */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
471 if (_this->gl_config.buffer_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
472 wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
473 wdata->gles_attributes[attr_pos++] = _this->gl_config.buffer_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
474 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
475 wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
476 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
477 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
478 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
479 /* Setup depth buffer bits */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
480 wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
481 wdata->gles_attributes[attr_pos++] = _this->gl_config.depth_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
482 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
483 /* Setup stencil bits */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
484 if (_this->gl_config.stencil_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
485 wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
486 wdata->gles_attributes[attr_pos++] = _this->gl_config.buffer_size; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
487 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
488 wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
489 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
490 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
491 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
492 /* Set number of samples in multisampling */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
493 if (_this->gl_config.multisamplesamples) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
494 wdata->gles_attributes[attr_pos++] = EGL_SAMPLES; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
495 wdata->gles_attributes[attr_pos++] = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
496 _this->gl_config.multisamplesamples; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
497 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
498 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
499 /* Multisample buffers, OpenGL ES 1.0 spec defines 0 or 1 buffer */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
500 if (_this->gl_config.multisamplebuffers) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
501 wdata->gles_attributes[attr_pos++] = EGL_SAMPLE_BUFFERS; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
502 wdata->gles_attributes[attr_pos++] = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
503 _this->gl_config.multisamplebuffers; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
504 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
505 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
506 /* Finish attributes list */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
507 wdata->gles_attributes[attr_pos] = EGL_NONE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
508 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
509 /* Request first suitable framebuffer configuration */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
510 status = eglChooseConfig(phdata->egl_display, wdata->gles_attributes, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
511 wdata->gles_configs, 1, &configs); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
512 if (status != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
513 SDL_SetError("PND: Can't find closest configuration for OpenGL ES"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
514 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
515 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
516 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
517 /* Check if nothing has been found, try "don't care" settings */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
518 if (configs == 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
519 int32_t it; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
520 int32_t jt; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
521 GLint depthbits[4] = { 32, 24, 16, EGL_DONT_CARE }; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
522 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
523 for (it = 0; it < 4; it++) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
524 for (jt = 16; jt >= 0; jt--) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
525 /* Don't care about color buffer bits, use what exist */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
526 /* Replace previous set data with EGL_DONT_CARE */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
527 attr_pos = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
528 wdata->gles_attributes[attr_pos++] = EGL_SURFACE_TYPE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
529 wdata->gles_attributes[attr_pos++] = EGL_WINDOW_BIT; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
530 wdata->gles_attributes[attr_pos++] = EGL_RED_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
531 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
532 wdata->gles_attributes[attr_pos++] = EGL_GREEN_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
533 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
534 wdata->gles_attributes[attr_pos++] = EGL_BLUE_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
535 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
536 wdata->gles_attributes[attr_pos++] = EGL_ALPHA_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
537 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
538 wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
539 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
540 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
541 /* Try to find requested or smallest depth */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
542 if (_this->gl_config.depth_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
543 wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
544 wdata->gles_attributes[attr_pos++] = depthbits[it]; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
545 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
546 wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
547 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
548 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
549 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
550 if (_this->gl_config.stencil_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
551 wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
552 wdata->gles_attributes[attr_pos++] = jt; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
553 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
554 wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
555 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
556 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
557 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
558 wdata->gles_attributes[attr_pos++] = EGL_SAMPLES; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
559 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
560 wdata->gles_attributes[attr_pos++] = EGL_SAMPLE_BUFFERS; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
561 wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
562 wdata->gles_attributes[attr_pos] = EGL_NONE; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
563 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
564 /* Request first suitable framebuffer configuration */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
565 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
566 eglChooseConfig(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
567 wdata->gles_attributes, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
568 wdata->gles_configs, 1, &configs); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
569 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
570 if (status != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
571 SDL_SetError |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
572 ("PND: Can't find closest configuration for OpenGL ES"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
573 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
574 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
575 if (configs != 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
576 break; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
577 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
578 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
579 if (configs != 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
580 break; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
581 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
582 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
583 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
584 /* No available configs */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
585 if (configs == 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
586 SDL_SetError("PND: Can't find any configuration for OpenGL ES"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
587 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
588 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
589 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
590 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
591 /* Initialize config index */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
592 wdata->gles_config = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
593 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
594 /* Now check each configuration to find out the best */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
595 for (cit = 0; cit < configs; cit++) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
596 uint32_t stencil_found; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
597 uint32_t depth_found; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
598 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
599 stencil_found = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
600 depth_found = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
601 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
602 if (_this->gl_config.stencil_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
603 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
604 eglGetConfigAttrib(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
605 wdata->gles_configs[cit], EGL_STENCIL_SIZE, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
606 &attr_value); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
607 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
608 if (attr_value != 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
609 stencil_found = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
610 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
611 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
612 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
613 stencil_found = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
614 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
615 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
616 if (_this->gl_config.depth_size) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
617 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
618 eglGetConfigAttrib(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
619 wdata->gles_configs[cit], EGL_DEPTH_SIZE, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
620 &attr_value); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
621 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
622 if (attr_value != 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
623 depth_found = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
624 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
625 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
626 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
627 depth_found = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
628 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
629 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
630 /* Exit from loop if found appropriate configuration */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
631 if ((depth_found != 0) && (stencil_found != 0)) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
632 break; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
633 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
634 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
635 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
636 /* If best could not be found, use first */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
637 if (cit == configs) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
638 cit = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
639 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
640 wdata->gles_config = cit; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
641 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
642 /* Create OpenGL ES context */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
643 wdata->gles_context = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
644 eglCreateContext(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
645 wdata->gles_configs[wdata->gles_config], NULL, NULL); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
646 if (wdata->gles_context == EGL_NO_CONTEXT) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
647 SDL_SetError("PND: OpenGL ES context creation has been failed"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
648 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
649 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
650 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
651 wdata->gles_surface = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
652 eglCreateWindowSurface(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
653 wdata->gles_configs[wdata->gles_config], |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
654 (NativeWindowType) 0, NULL); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
655 if (wdata->gles_surface == 0) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
656 SDL_SetError("Error : eglCreateWindowSurface failed;\n"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
657 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
658 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
659 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
660 /* Make just created context current */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
661 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
662 eglMakeCurrent(phdata->egl_display, wdata->gles_surface, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
663 wdata->gles_surface, wdata->gles_context); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
664 if (status != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
665 /* Destroy OpenGL ES surface */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
666 eglDestroySurface(phdata->egl_display, wdata->gles_surface); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
667 eglDestroyContext(phdata->egl_display, wdata->gles_context); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
668 wdata->gles_context = EGL_NO_CONTEXT; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
669 SDL_SetError("PND: Can't set OpenGL ES context on creation"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
670 return NULL; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
671 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
672 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
673 _this->gl_config.accelerated = 1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
674 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
675 /* Always clear stereo enable, since OpenGL ES do not supports stereo */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
676 _this->gl_config.stereo = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
677 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
678 /* Get back samples and samplebuffers configurations. Rest framebuffer */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
679 /* parameters could be obtained through the OpenGL ES API */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
680 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
681 eglGetConfigAttrib(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
682 wdata->gles_configs[wdata->gles_config], |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
683 EGL_SAMPLES, &attr_value); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
684 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
685 _this->gl_config.multisamplesamples = attr_value; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
686 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
687 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
688 eglGetConfigAttrib(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
689 wdata->gles_configs[wdata->gles_config], |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
690 EGL_SAMPLE_BUFFERS, &attr_value); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
691 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
692 _this->gl_config.multisamplebuffers = attr_value; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
693 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
694 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
695 /* Get back stencil and depth buffer sizes */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
696 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
697 eglGetConfigAttrib(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
698 wdata->gles_configs[wdata->gles_config], |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
699 EGL_DEPTH_SIZE, &attr_value); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
700 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
701 _this->gl_config.depth_size = attr_value; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
702 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
703 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
704 eglGetConfigAttrib(phdata->egl_display, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
705 wdata->gles_configs[wdata->gles_config], |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
706 EGL_STENCIL_SIZE, &attr_value); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
707 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
708 _this->gl_config.stencil_size = attr_value; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
709 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
710 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
711 /* Under PND OpenGL ES output can't be double buffered */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
712 _this->gl_config.double_buffer = 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
713 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
714 /* GL ES context was successfully created */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
715 return wdata->gles_context; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
716 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
717 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
718 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
719 PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
720 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
721 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
722 SDL_WindowData *wdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
723 EGLBoolean status; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
724 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
725 if (phdata->egl_initialized != SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
726 SDL_SetError("PND: GF initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
727 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
728 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
729 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
730 if ((window == NULL) && (context == NULL)) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
731 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
732 eglMakeCurrent(phdata->egl_display, EGL_NO_SURFACE, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
733 EGL_NO_SURFACE, EGL_NO_CONTEXT); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
734 if (status != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
735 /* Failed to set current GL ES context */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
736 SDL_SetError("PND: Can't set OpenGL ES context"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
737 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
738 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
739 } else { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
740 wdata = (SDL_WindowData *) window->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
741 if (wdata->gles_surface == EGL_NO_SURFACE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
742 SDL_SetError |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
743 ("PND: OpenGL ES surface is not initialized for this window"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
744 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
745 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
746 if (wdata->gles_context == EGL_NO_CONTEXT) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
747 SDL_SetError |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
748 ("PND: OpenGL ES context is not initialized for this window"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
749 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
750 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
751 if (wdata->gles_context != context) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
752 SDL_SetError |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
753 ("PND: OpenGL ES context is not belong to this window"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
754 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
755 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
756 status = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
757 eglMakeCurrent(phdata->egl_display, wdata->gles_surface, |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
758 wdata->gles_surface, wdata->gles_context); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
759 if (status != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
760 /* Failed to set current GL ES context */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
761 SDL_SetError("PND: Can't set OpenGL ES context"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
762 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
763 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
764 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
765 return 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
766 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
767 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
768 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
769 PND_gl_setswapinterval(_THIS, int interval) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
770 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
771 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
772 EGLBoolean status; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
773 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
774 if (phdata->egl_initialized != SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
775 SDL_SetError("PND: EGL initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
776 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
777 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
778 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
779 /* Check if OpenGL ES connection has been initialized */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
780 if (phdata->egl_display != EGL_NO_DISPLAY) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
781 /* Set swap OpenGL ES interval */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
782 status = eglSwapInterval(phdata->egl_display, interval); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
783 if (status == EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
784 /* Return success to upper level */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
785 phdata->swapinterval = interval; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
786 return 0; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
787 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
788 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
789 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
790 /* Failed to set swap interval */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
791 SDL_SetError("PND: Cannot set swap interval"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
792 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
793 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
794 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
795 int |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
796 PND_gl_getswapinterval(_THIS) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
797 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
798 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
799 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
800 if (phdata->egl_initialized != SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
801 SDL_SetError("PND: GLES initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
802 return -1; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
803 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
804 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
805 /* Return default swap interval value */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
806 return phdata->swapinterval; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
807 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
808 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
809 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
810 PND_gl_swapwindow(_THIS, SDL_Window * window) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
811 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
812 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
813 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
814 SDL_DisplayData *didata = |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
815 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
816 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
817 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
818 if (phdata->egl_initialized != SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
819 SDL_SetError("PND: GLES initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
820 return; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
821 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
822 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
823 /* Many applications do not uses glFinish(), so we call it for them */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
824 glFinish(); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
825 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
826 /* Wait until OpenGL ES rendering is completed */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
827 eglWaitGL(); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
828 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
829 eglSwapBuffers(phdata->egl_display, wdata->gles_surface); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
830 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
831 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
832 void |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
833 PND_gl_deletecontext(_THIS, SDL_GLContext context) |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
834 { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
835 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
836 EGLBoolean status; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
837 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
838 if (phdata->egl_initialized != SDL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
839 SDL_SetError("PND: GLES initialization failed, no OpenGL ES support"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
840 return; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
841 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
842 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
843 /* Check if OpenGL ES connection has been initialized */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
844 if (phdata->egl_display != EGL_NO_DISPLAY) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
845 if (context != EGL_NO_CONTEXT) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
846 status = eglDestroyContext(phdata->egl_display, context); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
847 if (status != EGL_TRUE) { |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
848 /* Error during OpenGL ES context destroying */ |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
849 SDL_SetError("PND: OpenGL ES context destroy error"); |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
850 return; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
851 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
852 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
853 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
854 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
855 return; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
856 } |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
857 |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
858 /* vi: set ts=4 sw=4 expandtab: */ |