Mercurial > sdl-ios-xcode
annotate src/video/photon/SDL_ph_video.h @ 737:7e4347dd2f9c
Small fix for iconification
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Fri, 14 Nov 2003 19:48:13 +0000 |
parents | aaf3b8af6616 |
children | b14fdadd8311 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
297
f6ffac90895c
Updated copyright information for 2002
Sam Lantinga <slouken@libsdl.org>
parents:
266
diff
changeset
|
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga |
0 | 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 | |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
23 #ifndef __SDL_PH_VIDEO_H__ |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
24 #define __SDL_PH_VIDEO_H__ |
0 | 25 |
26 #include "SDL_mouse.h" | |
27 #include "SDL_sysvideo.h" | |
28 | |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
29 #include <Ph.h> |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
30 #include <Pt.h> |
0 | 31 #include <photon/Pg.h> |
32 #include <photon/PdDirect.h> | |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
33 |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
34 #ifdef HAVE_OPENGL |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
35 #include <photon/PdGL.h> |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
36 #endif /* HAVE_OPENGL */ |
0 | 37 |
38 /* Hidden "this" pointer for the video functions */ | |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
39 #define _THIS SDL_VideoDevice* this |
0 | 40 |
266
c6abdda2f666
Added QNX cleanups by Mike Gorchak (thanks!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
41 #define PH_OGL_MAX_ATTRIBS 32 |
c6abdda2f666
Added QNX cleanups by Mike Gorchak (thanks!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
42 |
315
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
43 #define SDLPH_PAL_NONE 0x00000000L |
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
44 #define SDLPH_PAL_EMULATE 0x00000001L |
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
45 #define SDLPH_PAL_SYSTEM 0x00000002L |
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
46 |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
47 typedef struct |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
48 { |
701
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
49 unsigned char* Y; |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
50 unsigned char* V; |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
51 unsigned char* U; |
571
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
52 } FRAMEDATA; |
0 | 53 |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
54 /* Mask values for SDL_ReallocFormat() */ |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
55 struct ColourMasks |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
56 { |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
57 Uint32 red; |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
58 Uint32 green; |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
59 Uint32 blue; |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
60 Uint32 alpha; |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
61 Uint32 bpp; |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
62 }; |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
63 |
0 | 64 /* Private display data */ |
65 struct SDL_PrivateVideoData { | |
66 PgDisplaySettings_t mode_settings; | |
315
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
67 PtWidget_t *Window; /* used to handle input events */ |
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
68 PhImage_t *image; /* used to display image */ |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
69 #ifdef HAVE_OPENGL |
315
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
70 PdOpenGLContext_t* OGLContext; /* OpenGL context */ |
701
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
71 Uint32 OGLFlags; /* OpenGL flags */ |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
72 Uint32 OGLBPP; /* OpenGL bpp */ |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
73 #endif /* HAVE_OPENGL */ |
571
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
74 PgColor_t savedpal[_Pg_MAX_PALETTE]; |
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
75 PgColor_t syspalph[_Pg_MAX_PALETTE]; |
0 | 76 |
692
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
77 struct |
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
78 { |
571
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
79 PdDirectContext_t* direct_context; |
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
80 PdOffscreenContext_t* offscreen_context; |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
81 PdOffscreenContext_t* offscreen_backcontext; |
571
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
82 PhDrawContext_t* oldDC; |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
83 uint8_t* dc_ptr; |
692
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
84 unsigned char* CurrentFrameData; |
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
85 unsigned char* FrameData0; |
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
86 unsigned char* FrameData1; |
701
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
87 Uint32 current; |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
88 Uint32 flags; |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
89 } ocimage; |
0 | 90 |
315
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
91 PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */ |
692
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
92 PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */ |
315
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
93 int old_video_mode; /* Stored mode before fullscreen switch */ |
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
94 int old_refresh_rate; /* Stored refresh rate befor fullscreen switch */ |
0 | 95 |
96 int mouse_relative; | |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
97 WMcursor* BlankCursor; |
0 | 98 |
701
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
99 Uint32 depth; /* current visual depth (not bpp) */ |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
100 Uint32 desktopbpp; /* bpp of desktop at the moment of start */ |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
101 Uint32 desktoppal; /* palette mode emulation or system */ |
0 | 102 |
103 int currently_fullscreen; | |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
104 int currently_hided; /* 1 - window hided (minimazed), 0 - normal */ |
0 | 105 |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
106 PhEvent_t* event; |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
107 SDL_Overlay* overlay; |
0 | 108 }; |
109 | |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
110 #define mode_settings (this->hidden->mode_settings) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
111 #define window (this->hidden->Window) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
112 #define SDL_Image (this->hidden->image) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
113 #define OCImage (this->hidden->ocimage) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
114 #define old_video_mode (this->hidden->old_video_mode) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
115 #define old_refresh_rate (this->hidden->old_refresh_rate) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
116 #define graphics_card_caps (this->hidden->graphics_card_caps) |
315
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
117 #define desktopbpp (this->hidden->desktopbpp) |
3333b6e68289
Date: Sat, 23 Mar 2002 13:53:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
309
diff
changeset
|
118 #define desktoppal (this->hidden->desktoppal) |
571
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
119 #define savedpal (this->hidden->savedpal) |
8e3ce997621c
Date: Thu, 16 Jan 2003 13:48:31 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
380
diff
changeset
|
120 #define syspalph (this->hidden->syspalph) |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
121 #define currently_fullscreen (this->hidden->currently_fullscreen) |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
122 #define currently_hided (this->hidden->currently_hided) |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
123 #define event (this->hidden->event) |
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
124 #define current_overlay (this->hidden->overlay) |
692
04dd6c6d7c30
Date: Fri, 15 Aug 2003 09:13:59 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
663
diff
changeset
|
125 #define desktop_mode (this->hidden->desktop_mode) |
309
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
126 #define mouse_relative (this->hidden->mouse_relative) |
2de77f7b7a28
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
127 #define SDL_BlankCursor (this->hidden->BlankCursor) |
0 | 128 |
701
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
129 #ifdef HAVE_OPENGL |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
130 #define oglctx (this->hidden->OGLContext) |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
131 #define oglflags (this->hidden->OGLFlags) |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
132 #define oglbpp (this->hidden->OGLBPP) |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
133 #endif /* HAVE_OPENGL */ |
aaf3b8af6616
Date: Sat, 30 Aug 2003 16:28:10 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
692
diff
changeset
|
134 |
663
8bedd6d61642
Date: Sat, 2 Aug 2003 16:22:51 +0300
Sam Lantinga <slouken@libsdl.org>
parents:
571
diff
changeset
|
135 #endif /* __SDL_PH_VIDEO_H__ */ |