author | Philipp Wiesemann <philipp.wiesemann@arcor.de> |
Mon, 18 Jul 2016 22:03:47 +0200 | |
changeset 10202 | 16c283d1dcca |
parent 9998 | f67cf37e9cd4 |
permissions | -rw-r--r-- |
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
1 |
/* |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
2 |
Simple DirectMedia Layer |
9998
f67cf37e9cd4
Updated copyright to 2016
Sam Lantinga <slouken@libsdl.org>
parents:
9711
diff
changeset
|
3 |
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
4 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
5 |
This software is provided 'as-is', without any express or implied |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
6 |
warranty. In no event will the authors be held liable for any damages |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
7 |
arising from the use of this software. |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
8 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
9 |
Permission is granted to anyone to use this software for any purpose, |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
10 |
including commercial applications, and to alter it and redistribute it |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
11 |
freely, subject to the following restrictions: |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
12 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
13 |
1. The origin of this software must not be misrepresented; you must not |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
14 |
claim that you wrote the original software. If you use this software |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
15 |
in a product, an acknowledgment in the product documentation would be |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
16 |
appreciated but is not required. |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
17 |
2. Altered source versions must be plainly marked as such, and must not be |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
18 |
misrepresented as being the original software. |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
19 |
3. This notice may not be removed or altered from any source distribution. |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
20 |
*/ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
21 |
|
8093
b43765095a6f
Make internal SDL sources include SDL_internal.h instead of SDL_config.h
Ryan C. Gordon <icculus@icculus.org>
parents:
8000
diff
changeset
|
22 |
#include "../../SDL_internal.h" |
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
23 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
24 |
#if SDL_VIDEO_DRIVER_RPI |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
25 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
26 |
/* References |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
27 |
* http://elinux.org/RPi_VideoCore_APIs |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
28 |
* https://github.com/raspberrypi/firmware/blob/master/opt/vc/src/hello_pi/hello_triangle/triangle.c |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
29 |
* http://cgit.freedesktop.org/wayland/weston/tree/src/rpi-renderer.c |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
30 |
* http://cgit.freedesktop.org/wayland/weston/tree/src/compositor-rpi.c |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
31 |
*/ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
32 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
33 |
/* SDL internals */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
34 |
#include "../SDL_sysvideo.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
35 |
#include "SDL_version.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
36 |
#include "SDL_syswm.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
37 |
#include "SDL_loadso.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
38 |
#include "SDL_events.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
39 |
#include "../../events/SDL_mouse_c.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
40 |
#include "../../events/SDL_keyboard_c.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
41 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
42 |
#ifdef SDL_INPUT_LINUXEV |
8000
fe9403d0bc9d
Fixed bug 2231 - Move src/input/evdev into src/core/linux
Sam Lantinga <slouken@libsdl.org>
parents:
7986
diff
changeset
|
43 |
#include "../../core/linux/SDL_evdev.h" |
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
44 |
#endif |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
45 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
46 |
/* RPI declarations */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
47 |
#include "SDL_rpivideo.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
48 |
#include "SDL_rpievents_c.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
49 |
#include "SDL_rpiopengles.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
50 |
#include "SDL_rpimouse.h" |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
51 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
52 |
static int |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
53 |
RPI_Available(void) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
54 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
55 |
return 1; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
56 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
57 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
58 |
static void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
59 |
RPI_Destroy(SDL_VideoDevice * device) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
60 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
61 |
/* SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
62 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
63 |
if (device->driverdata != NULL) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
64 |
device->driverdata = NULL; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
65 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
66 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
67 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
68 |
static SDL_VideoDevice * |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
69 |
RPI_Create() |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
70 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
71 |
SDL_VideoDevice *device; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
72 |
SDL_VideoData *phdata; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
73 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
74 |
/* Initialize SDL_VideoDevice structure */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
75 |
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
76 |
if (device == NULL) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
77 |
SDL_OutOfMemory(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
78 |
return NULL; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
79 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
80 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
81 |
/* Initialize internal data */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
82 |
phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
83 |
if (phdata == NULL) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
84 |
SDL_OutOfMemory(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
85 |
SDL_free(device); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
86 |
return NULL; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
87 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
88 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
89 |
device->driverdata = phdata; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
90 |
|
10202
16c283d1dcca
Updated comments in video implementations.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents:
9998
diff
changeset
|
91 |
/* Setup amount of available displays */ |
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
92 |
device->num_displays = 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
93 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
94 |
/* Set device free function */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
95 |
device->free = RPI_Destroy; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
96 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
97 |
/* Setup all functions which we can handle */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
98 |
device->VideoInit = RPI_VideoInit; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
99 |
device->VideoQuit = RPI_VideoQuit; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
100 |
device->GetDisplayModes = RPI_GetDisplayModes; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
101 |
device->SetDisplayMode = RPI_SetDisplayMode; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
102 |
device->CreateWindow = RPI_CreateWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
103 |
device->CreateWindowFrom = RPI_CreateWindowFrom; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
104 |
device->SetWindowTitle = RPI_SetWindowTitle; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
105 |
device->SetWindowIcon = RPI_SetWindowIcon; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
106 |
device->SetWindowPosition = RPI_SetWindowPosition; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
107 |
device->SetWindowSize = RPI_SetWindowSize; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
108 |
device->ShowWindow = RPI_ShowWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
109 |
device->HideWindow = RPI_HideWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
110 |
device->RaiseWindow = RPI_RaiseWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
111 |
device->MaximizeWindow = RPI_MaximizeWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
112 |
device->MinimizeWindow = RPI_MinimizeWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
113 |
device->RestoreWindow = RPI_RestoreWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
114 |
device->SetWindowGrab = RPI_SetWindowGrab; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
115 |
device->DestroyWindow = RPI_DestroyWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
116 |
device->GetWindowWMInfo = RPI_GetWindowWMInfo; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
117 |
device->GL_LoadLibrary = RPI_GLES_LoadLibrary; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
118 |
device->GL_GetProcAddress = RPI_GLES_GetProcAddress; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
119 |
device->GL_UnloadLibrary = RPI_GLES_UnloadLibrary; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
120 |
device->GL_CreateContext = RPI_GLES_CreateContext; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
121 |
device->GL_MakeCurrent = RPI_GLES_MakeCurrent; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
122 |
device->GL_SetSwapInterval = RPI_GLES_SetSwapInterval; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
123 |
device->GL_GetSwapInterval = RPI_GLES_GetSwapInterval; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
124 |
device->GL_SwapWindow = RPI_GLES_SwapWindow; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
125 |
device->GL_DeleteContext = RPI_GLES_DeleteContext; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
126 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
127 |
device->PumpEvents = RPI_PumpEvents; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
128 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
129 |
return device; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
130 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
131 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
132 |
VideoBootStrap RPI_bootstrap = { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
133 |
"RPI", |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
134 |
"RPI Video Driver", |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
135 |
RPI_Available, |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
136 |
RPI_Create |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
137 |
}; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
138 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
139 |
/*****************************************************************************/ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
140 |
/* SDL Video and Display initialization/handling functions */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
141 |
/*****************************************************************************/ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
142 |
int |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
143 |
RPI_VideoInit(_THIS) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
144 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
145 |
SDL_VideoDisplay display; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
146 |
SDL_DisplayMode current_mode; |
7799
a67ccdd0c03a
Patched to compile in C90 mode.
Ryan C. Gordon <icculus@icculus.org>
parents:
7753
diff
changeset
|
147 |
SDL_DisplayData *data; |
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
148 |
uint32_t w,h; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
149 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
150 |
/* Initialize BCM Host */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
151 |
bcm_host_init(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
152 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
153 |
SDL_zero(current_mode); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
154 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
155 |
if (graphics_get_display_size( 0, &w, &h) < 0) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
156 |
return -1; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
157 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
158 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
159 |
current_mode.w = w; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
160 |
current_mode.h = h; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
161 |
/* FIXME: Is there a way to tell the actual refresh rate? */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
162 |
current_mode.refresh_rate = 60; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
163 |
/* 32 bpp for default */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
164 |
current_mode.format = SDL_PIXELFORMAT_ABGR8888; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
165 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
166 |
current_mode.driverdata = NULL; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
167 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
168 |
SDL_zero(display); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
169 |
display.desktop_mode = current_mode; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
170 |
display.current_mode = current_mode; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
171 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
172 |
/* Allocate display internal data */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
173 |
data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData)); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
174 |
if (data == NULL) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
175 |
return SDL_OutOfMemory(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
176 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
177 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
178 |
data->dispman_display = vc_dispmanx_display_open( 0 /* LCD */); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
179 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
180 |
display.driverdata = data; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
181 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
182 |
SDL_AddVideoDisplay(&display); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
183 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
184 |
#ifdef SDL_INPUT_LINUXEV |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
185 |
SDL_EVDEV_Init(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
186 |
#endif |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
187 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
188 |
RPI_InitMouse(_this); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
189 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
190 |
return 1; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
191 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
192 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
193 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
194 |
RPI_VideoQuit(_THIS) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
195 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
196 |
#ifdef SDL_INPUT_LINUXEV |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
197 |
SDL_EVDEV_Quit(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
198 |
#endif |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
199 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
200 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
201 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
202 |
RPI_GetDisplayModes(_THIS, SDL_VideoDisplay * display) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
203 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
204 |
/* Only one display mode available, the current one */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
205 |
SDL_AddDisplayMode(display, &display->current_mode); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
206 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
207 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
208 |
int |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
209 |
RPI_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
210 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
211 |
return 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
212 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
213 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
214 |
int |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
215 |
RPI_CreateWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
216 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
217 |
SDL_WindowData *wdata; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
218 |
SDL_VideoDisplay *display; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
219 |
SDL_DisplayData *displaydata; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
220 |
VC_RECT_T dst_rect; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
221 |
VC_RECT_T src_rect; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
222 |
VC_DISPMANX_ALPHA_T dispman_alpha; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
223 |
DISPMANX_UPDATE_HANDLE_T dispman_update; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
224 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
225 |
/* Disable alpha, otherwise the app looks composed with whatever dispman is showing (X11, console,etc) */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
226 |
dispman_alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
227 |
dispman_alpha.opacity = 0xFF; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
228 |
dispman_alpha.mask = 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
229 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
230 |
/* Allocate window internal data */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
231 |
wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
232 |
if (wdata == NULL) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
233 |
return SDL_OutOfMemory(); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
234 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
235 |
display = SDL_GetDisplayForWindow(window); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
236 |
displaydata = (SDL_DisplayData *) display->driverdata; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
237 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
238 |
/* Windows have one size for now */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
239 |
window->w = display->desktop_mode.w; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
240 |
window->h = display->desktop_mode.h; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
241 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
242 |
/* OpenGL ES is the law here, buddy */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
243 |
window->flags |= SDL_WINDOW_OPENGL; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
244 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
245 |
/* Create a dispman element and associate a window to it */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
246 |
dst_rect.x = 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
247 |
dst_rect.y = 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
248 |
dst_rect.width = window->w; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
249 |
dst_rect.height = window->h; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
250 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
251 |
src_rect.x = 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
252 |
src_rect.y = 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
253 |
src_rect.width = window->w << 16; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
254 |
src_rect.height = window->h << 16; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
255 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
256 |
dispman_update = vc_dispmanx_update_start( 0 ); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
257 |
wdata->dispman_window.element = vc_dispmanx_element_add ( dispman_update, displaydata->dispman_display, SDL_RPI_VIDEOLAYER /* layer */, &dst_rect, 0/*src*/, &src_rect, DISPMANX_PROTECTION_NONE, &dispman_alpha /*alpha*/, 0/*clamp*/, 0/*transform*/); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
258 |
wdata->dispman_window.width = window->w; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
259 |
wdata->dispman_window.height = window->h; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
260 |
vc_dispmanx_update_submit_sync( dispman_update ); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
261 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
262 |
if (!_this->egl_data) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
263 |
if (SDL_GL_LoadLibrary(NULL) < 0) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
264 |
return -1; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
265 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
266 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
267 |
wdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) &wdata->dispman_window); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
268 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
269 |
if (wdata->egl_surface == EGL_NO_SURFACE) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
270 |
return SDL_SetError("Could not create GLES window surface"); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
271 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
272 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
273 |
/* Setup driver data for this window */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
274 |
window->driverdata = wdata; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
275 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
276 |
/* One window, it always has focus */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
277 |
SDL_SetMouseFocus(window); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
278 |
SDL_SetKeyboardFocus(window); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
279 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
280 |
/* Window has been successfully created */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
281 |
return 0; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
282 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
283 |
|
7986
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
284 |
void |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
285 |
RPI_DestroyWindow(_THIS, SDL_Window * window) |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
286 |
{ |
9711
0a329b2a297f
RPi: Patched to compile without OpenGL (thanks, Simon!), other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
9619
diff
changeset
|
287 |
SDL_WindowData *data = (SDL_WindowData *) window->driverdata; |
0a329b2a297f
RPi: Patched to compile without OpenGL (thanks, Simon!), other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
9619
diff
changeset
|
288 |
if(data) { |
0a329b2a297f
RPi: Patched to compile without OpenGL (thanks, Simon!), other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
9619
diff
changeset
|
289 |
#if SDL_VIDEO_OPENGL_EGL |
7986
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
290 |
if (data->egl_surface != EGL_NO_SURFACE) { |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
291 |
SDL_EGL_DestroySurface(_this, data->egl_surface); |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
292 |
} |
9711
0a329b2a297f
RPi: Patched to compile without OpenGL (thanks, Simon!), other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
9619
diff
changeset
|
293 |
#endif |
0a329b2a297f
RPi: Patched to compile without OpenGL (thanks, Simon!), other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
9619
diff
changeset
|
294 |
SDL_free(data); |
7986
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
295 |
window->driverdata = NULL; |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
296 |
} |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
297 |
} |
ffb7bf531644
Clean up the EGL related video backends (X11, Android, RPi)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
7799
diff
changeset
|
298 |
|
7753
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
299 |
int |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
300 |
RPI_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
301 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
302 |
return -1; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
303 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
304 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
305 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
306 |
RPI_SetWindowTitle(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
307 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
308 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
309 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
310 |
RPI_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
311 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
312 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
313 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
314 |
RPI_SetWindowPosition(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
315 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
316 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
317 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
318 |
RPI_SetWindowSize(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
319 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
320 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
321 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
322 |
RPI_ShowWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
323 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
324 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
325 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
326 |
RPI_HideWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
327 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
328 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
329 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
330 |
RPI_RaiseWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
331 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
332 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
333 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
334 |
RPI_MaximizeWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
335 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
336 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
337 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
338 |
RPI_MinimizeWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
339 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
340 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
341 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
342 |
RPI_RestoreWindow(_THIS, SDL_Window * window) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
343 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
344 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
345 |
void |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
346 |
RPI_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
347 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
348 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
349 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
350 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
351 |
/*****************************************************************************/ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
352 |
/* SDL Window Manager function */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
353 |
/*****************************************************************************/ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
354 |
SDL_bool |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
355 |
RPI_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
356 |
{ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
357 |
if (info->version.major <= SDL_MAJOR_VERSION) { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
358 |
return SDL_TRUE; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
359 |
} else { |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
360 |
SDL_SetError("application not compiled with SDL %d.%d\n", |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
361 |
SDL_MAJOR_VERSION, SDL_MINOR_VERSION); |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
362 |
return SDL_FALSE; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
363 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
364 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
365 |
/* Failed to get window manager information */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
366 |
return SDL_FALSE; |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
367 |
} |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
368 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
369 |
#endif /* SDL_VIDEO_DRIVER_RPI */ |
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
370 |
|
e4c38f17bfad
Raspberry Pi support (also unified UDEV and EVDEV support)
Gabriel Jacobo <gabomdq@gmail.com>
parents:
diff
changeset
|
371 |
/* vi: set ts=4 sw=4 expandtab: */ |