Mercurial > sdl-ios-xcode
comparison src/video/dga/SDL_dgavideo.h @ 101:825b2fa28e2e
DGA video driver is now thread-safe
Improved DGA hardware acceleration code
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Thu, 12 Jul 2001 20:42:22 +0000 |
parents | 74212992fb08 |
children | 2136ea8953f9 |
comparison
equal
deleted
inserted
replaced
100:a1c973c35fef | 101:825b2fa28e2e |
---|---|
35 #include "SDL_sysvideo.h" | 35 #include "SDL_sysvideo.h" |
36 | 36 |
37 /* Hidden "this" pointer for the video functions */ | 37 /* Hidden "this" pointer for the video functions */ |
38 #define _THIS SDL_VideoDevice *this | 38 #define _THIS SDL_VideoDevice *this |
39 | 39 |
40 /* Define this if you need the DGA driver to be thread-safe */ | |
41 #define LOCK_DGA_DISPLAY | |
42 #ifdef LOCK_DGA_DISPLAY | |
43 #define LOCK_DISPLAY() SDL_mutexP(event_lock) | |
44 #define UNLOCK_DISPLAY() SDL_mutexV(event_lock) | |
45 #else | |
46 #define LOCK_DISPLAY() | |
47 #define UNLOCK_DISPLAY() | |
48 #endif | |
49 | |
40 | 50 |
41 /* This is the structure we use to keep track of video memory */ | 51 /* This is the structure we use to keep track of video memory */ |
42 typedef struct vidmem_bucket { | 52 typedef struct vidmem_bucket { |
43 struct vidmem_bucket *prev; | 53 struct vidmem_bucket *prev; |
44 unsigned int used; | 54 int used; |
55 int dirty; | |
45 Uint8 *base; | 56 Uint8 *base; |
46 unsigned int size; | 57 unsigned int size; |
47 struct vidmem_bucket *next; | 58 struct vidmem_bucket *next; |
48 } vidmem_bucket; | 59 } vidmem_bucket; |
49 | 60 |
80 int flip_yoffset[2]; | 91 int flip_yoffset[2]; |
81 Uint8 *flip_address[2]; | 92 Uint8 *flip_address[2]; |
82 | 93 |
83 /* Used to handle DGA events */ | 94 /* Used to handle DGA events */ |
84 int event_base; | 95 int event_base; |
96 #ifdef LOCK_DGA_DISPLAY | |
97 SDL_mutex *event_lock; | |
98 #endif | |
85 }; | 99 }; |
86 /* Old variable names */ | 100 /* Old variable names */ |
87 #define DGA_Display (this->hidden->DGA_Display) | 101 #define DGA_Display (this->hidden->DGA_Display) |
88 #define DGA_Screen DefaultScreen(DGA_Display) | 102 #define DGA_Screen DefaultScreen(DGA_Display) |
89 #define DGA_colormap (this->hidden->DGA_colormap) | 103 #define DGA_colormap (this->hidden->DGA_colormap) |
100 #define surfaces (this->hidden->surfaces) | 114 #define surfaces (this->hidden->surfaces) |
101 #define surfaces_memtotal (this->hidden->surfaces_memtotal) | 115 #define surfaces_memtotal (this->hidden->surfaces_memtotal) |
102 #define surfaces_memleft (this->hidden->surfaces_memleft) | 116 #define surfaces_memleft (this->hidden->surfaces_memleft) |
103 #define hw_lock (this->hidden->hw_lock) | 117 #define hw_lock (this->hidden->hw_lock) |
104 #define DGA_event_base (this->hidden->event_base) | 118 #define DGA_event_base (this->hidden->event_base) |
119 #define event_lock (this->hidden->event_lock) | |
105 | 120 |
106 #endif /* _SDL_dgavideo_h */ | 121 #endif /* _SDL_dgavideo_h */ |