comparison src/video/cybergfx/SDL_cgxvideo.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 8d9bb0cf2c2a
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
52 52
53 /* Hidden "this" pointer for the video functions */ 53 /* Hidden "this" pointer for the video functions */
54 #define _THIS SDL_VideoDevice *this 54 #define _THIS SDL_VideoDevice *this
55 55
56 /* Private display data */ 56 /* Private display data */
57 struct SDL_PrivateVideoData { 57 struct SDL_PrivateVideoData
58 struct Screen *Public_Display; /* Used for events and window management */ 58 {
59 struct Screen *GFX_Display; /* Used for graphics and colormap stuff */ 59 struct Screen *Public_Display; /* Used for events and window management */
60 Uint32 SDL_VisualUnused; /* The visual used by our window */ 60 struct Screen *GFX_Display; /* Used for graphics and colormap stuff */
61 struct Window *SDL_Window; /* Shared by both displays (no X security?) */ 61 Uint32 SDL_VisualUnused; /* The visual used by our window */
62 unsigned char *BlankCursor; /* The invisible cursor */ 62 struct Window *SDL_Window; /* Shared by both displays (no X security?) */
63 unsigned char *BlankCursor; /* The invisible cursor */
63 64
64 char *SDL_windowid; /* Flag: true if we have been passed a window */ 65 char *SDL_windowid; /* Flag: true if we have been passed a window */
65 66
66 /* The variables used for displaying graphics */ 67 /* The variables used for displaying graphics */
67 Uint8 *Ximage; /* The X image for our window */ 68 Uint8 *Ximage; /* The X image for our window */
68 int swap_pixels; /* Flag: true if display is swapped endian */ 69 int swap_pixels; /* Flag: true if display is swapped endian */
69 70
70 /* Support for internal mouse warping */ 71 /* Support for internal mouse warping */
71 struct { 72 struct
73 {
72 int x; 74 int x;
73 int y; 75 int y;
74 } mouse_last; 76 } mouse_last;
75 struct { 77 struct
78 {
76 int numerator; 79 int numerator;
77 int denominator; 80 int denominator;
78 int threshold; 81 int threshold;
79 } mouse_accel; 82 } mouse_accel;
80 int mouse_relative; 83 int mouse_relative;
81 84
82 /* The current list of available video modes */ 85 /* The current list of available video modes */
83 SDL_Rect **modelist; 86 SDL_Rect **modelist;
84 87
85 /* available visuals of interest to us, sorted deepest first */ 88 /* available visuals of interest to us, sorted deepest first */
86 struct { 89 struct
87 Uint32 visual; 90 {
88 int depth; /* number of significant bits/pixel */ 91 Uint32 visual;
89 int bpp; /* pixel quantum in bits */ 92 int depth; /* number of significant bits/pixel */
90 } visuals[5]; /* at most entries for 8, 15, 16, 24 */ 93 int bpp; /* pixel quantum in bits */
94 } visuals[5]; /* at most entries for 8, 15, 16, 24 */
91 int nvisuals; 95 int nvisuals;
92 96
93 Uint32 vis; /* current visual in use */ 97 Uint32 vis; /* current visual in use */
94 int depth; /* current visual depth (not bpp) */ 98 int depth; /* current visual depth (not bpp) */
95 int BytesPerPixel; 99 int BytesPerPixel;
96 int currently_fullscreen,same_format,dbuffer; 100 int currently_fullscreen, same_format, dbuffer;
97 101
98 /* Automatic mode switching support (entering/leaving fullscreen) */ 102 /* Automatic mode switching support (entering/leaving fullscreen) */
99 Uint32 switch_waiting; 103 Uint32 switch_waiting;
100 Uint32 switch_time; 104 Uint32 switch_time;
101 105
102 /* Prevent too many XSync() calls */ 106 /* Prevent too many XSync() calls */
103 int blit_queued; 107 int blit_queued;
104 108
105 /* Colormap handling */ 109 /* Colormap handling */
106 LONG Pens; 110 LONG Pens;
107 Sint32 *XPixels; /* A list of pixels that have been allocated, the size depends on the screen format */ 111 Sint32 *XPixels; /* A list of pixels that have been allocated, the size depends on the screen format */
108 struct ScreenBuffer *SB[2]; 112 struct ScreenBuffer *SB[2];
109 struct RastPort *RP; 113 struct RastPort *RP;
110 short *iconcolors; /* List of colors used by the icon */ 114 short *iconcolors; /* List of colors used by the icon */
111 }; 115 };
112 116
113 /* Old variable names */ 117 /* Old variable names */
114 #define local_X11 (this->hidden->local_X11) 118 #define local_X11 (this->hidden->local_X11)
115 #define SDL_Display (this->hidden->Public_Display) 119 #define SDL_Display (this->hidden->Public_Display)
142 #define SDL_iconcolors (this->hidden->iconcolors) 146 #define SDL_iconcolors (this->hidden->iconcolors)
143 147
144 /* Used to get the X cursor from a window-manager specific cursor */ 148 /* Used to get the X cursor from a window-manager specific cursor */
145 // extern Cursor SDL_GetWMXCursor(WMcursor *cursor); 149 // extern Cursor SDL_GetWMXCursor(WMcursor *cursor);
146 150
147 extern int CGX_CreateWindow(_THIS, SDL_Surface *screen, 151 extern int CGX_CreateWindow (_THIS, SDL_Surface * screen,
148 int w, int h, int bpp, Uint32 flags); 152 int w, int h, int bpp, Uint32 flags);
149 extern int CGX_ResizeWindow(_THIS, 153 extern int CGX_ResizeWindow (_THIS,
150 SDL_Surface *screen, int w, int h, Uint32 flags); 154 SDL_Surface * screen, int w, int h,
155 Uint32 flags);
151 156
152 extern void CGX_DestroyWindow(_THIS, SDL_Surface *screen); 157 extern void CGX_DestroyWindow (_THIS, SDL_Surface * screen);
153 158
154 extern struct Library *CyberGfxBase; 159 extern struct Library *CyberGfxBase;
155 extern struct IntuitionBase *IntuitionBase; 160 extern struct IntuitionBase *IntuitionBase;
156 extern struct GfxBase *GfxBase; 161 extern struct GfxBase *GfxBase;
157 extern struct ExecBase *SysBase; 162 extern struct ExecBase *SysBase;
158 extern struct DosLibrary *DOSBase; 163 extern struct DosLibrary *DOSBase;
159 164
160 struct private_hwdata 165 struct private_hwdata
161 { 166 {
162 struct BitMap *bmap; 167 struct BitMap *bmap;
163 APTR lock; 168 APTR lock;
164 struct SDL_VideoDevice *videodata; 169 struct SDL_VideoDevice *videodata;
165 APTR mask; 170 APTR mask;
166 int allocated; 171 int allocated;
167 }; 172 };
168 173
169 int CGX_CheckHWBlit(_THIS,SDL_Surface *src,SDL_Surface *dst); 174 int CGX_CheckHWBlit (_THIS, SDL_Surface * src, SDL_Surface * dst);
170 int CGX_FillHWRect(_THIS,SDL_Surface *dst,SDL_Rect *dstrect,Uint32 color); 175 int CGX_FillHWRect (_THIS, SDL_Surface * dst, SDL_Rect * dstrect,
171 int CGX_SetHWColorKey(_THIS,SDL_Surface *surface, Uint32 key); 176 Uint32 color);
177 int CGX_SetHWColorKey (_THIS, SDL_Surface * surface, Uint32 key);
172 #endif /* _SDL_x11video_h */ 178 #endif /* _SDL_x11video_h */
179 /* vi: set ts=4 sw=4 expandtab: */