comparison src/video/gem/SDL_gemvideo.h @ 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 c121d94672cb
children 99210400e8b9
comparison
equal deleted inserted replaced
2188:0e751c1f83f5 2189:f54670a477bb
22 #include "SDL_config.h" 22 #include "SDL_config.h"
23 23
24 #ifndef _SDL_gemvideo_h 24 #ifndef _SDL_gemvideo_h
25 #define _SDL_gemvideo_h 25 #define _SDL_gemvideo_h
26 26
27 #include "SDL_mutex.h"
28 #include "../SDL_sysvideo.h" 27 #include "../SDL_sysvideo.h"
29 28
30 /* Hidden "this" pointer for the video functions */ 29 #include "SDL_gemevents.h"
31 #define _THIS SDL_VideoDevice *this 30 #include "SDL_gemkeyboard.h"
32 31 #include "SDL_gemmodes.h"
33 /* Functions prototypes */ 32 #include "SDL_gemmouse.h"
34 void GEM_wind_redraw(_THIS, int winhandle, short *inside); 33 #include "SDL_gemwindow.h"
35 34
36 /* Private display data */ 35 /* Private display data */
37 36
38 #define B2S_C2P_1TO2 (1<<0) /* C2P convert buffer 1 to buffer 2 */ 37 typedef struct
39 #define B2S_C2P_1TOS (1<<1) /* C2P convert buffer 1 to screen */
40 #define B2S_VROCPYFM_1TOS (1<<2) /* vro_cpyfm() buffer 1 to screen */
41 #define B2S_VROCPYFM_2TOS (1<<3) /* vro_cpyfm() buffer 2 to screen */
42
43 #define SDL_NUMMODES 1 /* Fullscreen */
44
45 struct SDL_PrivateVideoData
46 { 38 {
47 Uint16 buf2scr_ops; /* Operations to get buffer to screen */ 39 int mouse;
48 void *buffer1; /* Our shadow buffers */ 40 int keyboard;
49 void *buffer2;
50 41
51 /* VDI infos */ 42 /* VDI infos */
52 short vdi_handle; /* VDI handle */ 43 short vdi_handle; /* workstation handle */
53 short full_w, full_h; /* Fullscreen size */
54 short bpp; /* Colour depth */
55 short pixelsize; /* Bytes per pixel */
56 short old_numcolors; /* Number of colors in saved palette */
57 Uint16 pitch; /* Line length */
58 Uint16 format; /* Screen format */
59 void *screen; /* Screen address */
60 Uint32 red, green, blue, alpha; /* Screen components */
61 Uint32 screensize;
62 short blit_coords[8]; /* Coordinates for bitblt */
63 MFDB src_mfdb, dst_mfdb; /* VDI MFDB for bitblt */
64 Uint16 old_palette[256][3]; /* Saved current palette */
65 Uint16 cur_palette[256][3]; /* SDL application palette */
66 /* Function to set/restore palette */
67 void (*setpalette) (_THIS, Uint16 newpal[256][3]);
68 44
69 /* GEM infos */ 45 /* AES infos */
70 short desk_x, desk_y; /* Desktop properties */ 46 int wfeatures; /* window features */
71 short desk_w, desk_h; 47 } SDL_VideoData;
72 short win_handle; /* Our window handle */
73 int window_type; /* Window type */
74 const char *title_name; /* Window title */
75 const char *icon_name; /* Icon title */
76 short version; /* AES version */
77 short wfeatures; /* AES window features */
78 SDL_bool refresh_name; /* Change window title ? */
79 SDL_bool window_fulled; /* Window maximized ? */
80 SDL_bool mouse_relative; /* Report relative mouse movement */
81 SDL_bool locked; /* AES locked for fullscreen ? */
82 SDL_bool lock_redraw; /* Prevent redraw till buffers are setup */
83 short message[8]; /* To self-send an AES message */
84 void *menubar; /* Menu bar save buffer when going fullscreen */
85 SDL_bool use_dev_mouse; /* Use /dev/mouse ? */
86
87 SDL_bool fullscreen; /* Fullscreen or windowed mode ? */
88 SDL_Rect *SDL_modelist[SDL_NUMMODES + 1]; /* Mode list */
89 SDL_Surface *icon; /* The icon */
90 };
91
92 /* Hidden structure -> variables names */
93 #define VDI_handle (this->hidden->vdi_handle)
94 #define VDI_w (this->hidden->full_w)
95 #define VDI_h (this->hidden->full_h)
96 #define VDI_bpp (this->hidden->bpp)
97 #define VDI_pixelsize (this->hidden->pixelsize)
98 #define VDI_oldnumcolors (this->hidden->old_numcolors)
99 #define VDI_oldpalette (this->hidden->old_palette)
100 #define VDI_curpalette (this->hidden->cur_palette)
101 #define VDI_setpalette (this->hidden->setpalette)
102 #define VDI_pitch (this->hidden->pitch)
103 #define VDI_format (this->hidden->format)
104 #define VDI_screen (this->hidden->screen)
105 #define VDI_redmask (this->hidden->red)
106 #define VDI_greenmask (this->hidden->green)
107 #define VDI_bluemask (this->hidden->blue)
108 #define VDI_alphamask (this->hidden->alpha)
109 #define VDI_screensize (this->hidden->screensize)
110 #define VDI_src_mfdb (this->hidden->src_mfdb)
111 #define VDI_dst_mfdb (this->hidden->dst_mfdb)
112 #define VDI_blit_coords (this->hidden->blit_coords)
113
114 #define GEM_desk_x (this->hidden->desk_x)
115 #define GEM_desk_y (this->hidden->desk_y)
116 #define GEM_desk_w (this->hidden->desk_w)
117 #define GEM_desk_h (this->hidden->desk_h)
118 #define GEM_handle (this->hidden->win_handle)
119 #define GEM_win_type (this->hidden->window_type)
120 #define GEM_title_name (this->hidden->title_name)
121 #define GEM_icon_name (this->hidden->icon_name)
122 #define GEM_refresh_name (this->hidden->refresh_name)
123 #define GEM_version (this->hidden->version)
124 #define GEM_wfeatures (this->hidden->wfeatures)
125 #define GEM_win_fulled (this->hidden->window_fulled)
126 #define GEM_mouse_relative (this->hidden->mouse_relative)
127 #define GEM_locked (this->hidden->locked)
128 #define GEM_lock_redraw (this->hidden->lock_redraw)
129 #define GEM_message (this->hidden->message)
130 #define SDL_modelist (this->hidden->SDL_modelist)
131 #define GEM_icon (this->hidden->icon)
132 #define GEM_fullscreen (this->hidden->fullscreen)
133 #define GEM_menubar (this->hidden->menubar)
134 #define GEM_usedevmouse (this->hidden->use_dev_mouse)
135
136 #define GEM_buffer1 (this->hidden->buffer1)
137 #define GEM_buffer2 (this->hidden->buffer2)
138 #define GEM_bufops (this->hidden->buf2scr_ops)
139
140 #define VDI_FBMASK(amask, rmask, gmask, bmask) \
141 VDI_alphamask = (amask); \
142 VDI_redmask = (rmask); \
143 VDI_greenmask = (gmask); \
144 VDI_bluemask = (bmask);
145
146 /*
147 Possible buffer to screen operations:
148
149 TC: 8 (chunky),15,16,24,32 bpp
150 8I: 8 bpp planes
151 FB: screen framebuffer address available
152 FS: fullscreen
153
154 TC, FB, FS:
155 - draw to screen
156 8I, FB, FS:
157 - draw to buffer 1
158 - C2P from buffer 1 to screen
159
160 TC, !FB, FS:
161 - draw to buffer 1
162 - vro_cpyfm() from buffer 1 to screen
163 8I, !FB, FS:
164 - draw to buffer 1
165 - C2P from buffer 1 to buffer 2
166 - vro_cpyfm() from buffer 2 to screen
167
168 TC, FB, !FS:
169 - draw to buffer 1
170 - vro_cpyfm() from buffer 1 to screen
171 8I, FB, !FS:
172 - draw to buffer 1
173 - C2P from buffer 1 to buffer 2
174 - vro_cpyfm() from buffer 2 to screen
175
176 TC, !FB, !FS:
177 - draw to buffer 1
178 - vro_cpyfm() from buffer 1 to screen
179 8I, !FB, !FS:
180 - draw to buffer 1
181 - C2P from buffer 1 to buffer 2
182 - vro_cpyfm() from buffer 2 to screen
183 */
184 48
185 #endif /* _SDL_gemvideo_h */ 49 #endif /* _SDL_gemvideo_h */
50
186 /* vi: set ts=4 sw=4 expandtab: */ 51 /* vi: set ts=4 sw=4 expandtab: */