annotate src/video/gem/SDL_gemmodes.c @ 2189:f54670a477bb

Update GEM driver to new API, will have to fill the void later :)
author Patrice Mandin <patmandin@gmail.com>
date Fri, 13 Jul 2007 22:55:15 +0000
parents
children 7e1caa8452f3
rev   line source
2189
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
1 /*
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
4
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
9
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
13 Lesser General Public License for more details.
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
14
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
18
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
19 Sam Lantinga
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
20 slouken@libsdl.org
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
21 */
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
22 #include "SDL_config.h"
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
23
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
24 #include "SDL_gemvideo.h"
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
25
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
26
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
27 void
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
28 GEM_InitModes(_THIS)
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
29 {
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
30 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
31 Uint32 Rmask, Gmask, Bmask, Amask;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
32 SDL_VideoDisplay display;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
33 SDL_DisplayData *displaydata;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
34 SDL_DisplayMode mode;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
35 int bpp;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
36
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
37 /* read vdi bpp, rmask, gmask, bmask, amask */
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
38
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
39 mode.format =
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
40 SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
41 mode.w = 0 /* vdi width */;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
42 mode.h = 0 /* vdi height */;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
43 mode.refresh_rate = 0;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
44 mode.driverdata = NULL;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
45
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
46 displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
47 if (!displaydata) {
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
48 return;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
49 }
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
50 /* fill display data */
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
51
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
52 SDL_zero(display);
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
53 display.desktop_mode = mode;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
54 display.current_mode = mode;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
55 display.driverdata = displaydata;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
56 SDL_AddVideoDisplay(&display);
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
57 }
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
58
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
59 void
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
60 GEM_GetDisplayModes(_THIS)
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
61 {
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
62 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
63 SDL_DisplayMode mode;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
64 //SDL_AddDisplayMode(_this->current_display, &mode);
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
65 }
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
66
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
67 int
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
68 GEM_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
69 {
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
70 //SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
71 return -1;
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
72 }
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
73
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
74 void
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
75 GEM_QuitModes(_THIS)
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
76 {
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
77 }
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
78
f54670a477bb Update GEM driver to new API, will have to fill the void later :)
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
79 /* vi: set ts=4 sw=4 expandtab: */