annotate src/video/directfb/SDL_DirectFB_video.h @ 4568:25b9cd8bdc30

Couriersud to Sam I have done some quick changes and at least the code compiles again. It also works with a number of the test executables with the DFB X11 backend. I hope to find time to get SDLMAME to work with latest SDL1.3 (i.e. rip out multi-keyboard, multi-mice & cursor support) next week to test it further. Regards, André
author Sam Lantinga <slouken@libsdl.org>
date Fri, 23 Jul 2010 21:33:00 -0700
parents f7b03b6838cb
children b196d2758026
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
3697
f7b03b6838cb Fixed bug #926
Sam Lantinga <slouken@libsdl.org>
parents: 3040
diff changeset
3 Copyright (C) 1997-2010 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
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 */
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
22 #include "SDL_config.h"
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 #ifndef _SDL_DirectFB_video_h
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 #define _SDL_DirectFB_video_h
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26
2737
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
27 #include "../SDL_sysvideo.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
28
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 #include <directfb.h>
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
30 #include <directfb_version.h>
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
31
2737
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
32 #include "SDL_mouse.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
33
4568
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
34
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
35 /* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
36 * in case we see this again ...
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
37 */
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
38
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
39 #define USE_MULTI_API (0)
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
40
25b9cd8bdc30 Couriersud to Sam
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
41 #define DEBUG 1
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
42 #define LOG_CHANNEL stdout
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_VERSIONNUM(X, Y, Z) \
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
45 ((X)*1000 + (Y)*100 + (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 #define DFB_COMPILEDVERSION \
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
48 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
49
3037
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
50 #define DFB_VERSION_ATLEAST(X, Y, Z) \
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
51 (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
52
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
53 #if (DFB_VERSION_ATLEAST(1,0,0))
3040
Sam Lantinga <slouken@libsdl.org>
parents: 3038
diff changeset
54 #define SDL_DIRECTFB_OPENGL 1
Sam Lantinga <slouken@libsdl.org>
parents: 3038
diff changeset
55 #include <directfbgl.h>
3037
490f3e4fe753 Added DFB_VERSION_ATLEAST macro
Couriersud <couriersud@arcor.de>
parents: 3023
diff changeset
56 #else
3040
Sam Lantinga <slouken@libsdl.org>
parents: 3038
diff changeset
57 #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
58 #endif
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
59
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
60 #if SDL_DIRECTFB_OPENGL
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
61 #include "SDL_loadso.h"
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
62 #endif
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63
2737
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
64 #include "SDL_DirectFB_events.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
65 /*
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
66 * #include "SDL_DirectFB_gamma.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
67 * #include "SDL_DirectFB_keyboard.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
68 */
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
69 #include "SDL_DirectFB_modes.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
70 #include "SDL_DirectFB_mouse.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
71 #include "SDL_DirectFB_opengl.h"
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
72 #include "SDL_DirectFB_window.h"
3023
d72a0dd80e8b DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents: 2998
diff changeset
73 #include "SDL_DirectFB_WM.h"
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74
2998
d364ee9b9c15 Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2860
diff changeset
75 #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
76 #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
77 #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
78 #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */
3040
Sam Lantinga <slouken@libsdl.org>
parents: 3038
diff changeset
79 #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
80
3038
c73a5f8a03d2 Fixed MakeSubSurface compiling issue for DirectFB <= 1.2.0
Couriersud <couriersud@arcor.de>
parents: 3037
diff changeset
81 #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { x->Release(x); x = NULL; } } while (0)
c73a5f8a03d2 Fixed MakeSubSurface compiling issue for DirectFB <= 1.2.0
Couriersud <couriersud@arcor.de>
parents: 3037
diff changeset
82 #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
83 #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
84
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
85 #if DEBUG
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
86 #define SDL_DFB_DEBUG(x...) do { fprintf(LOG_CHANNEL, "%s:", __FUNCTION__); fprintf(LOG_CHANNEL, x); } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
87 #define SDL_DFB_DEBUGC(x...) do { fprintf(LOG_CHANNEL, x); } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
88 #else
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
89 #define SDL_DFB_DEBUG(x...) do { } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
90 #define SDL_DFB_DEBUGC(x...) do { } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
91 #endif
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
92
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
93 #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
94
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
95 #define SDL_DFB_ERR(x...) \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
96 do { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
97 fprintf(LOG_CHANNEL, "%s: %s <%d>:\n\t", \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
98 SDL_DFB_CONTEXT, __FILE__, __LINE__ ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
99 fprintf(LOG_CHANNEL, x ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
100 } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
101
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
102 #define SDL_DFB_CHECK(x...) \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
103 do { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
104 ret = x; \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
105 if (ret != DFB_OK) { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
106 fprintf(LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
3023
d72a0dd80e8b DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents: 2998
diff changeset
107 fprintf(LOG_CHANNEL, "\t%s\n", #x ); \
d72a0dd80e8b DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents: 2998
diff changeset
108 fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
109 SDL_SetError( #x, DirectFBErrorString (ret) ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
110 } \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
111 } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
112
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
113 #define SDL_DFB_CHECKERR(x...) \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
114 do { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
115 ret = x; \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
116 if (ret != DFB_OK) { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
117 fprintf(LOG_CHANNEL, "%s <%d>:\n", __FILE__, __LINE__ ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
118 fprintf(LOG_CHANNEL, "\t%s\n", #x ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
119 fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
120 SDL_SetError( #x, DirectFBErrorString (ret) ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
121 goto error; \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
122 } \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
123 } while (0)
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
124
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
125 #define SDL_DFB_CALLOC(r, n, s) \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
126 do { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
127 r = SDL_calloc (n, s); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
128 if (!(r)) { \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
129 fprintf( LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
130 SDL_OutOfMemory(); \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
131 goto error; \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
132 } \
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
133 } while (0)
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
134
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
135 /* Private display data */
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
136
3023
d72a0dd80e8b DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents: 2998
diff changeset
137 #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
138
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
139 #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
140
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
141 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
142 struct _DFB_DeviceData
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
143 {
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
144 int initialized;
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
145
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
146 IDirectFB *dfb;
2860
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
147 int num_mice;
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
148 int mouse_id[0x100];
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
149 int num_keyboard;
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
150 struct
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
151 {
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
152 int is_generic;
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
153 int id;
6ce28e5287e9 Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
154 } keyboard[10];
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
155 DFB_WindowData *firstwin;
728
5446a009107a MGA CRTC2 support for DirectFB target contributed by Thomas Jarosch.
Ryan C. Gordon <icculus@icculus.org>
parents: 478
diff changeset
156
2737
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
157 int use_yuv_underlays;
2998
d364ee9b9c15 Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents: 2860
diff changeset
158 int use_linux_input;
3023
d72a0dd80e8b DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents: 2998
diff changeset
159 int has_own_wm;
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
160
2721
e82a0e3e9b0e Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2226
diff changeset
161 /* OpenGL */
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
162 void (*glFinish) (void);
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
163 void (*glFlush) (void);
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
164
2737
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
165 /* global events */
140a7edcf2bd Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 2721
diff changeset
166 IDirectFBEventBuffer *events;
2226
0e70b4b8cf84 Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
167 };
478
f8482d7c9595 Date: Tue, 27 Aug 2002 19:07:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents: 464
diff changeset
168
167
cb384ef627f6 Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
169 #endif /* _SDL_DirectFB_video_h */