Mercurial > sdl-ios-xcode
comparison src/video/dga/SDL_dgavideo.h @ 0:74212992fb08
Initial revision
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Thu, 26 Apr 2001 16:45:43 +0000 |
parents | |
children | 825b2fa28e2e |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:74212992fb08 |
---|---|
1 /* | |
2 SDL - Simple DirectMedia Layer | |
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga | |
4 | |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
20 slouken@devolution.com | |
21 */ | |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 #ifndef _SDL_dgavideo_h | |
29 #define _SDL_dgavideo_h | |
30 | |
31 #include <X11/Xlib.h> | |
32 | |
33 #include "SDL_mouse.h" | |
34 #include "SDL_mutex.h" | |
35 #include "SDL_sysvideo.h" | |
36 | |
37 /* Hidden "this" pointer for the video functions */ | |
38 #define _THIS SDL_VideoDevice *this | |
39 | |
40 | |
41 /* This is the structure we use to keep track of video memory */ | |
42 typedef struct vidmem_bucket { | |
43 struct vidmem_bucket *prev; | |
44 unsigned int used; | |
45 Uint8 *base; | |
46 unsigned int size; | |
47 struct vidmem_bucket *next; | |
48 } vidmem_bucket; | |
49 | |
50 /* Information about the location of the surface in hardware memory */ | |
51 struct private_hwdata { | |
52 int x; | |
53 int y; | |
54 }; | |
55 | |
56 /* Private display data */ | |
57 struct SDL_PrivateVideoData { | |
58 Display *DGA_Display; | |
59 Colormap DGA_colormap; | |
60 int visualClass; | |
61 | |
62 #define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */ | |
63 int SDL_nummodes[NUM_MODELISTS]; | |
64 SDL_Rect **SDL_modelist[NUM_MODELISTS]; | |
65 | |
66 /* Information for the video surface */ | |
67 Uint8 *memory_base; | |
68 int memory_pitch; | |
69 SDL_mutex *hw_lock; | |
70 int sync_needed; | |
71 int was_flipped; | |
72 | |
73 /* Information for hardware surfaces */ | |
74 vidmem_bucket surfaces; | |
75 int surfaces_memtotal; | |
76 int surfaces_memleft; | |
77 | |
78 /* Information for double-buffering */ | |
79 int flip_page; | |
80 int flip_yoffset[2]; | |
81 Uint8 *flip_address[2]; | |
82 | |
83 /* Used to handle DGA events */ | |
84 int event_base; | |
85 }; | |
86 /* Old variable names */ | |
87 #define DGA_Display (this->hidden->DGA_Display) | |
88 #define DGA_Screen DefaultScreen(DGA_Display) | |
89 #define DGA_colormap (this->hidden->DGA_colormap) | |
90 #define DGA_visualClass (this->hidden->visualClass) | |
91 #define memory_base (this->hidden->memory_base) | |
92 #define memory_pitch (this->hidden->memory_pitch) | |
93 #define flip_page (this->hidden->flip_page) | |
94 #define flip_yoffset (this->hidden->flip_yoffset) | |
95 #define flip_address (this->hidden->flip_address) | |
96 #define sync_needed (this->hidden->sync_needed) | |
97 #define was_flipped (this->hidden->was_flipped) | |
98 #define SDL_nummodes (this->hidden->SDL_nummodes) | |
99 #define SDL_modelist (this->hidden->SDL_modelist) | |
100 #define surfaces (this->hidden->surfaces) | |
101 #define surfaces_memtotal (this->hidden->surfaces_memtotal) | |
102 #define surfaces_memleft (this->hidden->surfaces_memleft) | |
103 #define hw_lock (this->hidden->hw_lock) | |
104 #define DGA_event_base (this->hidden->event_base) | |
105 | |
106 #endif /* _SDL_dgavideo_h */ |