comparison src/video/photon/SDL_ph_video.h @ 309:2de77f7b7a28

*** empty log message ***
author Sam Lantinga <slouken@libsdl.org>
date Mon, 11 Mar 2002 17:38:56 +0000
parents f6ffac90895c
children 3333b6e68289
comparison
equal deleted inserted replaced
308:ee32ed29a507 309:2de77f7b7a28
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 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 22
43 #ifndef _SDL_ph_video_h 23 #ifndef _SDL_ph_video_h
44 #define _SDL_ph_video_h 24 #define _SDL_ph_video_h
45 25
46 #include "SDL_mouse.h" 26 #include "SDL_mouse.h"
48 28
49 #include "Ph.h" 29 #include "Ph.h"
50 #include "Pt.h" 30 #include "Pt.h"
51 #include <photon/Pg.h> 31 #include <photon/Pg.h>
52 #include <photon/PdDirect.h> 32 #include <photon/PdDirect.h>
33 #ifdef HAVE_OPENGL
53 #include <photon/PdGL.h> 34 #include <photon/PdGL.h>
35 #endif /* HAVE_OPENGL */
54 36
55 /* Hidden "this" pointer for the video functions */ 37 /* Hidden "this" pointer for the video functions */
56 #define _THIS SDL_VideoDevice *this 38 #define _THIS SDL_VideoDevice *this
57 39
58 #define PH_OGL_MAX_ATTRIBS 32 40 #define PH_OGL_MAX_ATTRIBS 32
74 /* Private display data */ 56 /* Private display data */
75 struct SDL_PrivateVideoData { 57 struct SDL_PrivateVideoData {
76 int local_ph; /* Flag: true if local display */ 58 int local_ph; /* Flag: true if local display */
77 PtAppContext_t app; 59 PtAppContext_t app;
78 PgDisplaySettings_t mode_settings; 60 PgDisplaySettings_t mode_settings;
79 PtWidget_t *window; /* used to handle input events */ 61 PtWidget_t *Window; /* used to handle input events */
80 PhImage_t *image; /* used to display image */ 62 PhImage_t *image; /* used to display image */
63 #ifdef HAVE_OPENGL
64 PdOpenGLContext_t* OGLContext;
65 #endif /* HAVE_OPENGL */
81 66
82 struct { 67 struct {
83 PdDirectContext_t *direct_context; 68 PdDirectContext_t *direct_context;
84 PdOffscreenContext_t *offscreen_context; 69 PdOffscreenContext_t *offscreen_context;
85 VidPtr_t dc_ptr; 70 VidPtr_t dc_ptr;
86 FRAMEDATA *CurrentFrameData; 71 FRAMEDATA *CurrentFrameData;
87 FRAMEDATA *FrameData0; 72 FRAMEDATA *FrameData0;
88 FRAMEDATA *FrameData1; 73 FRAMEDATA *FrameData1;
89 int current; 74 int current;
90 long Stride; 75 long Stride;
91 long flags; 76 long flags;
92 } ocimage; 77 } ocimage;
93 78
94 PhDrawContext_t *ScreenDC; //=NULL; 79 PhDrawContext_t *ScreenDC; //=NULL;
95 signed short old_video_mode; //=-1; 80 signed short old_video_mode; //=-1;
96 signed short old_refresh_rate; //=-1; 81 signed short old_refresh_rate; //=-1;
97 PgHWCaps_t graphics_card_caps; 82 PgHWCaps_t graphics_card_caps;
98 83
99 PdDirectContext_t *directContext; 84 PdDirectContext_t *directContext;
100 PdOffscreenContext_t *Buff[2]; 85 PdOffscreenContext_t *Buff[2];
101 struct _Ph_ctrl* ctrl_channel; 86 struct _Ph_ctrl* ctrl_channel;
102
103 PhGC_t *Pt_GC, *Pg_GC; /* Graphic contexts to switch between Pt and Pg APIs */
104 87
105 /* The variables used for displaying graphics */ 88 /* The variables used for displaying graphics */
106 89
107 /* The current width and height of the fullscreen mode */ 90 /* The current width and height of the fullscreen mode */
108 int current_w; 91 int current_w;
111 /* Support for internal mouse warping */ 94 /* Support for internal mouse warping */
112 struct { 95 struct {
113 int x; 96 int x;
114 int y; 97 int y;
115 } mouse_last; 98 } mouse_last;
99
116 struct { 100 struct {
117 int numerator; 101 int numerator;
118 int denominator; 102 int denominator;
119 int threshold; 103 int threshold;
120 } mouse_accel; 104 } mouse_accel;
105
121 int mouse_relative; 106 int mouse_relative;
122 WMcursor* BlankCursor; 107 WMcursor* BlankCursor;
123
124
125 108
126 int depth; /* current visual depth (not bpp) */ 109 int depth; /* current visual depth (not bpp) */
127 110
128 int use_vidmode; 111 int use_vidmode;
129 int currently_fullscreen; 112 int currently_fullscreen;
134 117
135 /* Prevent too many XSync() calls */ 118 /* Prevent too many XSync() calls */
136 int blit_queued; 119 int blit_queued;
137 120
138 short *iconcolors; /* List of colors used by the icon */ 121 short *iconcolors; /* List of colors used by the icon */
139 PhEvent_t* event; 122 PhEvent_t* event;
140 }; 123 };
141 124
142 #define local_ph (this->hidden->local_ph) 125 #define local_ph (this->hidden->local_ph)
143 #define app (this->hidden->app) 126 #define app (this->hidden->app)
144 #define mode_settings (this->hidden->mode_settings) 127 #define mode_settings (this->hidden->mode_settings)
145 #define window (this->hidden->window) 128 #define window (this->hidden->Window)
146 #define directContext (this->hidden->directContext) 129 #define oglctx (this->hidden->OGLContext)
147 #define Buff (this->hidden->Buff) 130 #define directContext (this->hidden->directContext)
148 #define ctrl_channel (this->hidden->ctrl_channel) 131 #define Buff (this->hidden->Buff)
149 #define SDL_Image (this->hidden->image) 132 #define ctrl_channel (this->hidden->ctrl_channel)
150 #define OCImage (this->hidden->ocimage) 133 #define SDL_Image (this->hidden->image)
151 #define old_video_mode (this->hidden->old_video_mode) 134 #define OCImage (this->hidden->ocimage)
152 #define old_refresh_rate (this->hidden->old_refresh_rate) 135 #define old_video_mode (this->hidden->old_video_mode)
153 #define graphics_card_caps (this->hidden->graphics_card_caps) 136 #define old_refresh_rate (this->hidden->old_refresh_rate)
154 #define Pt_GC (this->hidden->Pt_GC) 137 #define graphics_card_caps (this->hidden->graphics_card_caps)
155 #define Pg_GC (this->hidden->Pg_GC)
156 138
157 /* Old variable names */ 139 /* Old variable names */
158 #define swap_pixels (this->hidden->swap_pixels) 140 #define swap_pixels (this->hidden->swap_pixels)
159 #define current_w (this->hidden->current_w) 141 #define current_w (this->hidden->current_w)
160 #define current_h (this->hidden->current_h) 142 #define current_h (this->hidden->current_h)
161 #define mouse_last (this->hidden->mouse_last) 143 #define mouse_last (this->hidden->mouse_last)
162 #define mouse_accel (this->hidden->mouse_accel) 144 #define mouse_accel (this->hidden->mouse_accel)
163 #define mouse_relative (this->hidden->mouse_relative) 145 #define mouse_relative (this->hidden->mouse_relative)
164 #define saved_mode (this->hidden->saved_mode) 146 #define saved_mode (this->hidden->saved_mode)
165 #define saved_view (this->hidden->saved_view) 147 #define saved_view (this->hidden->saved_view)
166 #define use_vidmode (this->hidden->use_vidmode) 148 #define use_vidmode (this->hidden->use_vidmode)
167 #define currently_fullscreen (this->hidden->currently_fullscreen) 149 #define currently_fullscreen (this->hidden->currently_fullscreen)
168 #define switch_waiting (this->hidden->switch_waiting) 150 #define switch_waiting (this->hidden->switch_waiting)
169 #define switch_time (this->hidden->switch_time) 151 #define switch_time (this->hidden->switch_time)
170 #define blit_queued (this->hidden->blit_queued) 152 #define blit_queued (this->hidden->blit_queued)
171 #define SDL_iconcolorIs (this->hidden->iconcolors) 153 #define SDL_iconcolorIs (this->hidden->iconcolors)
172 #define event (this->hidden->event) 154 #define event (this->hidden->event)
173 #define SDL_BlankCursor (this->hidden->BlankCursor) 155 #define SDL_BlankCursor (this->hidden->BlankCursor)
174 156
175 #endif /* _SDL_x11video_h */ 157 #endif /* _SDL_x11video_h */