Mercurial > sdl-ios-xcode
annotate src/video/photon/SDL_ph_video.h @ 288:2f5a6062db86
Updated for Watcom C++ and LCC compilers
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 28 Feb 2002 00:28:26 +0000 |
parents | c6abdda2f666 |
children | f6ffac90895c |
rev | line source |
---|---|
0 | 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 | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 /* | |
23 static PhEvent_t *event; | |
24 static PtAppContext_t app; | |
25 static PtWidget_t *window; | |
26 static PgVideoModes_t modelist; | |
27 static PdOffscreenContext_t *Buff[2]; | |
28 static PdDirectContext_t *directContext; | |
29 static PhRect_t screenRect,windowRect; | |
30 static PgColor_t currRGB; | |
31 static PhPoint_t zeroPoint; | |
32 static char keyque[ QUE_SIZE ],keyMatrix[256]; | |
33 static int queput,queget; | |
34 static int modeSet; | |
35 static PgHWCaps_t hwCaps; | |
36 static PgDisplaySettings_t mode_settings; | |
37 static int rshift1,rshift2,gshift1,gshift2,bshift1,bshift2; | |
38 static int backPitch; | |
39 static unsigned RBitMask,GBitMask,BBitMask; | |
40 static unsigned TranslatedFillColor; | |
41 */ | |
42 | |
43 #ifndef _SDL_ph_video_h | |
44 #define _SDL_ph_video_h | |
45 | |
46 #include "SDL_mouse.h" | |
47 #include "SDL_sysvideo.h" | |
48 | |
49 #include "Ph.h" | |
50 #include "Pt.h" | |
51 #include <photon/Pg.h> | |
52 #include <photon/PdDirect.h> | |
266
c6abdda2f666
Added QNX cleanups by Mike Gorchak (thanks!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
53 #include <photon/PdGL.h> |
0 | 54 |
55 /* Hidden "this" pointer for the video functions */ | |
56 #define _THIS SDL_VideoDevice *this | |
57 | |
266
c6abdda2f666
Added QNX cleanups by Mike Gorchak (thanks!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
58 #define PH_OGL_MAX_ATTRIBS 32 |
c6abdda2f666
Added QNX cleanups by Mike Gorchak (thanks!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
59 |
0 | 60 typedef union vidptr{ |
61 uint8_t *volatile ptr8; | |
62 uint16_t *volatile ptr16; | |
63 uint32_t *volatile ptr32; | |
64 } VidPtr_t; | |
65 | |
66 typedef struct { | |
67 unsigned char *Y; | |
68 unsigned char *V; | |
69 unsigned char *U; | |
70 }FRAMEDATA; | |
71 | |
72 #define EVENT_SIZE sizeof( PhEvent_t ) + 1000 | |
73 | |
74 /* Private display data */ | |
75 struct SDL_PrivateVideoData { | |
76 int local_ph; /* Flag: true if local display */ | |
77 PtAppContext_t app; | |
78 PgDisplaySettings_t mode_settings; | |
79 PtWidget_t *window; /* used to handle input events */ | |
80 PhImage_t *image; /* used to display image */ | |
81 | |
82 struct { | |
83 PdDirectContext_t *direct_context; | |
84 PdOffscreenContext_t *offscreen_context; | |
85 VidPtr_t dc_ptr; | |
86 FRAMEDATA *CurrentFrameData; | |
87 FRAMEDATA *FrameData0; | |
88 FRAMEDATA *FrameData1; | |
89 int current; | |
90 long Stride; | |
91 long flags; | |
92 } ocimage; | |
93 | |
94 PhDrawContext_t *ScreenDC; //=NULL; | |
95 signed short old_video_mode; //=-1; | |
96 signed short old_refresh_rate; //=-1; | |
97 PgHWCaps_t graphics_card_caps; | |
98 | |
99 PdDirectContext_t *directContext; | |
100 PdOffscreenContext_t *Buff[2]; | |
101 struct _Ph_ctrl* ctrl_channel; | |
102 | |
103 PhGC_t *Pt_GC, *Pg_GC; /* Graphic contexts to switch between Pt and Pg APIs */ | |
104 | |
105 /* The variables used for displaying graphics */ | |
106 | |
107 /* The current width and height of the fullscreen mode */ | |
108 int current_w; | |
109 int current_h; | |
110 | |
111 /* Support for internal mouse warping */ | |
112 struct { | |
113 int x; | |
114 int y; | |
115 } mouse_last; | |
116 struct { | |
117 int numerator; | |
118 int denominator; | |
119 int threshold; | |
120 } mouse_accel; | |
121 int mouse_relative; | |
122 WMcursor* BlankCursor; | |
123 | |
124 | |
125 | |
126 int depth; /* current visual depth (not bpp) */ | |
127 | |
128 int use_vidmode; | |
129 int currently_fullscreen; | |
130 | |
131 /* Automatic mode switching support (entering/leaving fullscreen) */ | |
132 Uint32 switch_waiting; | |
133 Uint32 switch_time; | |
134 | |
135 /* Prevent too many XSync() calls */ | |
136 int blit_queued; | |
137 | |
138 short *iconcolors; /* List of colors used by the icon */ | |
139 PhEvent_t* event; | |
140 }; | |
141 | |
142 #define local_ph (this->hidden->local_ph) | |
143 #define app (this->hidden->app) | |
144 #define mode_settings (this->hidden->mode_settings) | |
145 #define window (this->hidden->window) | |
146 #define directContext (this->hidden->directContext) | |
147 #define Buff (this->hidden->Buff) | |
148 #define ctrl_channel (this->hidden->ctrl_channel) | |
149 #define SDL_Image (this->hidden->image) | |
150 #define OCImage (this->hidden->ocimage) | |
151 #define old_video_mode (this->hidden->old_video_mode) | |
152 #define old_refresh_rate (this->hidden->old_refresh_rate) | |
153 #define graphics_card_caps (this->hidden->graphics_card_caps) | |
154 #define Pt_GC (this->hidden->Pt_GC) | |
155 #define Pg_GC (this->hidden->Pg_GC) | |
156 | |
157 /* Old variable names */ | |
158 #define swap_pixels (this->hidden->swap_pixels) | |
159 #define current_w (this->hidden->current_w) | |
160 #define current_h (this->hidden->current_h) | |
161 #define mouse_last (this->hidden->mouse_last) | |
162 #define mouse_accel (this->hidden->mouse_accel) | |
163 #define mouse_relative (this->hidden->mouse_relative) | |
164 #define saved_mode (this->hidden->saved_mode) | |
165 #define saved_view (this->hidden->saved_view) | |
166 #define use_vidmode (this->hidden->use_vidmode) | |
167 #define currently_fullscreen (this->hidden->currently_fullscreen) | |
168 #define switch_waiting (this->hidden->switch_waiting) | |
169 #define switch_time (this->hidden->switch_time) | |
170 #define blit_queued (this->hidden->blit_queued) | |
171 #define SDL_iconcolorIs (this->hidden->iconcolors) | |
172 #define event (this->hidden->event) | |
173 #define SDL_BlankCursor (this->hidden->BlankCursor) | |
174 | |
175 #endif /* _SDL_x11video_h */ |