Skip to content

Latest commit

 

History

History
203 lines (176 loc) · 7.09 KB

SDL_gemvideo.h

File metadata and controls

203 lines (176 loc) · 7.09 KB
 
1
2
/*
SDL - Simple DirectMedia Layer
Dec 31, 2011
Dec 31, 2011
3
Copyright (C) 1997-2012 Sam Lantinga
4
5
This library is free software; you can redistribute it and/or
Feb 1, 2006
Feb 1, 2006
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
Feb 1, 2006
Feb 1, 2006
8
version 2.1 of the License, or (at your option) any later version.
9
10
11
12
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Feb 1, 2006
Feb 1, 2006
13
Lesser General Public License for more details.
Feb 1, 2006
Feb 1, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19
20
21
Sam Lantinga
slouken@libsdl.org
*/
Feb 21, 2006
Feb 21, 2006
22
#include "SDL_config.h"
23
24
25
26
27
#ifndef _SDL_gemvideo_h
#define _SDL_gemvideo_h
#include "SDL_mutex.h"
Feb 16, 2006
Feb 16, 2006
28
#include "../SDL_sysvideo.h"
Jun 14, 2006
Jun 14, 2006
30
31
32
33
34
/* The implementation dependent data for the window manager cursor */
struct WMcursor {
MFORM *mform_p;
};
35
36
37
38
39
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
/* Functions prototypes */
void GEM_wind_redraw(_THIS, int winhandle, short *inside);
Oct 6, 2017
Oct 6, 2017
40
void GEM_align_work_area(_THIS, short windowid, int clear_pads);
41
42
43
/* Private display data */
Nov 12, 2003
Nov 12, 2003
44
45
46
47
48
#define B2S_C2P_1TO2 (1<<0) /* C2P convert buffer 1 to buffer 2 */
#define B2S_C2P_1TOS (1<<1) /* C2P convert buffer 1 to screen */
#define B2S_VROCPYFM_1TOS (1<<2) /* vro_cpyfm() buffer 1 to screen */
#define B2S_VROCPYFM_2TOS (1<<3) /* vro_cpyfm() buffer 2 to screen */
49
50
51
#define SDL_NUMMODES 1 /* Fullscreen */
struct SDL_PrivateVideoData {
Nov 12, 2003
Nov 12, 2003
52
Uint16 buf2scr_ops; /* Operations to get buffer to screen */
Jul 12, 2007
Jul 12, 2007
53
void *buffer1; /* Our shadow buffers */
Nov 12, 2003
Nov 12, 2003
54
55
void *buffer2;
56
57
58
/* VDI infos */
short vdi_handle; /* VDI handle */
short full_w, full_h; /* Fullscreen size */
Jul 12, 2007
Jul 12, 2007
59
short bpp; /* Colour depth */
Nov 12, 2003
Nov 12, 2003
60
61
short pixelsize; /* Bytes per pixel */
short old_numcolors; /* Number of colors in saved palette */
62
Uint16 pitch; /* Line length */
Nov 12, 2003
Nov 12, 2003
63
Uint16 format; /* Screen format */
64
65
66
void *screen; /* Screen address */
Uint32 red, green, blue, alpha; /* Screen components */
Uint32 screensize;
Aug 13, 2014
Aug 13, 2014
67
MFDB dst_mfdb; /* VDI MFDB for bitblt */
Nov 12, 2003
Nov 12, 2003
68
Uint16 old_palette[256][3]; /* Saved current palette */
Jun 7, 2005
Jun 7, 2005
69
70
71
Uint16 cur_palette[256][3]; /* SDL application palette */
/* Function to set/restore palette */
void (*setpalette)(_THIS, Uint16 newpal[256][3]);
Nov 12, 2003
Nov 12, 2003
72
Dec 7, 2002
Dec 7, 2002
73
/* GEM infos */
Sep 11, 2014
Sep 11, 2014
74
short ap_id;
75
76
77
78
short desk_x, desk_y; /* Desktop properties */
short desk_w, desk_h;
short win_handle; /* Our window handle */
int window_type; /* Window type */
Sep 30, 2017
Sep 30, 2017
79
80
short work_x, work_y; /* Window work area x,y,w,h */
short work_w, work_h;
81
82
83
84
const char *title_name; /* Window title */
const char *icon_name; /* Icon title */
short version; /* AES version */
short wfeatures; /* AES window features */
Nov 12, 2003
Nov 12, 2003
85
SDL_bool refresh_name; /* Change window title ? */
86
SDL_bool window_fulled; /* Window maximized ? */
Oct 6, 2017
Oct 6, 2017
87
SDL_bool iconified; /* Window iconified ? */
88
89
SDL_bool mouse_relative; /* Report relative mouse movement */
SDL_bool locked; /* AES locked for fullscreen ? */
Nov 6, 2004
Nov 6, 2004
90
SDL_bool lock_redraw; /* Prevent redraw till buffers are setup */
Aug 13, 2014
Aug 13, 2014
91
SDL_bool cursor_hidden; /* Mouse cursor hidden flag */
Nov 12, 2003
Nov 12, 2003
92
short message[8]; /* To self-send an AES message */
Jun 6, 2005
Jun 6, 2005
93
void *menubar; /* Menu bar save buffer when going fullscreen */
Feb 23, 2006
Feb 23, 2006
94
SDL_bool use_dev_mouse; /* Use /dev/mouse ? */
Jun 14, 2006
Jun 14, 2006
95
WMcursor *cursor; /* To restore cursor when leaving/entering window */
Oct 2, 2017
Oct 2, 2017
96
WMcursor *prev_cursor; /* Previous cursor */
Aug 10, 2004
Aug 10, 2004
97
98
SDL_bool fullscreen; /* Fullscreen or windowed mode ? */
99
SDL_Rect *SDL_modelist[SDL_NUMMODES+1]; /* Mode list */
Nov 12, 2003
Nov 12, 2003
100
SDL_Surface *icon; /* The icon */
101
102
103
104
105
106
107
108
109
110
};
/* Hidden structure -> variables names */
#define VDI_handle (this->hidden->vdi_handle)
#define VDI_w (this->hidden->full_w)
#define VDI_h (this->hidden->full_h)
#define VDI_bpp (this->hidden->bpp)
#define VDI_pixelsize (this->hidden->pixelsize)
#define VDI_oldnumcolors (this->hidden->old_numcolors)
#define VDI_oldpalette (this->hidden->old_palette)
Jun 7, 2005
Jun 7, 2005
111
112
#define VDI_curpalette (this->hidden->cur_palette)
#define VDI_setpalette (this->hidden->setpalette)
113
114
115
116
117
118
119
120
121
#define VDI_pitch (this->hidden->pitch)
#define VDI_format (this->hidden->format)
#define VDI_screen (this->hidden->screen)
#define VDI_redmask (this->hidden->red)
#define VDI_greenmask (this->hidden->green)
#define VDI_bluemask (this->hidden->blue)
#define VDI_alphamask (this->hidden->alpha)
#define VDI_screensize (this->hidden->screensize)
#define VDI_dst_mfdb (this->hidden->dst_mfdb)
Dec 7, 2002
Dec 7, 2002
122
Sep 30, 2017
Sep 30, 2017
123
#define GEM_ap_id (this->hidden->ap_id)
124
125
126
127
128
129
#define GEM_desk_x (this->hidden->desk_x)
#define GEM_desk_y (this->hidden->desk_y)
#define GEM_desk_w (this->hidden->desk_w)
#define GEM_desk_h (this->hidden->desk_h)
#define GEM_handle (this->hidden->win_handle)
#define GEM_win_type (this->hidden->window_type)
Sep 30, 2017
Sep 30, 2017
130
131
132
133
#define GEM_work_x (this->hidden->work_x)
#define GEM_work_y (this->hidden->work_y)
#define GEM_work_w (this->hidden->work_w)
#define GEM_work_h (this->hidden->work_h)
134
135
#define GEM_title_name (this->hidden->title_name)
#define GEM_icon_name (this->hidden->icon_name)
Nov 12, 2003
Nov 12, 2003
136
#define GEM_refresh_name (this->hidden->refresh_name)
137
138
139
#define GEM_version (this->hidden->version)
#define GEM_wfeatures (this->hidden->wfeatures)
#define GEM_win_fulled (this->hidden->window_fulled)
Oct 6, 2017
Oct 6, 2017
140
#define GEM_iconified (this->hidden->iconified)
141
142
#define GEM_mouse_relative (this->hidden->mouse_relative)
#define GEM_locked (this->hidden->locked)
Nov 6, 2004
Nov 6, 2004
143
#define GEM_lock_redraw (this->hidden->lock_redraw)
Aug 13, 2014
Aug 13, 2014
144
#define GEM_cursor_hidden (this->hidden->cursor_hidden)
Nov 12, 2003
Nov 12, 2003
145
#define GEM_message (this->hidden->message)
146
#define SDL_modelist (this->hidden->SDL_modelist)
Nov 12, 2003
Nov 12, 2003
147
#define GEM_icon (this->hidden->icon)
Aug 10, 2004
Aug 10, 2004
148
#define GEM_fullscreen (this->hidden->fullscreen)
Jun 6, 2005
Jun 6, 2005
149
#define GEM_menubar (this->hidden->menubar)
Feb 23, 2006
Feb 23, 2006
150
#define GEM_usedevmouse (this->hidden->use_dev_mouse)
Jun 14, 2006
Jun 14, 2006
151
#define GEM_cursor (this->hidden->cursor)
Oct 2, 2017
Oct 2, 2017
152
#define GEM_prev_cursor (this->hidden->prev_cursor)
Nov 12, 2003
Nov 12, 2003
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#define GEM_buffer1 (this->hidden->buffer1)
#define GEM_buffer2 (this->hidden->buffer2)
#define GEM_bufops (this->hidden->buf2scr_ops)
#define VDI_FBMASK(amask, rmask, gmask, bmask) \
VDI_alphamask = (amask); \
VDI_redmask = (rmask); \
VDI_greenmask = (gmask); \
VDI_bluemask = (bmask);
/*
Possible buffer to screen operations:
TC: 8 (chunky),15,16,24,32 bpp
8I: 8 bpp planes
FB: screen framebuffer address available
FS: fullscreen
TC, FB, FS:
- draw to screen
8I, FB, FS:
- draw to buffer 1
- C2P from buffer 1 to screen
TC, !FB, FS:
- draw to buffer 1
- vro_cpyfm() from buffer 1 to screen
8I, !FB, FS:
- draw to buffer 1
- C2P from buffer 1 to buffer 2
- vro_cpyfm() from buffer 2 to screen
TC, FB, !FS:
- draw to buffer 1
- vro_cpyfm() from buffer 1 to screen
8I, FB, !FS:
- draw to buffer 1
- C2P from buffer 1 to buffer 2
- vro_cpyfm() from buffer 2 to screen
TC, !FB, !FS:
- draw to buffer 1
- vro_cpyfm() from buffer 1 to screen
8I, !FB, !FS:
- draw to buffer 1
- C2P from buffer 1 to buffer 2
- vro_cpyfm() from buffer 2 to screen
*/
202
203
#endif /* _SDL_gemvideo_h */