Mercurial > sdl-ios-xcode
annotate src/video/directfb/SDL_DirectFB_video.h @ 5284:96a22141cf86 tip
Changed output directory of Universal libSDL.a for iOS to respect build configurations. Template generator was updated to reflect these changes as well.
author | Eric Wing <ewing . public |-at-| gmail . com> |
---|---|
date | Sat, 12 Feb 2011 21:52:30 -0800 |
parents | b530ef003506 |
children |
rev | line source |
---|---|
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
5267 | 3 Copyright (C) 1997-2011 Sam Lantinga |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
13 Lesser General Public License for more details. |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
167
diff
changeset
|
20 slouken@libsdl.org |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
21 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
22 SDL1.3 DirectFB driver by couriersud@arcor.de |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
23 |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 */ |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
25 |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1361
diff
changeset
|
26 #include "SDL_config.h" |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 #ifndef _SDL_DirectFB_video_h |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 #define _SDL_DirectFB_video_h |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
30 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
31 #include <directfb.h> |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
32 #include <directfb_version.h> |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
33 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
34 #include "../SDL_sysvideo.h" |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
35 #include "SDL_scancode.h" |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
36 #include "SDL_render.h" |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
37 |
3037
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
38 #define DFB_VERSIONNUM(X, Y, Z) \ |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
39 ((X)*1000 + (Y)*100 + (Z)) |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
40 |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
41 #define DFB_COMPILEDVERSION \ |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
42 DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION) |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
43 |
3037
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
44 #define DFB_VERSION_ATLEAST(X, Y, Z) \ |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
45 (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z)) |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
46 |
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
47 #if (DFB_VERSION_ATLEAST(1,0,0)) |
3040 | 48 #define SDL_DIRECTFB_OPENGL 1 |
3037
490f3e4fe753
Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents:
3023
diff
changeset
|
49 #else |
3040 | 50 #error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0" |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
51 #endif |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
52 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
53 /* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
54 * in case we see this again ... |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
55 */ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
56 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
57 #define USE_MULTI_API (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
58 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
59 /* Support for LUT8/INDEX8 pixel format. |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
60 * This is broken in DirectFB 1.4.3. It works in 1.4.0 and 1.4.5 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
61 * occurred. |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
62 */ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
63 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
64 #if (DFB_COMPILEDVERSION == DFB_VERSIONNUM(1, 4, 3)) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
65 #define ENABLE_LUT8 (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
66 #else |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
67 #define ENABLE_LUT8 (1) |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
68 #endif |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
70 #define DIRECTFB_DEBUG 1 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
71 #define LOG_CHANNEL stdout |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
73 #define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY" /* Default: off */ |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
74 #define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT" /* Default: off */ |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
75 #define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK" /* Default: on */ |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
76 #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ |
3040 | 77 #define DFBENV_USE_WM "SDL_DIRECTFB_WM" /* Default: off */ |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
78 |
4636 | 79 #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0) |
3038
c73a5f8a03d2
Fixed MakeSubSurface compiling issue for DirectFB <= 1.2.0
Couriersud <couriersud@arcor.de>
parents:
3037
diff
changeset
|
80 #define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0) |
c73a5f8a03d2
Fixed MakeSubSurface compiling issue for DirectFB <= 1.2.0
Couriersud <couriersud@arcor.de>
parents:
3037
diff
changeset
|
81 #define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0) |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
82 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
83 #define SDL_DFB_CONTEXT "SDL_DirectFB" |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
84 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
85 #define SDL_DFB_ERR(x...) \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
86 do { \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
87 fprintf(LOG_CHANNEL, "%s: %s <%d>:\n\t", \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
88 SDL_DFB_CONTEXT, __FILE__, __LINE__ ); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
89 fprintf(LOG_CHANNEL, x ); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
90 } while (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
91 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
92 #if (DIRECTFB_DEBUG) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
93 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
94 #define SDL_DFB_LOG(x...) \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
95 do { \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
96 fprintf(LOG_CHANNEL, SDL_DFB_CONTEXT); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
97 fprintf(LOG_CHANNEL, x ); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
98 fprintf(LOG_CHANNEL, "\n"); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
99 } while (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
100 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
101 #define SDL_DFB_DEBUG(x...) SDL_DFB_ERR( x ) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
102 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
103 static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line) { |
4636 | 104 if (ret != DFB_OK) { |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
105 SDL_DFB_LOG("%s (%d):%s", src_file, src_line, DirectFBErrorString (ret) ); |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
106 SDL_SetError("%s:%s", SDL_DFB_CONTEXT, DirectFBErrorString (ret) ); |
4636 | 107 } |
108 return ret; | |
109 } | |
110 | |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
111 #define SDL_DFB_CHECK(x...) do { sdl_dfb_check( x, __FILE__, __LINE__); } while (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
112 #define SDL_DFB_CHECKERR(x...) do { if ( sdl_dfb_check( x, __FILE__, __LINE__) != DFB_OK ) goto error; } while (0) |
4636 | 113 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
114 #else |
4636 | 115 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
116 #define SDL_DFB_CHECK(x...) x |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
117 #define SDL_DFB_CHECKERR(x...) do { if (x != DFB_OK ) goto error; } while (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
118 #define SDL_DFB_LOG(x...) do {} while (0) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
119 #define SDL_DFB_DEBUG(x...) do {} while (0) |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
120 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
121 #endif |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
122 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
123 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
124 #define SDL_DFB_CALLOC(r, n, s) \ |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
125 do { \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
126 r = SDL_calloc (n, s); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
127 if (!(r)) { \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
128 SDL_DFB_ERR("Out of memory"); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
129 SDL_OutOfMemory(); \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
130 goto error; \ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
131 } \ |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
132 } while (0) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
133 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
134 #define SDL_DFB_ALLOC_CLEAR(r, s) SDL_DFB_CALLOC(r, 1, s) |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
135 |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
136 /* Private display data */ |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
137 |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
2998
diff
changeset
|
138 #define SDL_DFB_DEVICEDATA(dev) DFB_DeviceData *devdata = (dev ? (DFB_DeviceData *) ((dev)->driverdata) : NULL) |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
139 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
140 #define DFB_MAX_SCREENS 10 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
141 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
142 typedef struct _DFB_KeyboardData DFB_KeyboardData; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
143 struct _DFB_KeyboardData |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
144 { |
5223
572a73d71b5f
Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents:
5202
diff
changeset
|
145 const SDL_Scancode *map; /* keyboard scancode map */ |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
146 int map_size; /* size of map */ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
147 int map_adjust; /* index adjust */ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
148 int is_generic; /* generic keyboard */ |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
149 int id; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
150 }; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
151 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
152 typedef struct _DFB_DeviceData DFB_DeviceData; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
153 struct _DFB_DeviceData |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
154 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
155 int initialized; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
156 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
157 IDirectFB *dfb; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
158 int num_mice; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
159 int mouse_id[0x100]; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
160 int num_keyboard; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
161 DFB_KeyboardData keyboard[10]; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
162 SDL_Window *firstwin; |
728
5446a009107a
MGA CRTC2 support for DirectFB target contributed by Thomas Jarosch.
Ryan C. Gordon <icculus@icculus.org>
parents:
478
diff
changeset
|
163 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
164 int use_yuv_underlays; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
165 int use_yuv_direct; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
166 int use_linux_input; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
167 int has_own_wm; |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
168 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
169 |
4636 | 170 /* window grab */ |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
171 SDL_Window *grabbed_window; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
172 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
173 /* global events */ |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2721
diff
changeset
|
174 IDirectFBEventBuffer *events; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
175 }; |
478
f8482d7c9595
Date: Tue, 27 Aug 2002 19:07:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
464
diff
changeset
|
176 |
5202
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
177 Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat); |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
178 DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format); |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
179 void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo *ri); |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
180 |
164f20ba08eb
Updated the DirectFB support, from Couriersud
Sam Lantinga <slouken@libsdl.org>
parents:
4636
diff
changeset
|
181 |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
182 #endif /* _SDL_DirectFB_video_h */ |