Mercurial > sdl-ios-xcode
annotate src/video/directfb/SDL_DirectFB_video.c @ 3023:d72a0dd80e8b
DirectFB cleanups & simple window manager
- use SDL_getenv, not getenv ...
- no more support for 0.9.25 - not even mentioned any longer on directfb.org
- fix fullscreen issues
- add a simple window manager unless the directfb team comes up with a working wm.
The driver has support for a very, very basic window manager you may
want to use when runnning with "wm=default". Use
export SDL_DIRECTFB_WM=1
to enable basic window borders including icon support. In order to have the window title rendered,
you need to have the following font installed:
/usr/share/fonts/truetype/freefont/FreeSans.ttf
author | Couriersud <couriersud@arcor.de> |
---|---|
date | Sun, 11 Jan 2009 23:49:23 +0000 |
parents | 8cc00819c8d6 |
children | 62d4992e5a92 |
rev | line source |
---|---|
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
2859 | 3 Copyright (C) 1997-2009 Sam Lantinga |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
6 modify it under the terms 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:
1165
diff
changeset
|
7 License as published by the Free Software Foundation; either |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
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 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
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:
1165
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:
1165
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:
1165
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 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
19 Sam Lantinga |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1165
diff
changeset
|
20 slouken@libsdl.org |
728
5446a009107a
MGA CRTC2 support for DirectFB target contributed by Thomas Jarosch.
Ryan C. Gordon <icculus@icculus.org>
parents:
546
diff
changeset
|
21 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
22 SDL1.3 implementation by couriersud@arcor.de |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
23 |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 */ |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
25 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
26 |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1361
diff
changeset
|
27 #include "SDL_config.h" |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 /* DirectFB video driver implementation. |
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 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
32 #include <fcntl.h> |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 #include <unistd.h> |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 #include <sys/mman.h> |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
35 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
36 #include <directfb.h> |
1165
4fa705cdecb9
Date: Tue, 1 Nov 2005 02:51:09 +0000
Ryan C. Gordon <icculus@icculus.org>
parents:
1029
diff
changeset
|
37 #include <directfb_version.h> |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
38 #include <directfb_strings.h> |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
39 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 #include "SDL_video.h" |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
41 #include "SDL_mouse.h" |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
42 #include "../SDL_sysvideo.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
43 #include "../SDL_pixels_c.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1358
diff
changeset
|
44 #include "../../events/SDL_events_c.h" |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
45 #include "SDL_DirectFB_video.h" |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
46 #include "SDL_DirectFB_events.h" |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
47 #include "SDL_DirectFB_render.h" |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
48 #include "SDL_DirectFB_mouse.h" |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
49 |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
50 #include "SDL_DirectFB_dyn.h" |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
51 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
52 /* Initialization/Query functions */ |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
53 static int DirectFB_VideoInit(_THIS); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
54 static void DirectFB_VideoQuit(_THIS); |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
55 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
56 static int DirectFB_Available(void); |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
57 static SDL_VideoDevice *DirectFB_CreateDevice(int devindex); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
58 |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
59 #if 0 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
60 static int DirectFB_SetDisplayGammaRamp(_THIS, Uint16 * ramp); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
61 static int DirectFB_GetDisplayGammaRamp(_THIS, Uint16 * ramp); |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
62 #endif |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
63 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
64 VideoBootStrap DirectFB_bootstrap = { |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
65 "directfb", "DirectFB", |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
66 DirectFB_Available, DirectFB_CreateDevice |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
67 }; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 /* DirectFB driver bootstrap functions */ |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
70 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
71 static int |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
72 DirectFB_Available(void) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
73 { |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
74 if (!SDL_DirectFB_LoadLibrary()) |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
75 return 0; |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
76 SDL_DirectFB_UnLoadLibrary(); |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
77 return 1; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
78 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
79 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
80 static void |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
81 DirectFB_DeleteDevice(SDL_VideoDevice * device) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 { |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
83 SDL_DirectFB_UnLoadLibrary(); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
84 SDL_DFB_FREE(device->driverdata); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
85 SDL_DFB_FREE(device); |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
86 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
87 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
88 static SDL_VideoDevice * |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
89 DirectFB_CreateDevice(int devindex) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
91 SDL_VideoDevice *device; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
93 if (!SDL_DirectFB_LoadLibrary()) |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
94 return NULL; |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
95 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
96 /* Initialize all variables that we clean on shutdown */ |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
97 SDL_DFB_CALLOC(device, 1, sizeof(SDL_VideoDevice)); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
98 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
99 /* Set the function pointers */ |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
100 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
101 /* Set the function pointers */ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
102 device->VideoInit = DirectFB_VideoInit; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
103 device->VideoQuit = DirectFB_VideoQuit; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
104 device->GetDisplayModes = DirectFB_GetDisplayModes; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
105 device->SetDisplayMode = DirectFB_SetDisplayMode; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
106 #if 0 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
107 device->SetDisplayGammaRamp = DirectFB_SetDisplayGammaRamp; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
108 device->GetDisplayGammaRamp = DirectFB_GetDisplayGammaRamp; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
109 #else |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
110 device->SetDisplayGammaRamp = NULL; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
111 device->GetDisplayGammaRamp = NULL; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
112 #endif |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
113 device->PumpEvents = DirectFB_PumpEventsWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
114 device->CreateWindow = DirectFB_CreateWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
115 device->CreateWindowFrom = DirectFB_CreateWindowFrom; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
116 device->SetWindowTitle = DirectFB_SetWindowTitle; |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
117 device->SetWindowIcon = DirectFB_SetWindowIcon; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
118 device->SetWindowPosition = DirectFB_SetWindowPosition; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
119 device->SetWindowSize = DirectFB_SetWindowSize; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
120 device->ShowWindow = DirectFB_ShowWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
121 device->HideWindow = DirectFB_HideWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
122 device->RaiseWindow = DirectFB_RaiseWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
123 device->MaximizeWindow = DirectFB_MaximizeWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
124 device->MinimizeWindow = DirectFB_MinimizeWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
125 device->RestoreWindow = DirectFB_RestoreWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
126 device->SetWindowGrab = DirectFB_SetWindowGrab; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
127 device->DestroyWindow = DirectFB_DestroyWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
128 device->GetWindowWMInfo = DirectFB_GetWindowWMInfo; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
129 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
130 #if SDL_DIRECTFB_OPENGL |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
131 device->GL_LoadLibrary = DirectFB_GL_LoadLibrary; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
132 device->GL_GetProcAddress = DirectFB_GL_GetProcAddress; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
133 device->GL_MakeCurrent = DirectFB_GL_MakeCurrent; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
134 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
135 device->GL_CreateContext = DirectFB_GL_CreateContext; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
136 device->GL_SetSwapInterval = DirectFB_GL_SetSwapInterval; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
137 device->GL_GetSwapInterval = DirectFB_GL_GetSwapInterval; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
138 device->GL_SwapWindow = DirectFB_GL_SwapWindow; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
139 device->GL_DeleteContext = DirectFB_GL_DeleteContext; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
140 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
141 #endif |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
142 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
143 device->free = DirectFB_DeleteDevice; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
144 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
145 return device; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
146 error: |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
147 if (device) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
148 free(device); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
149 return (0); |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
150 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
151 |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
152 static const DirectFBSurfaceDrawingFlagsNames(drawing_flags); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
153 static const DirectFBSurfaceBlittingFlagsNames(blitting_flags); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
154 static const DirectFBAccelerationMaskNames(acceleration_mask); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
155 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
156 static void |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
157 DirectFB_DeviceInformation(IDirectFB * dfb) |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
158 { |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
159 DFBGraphicsDeviceDescription desc; |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
160 int n; |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
161 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
162 dfb->GetDeviceDescription(dfb, &desc); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
163 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
164 fprintf(LOG_CHANNEL, "DirectFB Device Information\n"); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
165 fprintf(LOG_CHANNEL, "===========================\n"); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
166 fprintf(LOG_CHANNEL, "Name: %s\n", desc.name); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
167 fprintf(LOG_CHANNEL, "Vendor: %s\n", desc.vendor); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
168 fprintf(LOG_CHANNEL, "Driver Name: %s\n", desc.driver.name); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
169 fprintf(LOG_CHANNEL, "Driver Vendor: %s\n", desc.driver.vendor); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
170 fprintf(LOG_CHANNEL, "Driver Version: %d.%d\n", desc.driver.major, |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
171 desc.driver.minor); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
172 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
173 fprintf(LOG_CHANNEL, "\nVideo memoory: %d\n", desc.video_memory); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
174 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
175 fprintf(LOG_CHANNEL, "\nBlitting flags:\n"); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
176 for (n = 0; blitting_flags[n].flag; n++) { |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
177 if (desc.blitting_flags & blitting_flags[n].flag) |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
178 printf(" %s\n", blitting_flags[n].name); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
179 } |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
180 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
181 fprintf(LOG_CHANNEL, "\nDrawing flags:\n"); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
182 for (n = 0; drawing_flags[n].flag; n++) { |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
183 if (desc.drawing_flags & drawing_flags[n].flag) |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
184 printf(" %s\n", drawing_flags[n].name); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
185 } |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
186 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
187 fprintf(LOG_CHANNEL, "\nAcceleration flags:\n"); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
188 for (n = 0; acceleration_mask[n].mask; n++) { |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
189 if (desc.acceleration_mask & acceleration_mask[n].mask) |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
190 printf(" %s\n", acceleration_mask[n].name); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
191 } |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
192 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
193 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
194 } |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
195 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
196 static int |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
197 DirectFB_VideoInit(_THIS) |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
198 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
199 IDirectFB *dfb = NULL; |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
200 DFB_DeviceData *devdata = NULL; |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
201 char *stemp; |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
202 DFBResult ret; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
203 |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
204 SDL_DFB_CALLOC(devdata, 1, sizeof(*devdata)); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
205 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
206 SDL_DFB_CHECKERR(DirectFBInit(NULL, NULL)); |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
207 |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
208 /* avoid switching to the framebuffer when we |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
209 * are running X11 */ |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
210 stemp = SDL_getenv(DFBENV_USE_X11_CHECK); |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
211 if (stemp) |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
212 ret = atoi(stemp); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
213 else |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
214 ret = 1; |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
215 |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
216 if (ret) { |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
217 if (SDL_getenv("DISPLAY")) |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
218 DirectFBSetOption("system", "x11"); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
219 else |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
220 DirectFBSetOption("disable-module", "x11input"); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
221 } |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
222 |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
223 devdata->use_linux_input = 1; /* default: on */ |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
224 stemp = SDL_getenv(DFBENV_USE_LINUX_INPUT); |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
225 if (stemp) |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
226 devdata->use_linux_input = atoi(stemp); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
227 |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
228 if (!devdata->use_linux_input) |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
229 DirectFBSetOption("disable-module", "linux_input"); |
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
230 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
231 SDL_DFB_CHECKERR(DirectFBCreate(&dfb)); |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
232 |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
233 DirectFB_DeviceInformation(dfb); |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
234 devdata->use_yuv_underlays = 0; /* default: off */ |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
235 stemp = SDL_getenv(DFBENV_USE_YUV_UNDERLAY); |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
236 if (stemp) |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
237 devdata->use_yuv_underlays = atoi(stemp); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
238 |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
239 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
240 /* Create global Eventbuffer for axis events */ |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
241 if (devdata->use_linux_input) { |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
242 SDL_DFB_CHECKERR(dfb->CreateInputEventBuffer(dfb, DICAPS_ALL, |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
243 DFB_TRUE, |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
244 &devdata->events)); |
2860
6ce28e5287e9
Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
245 } else { |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
246 SDL_DFB_CHECKERR(dfb->CreateInputEventBuffer(dfb, DICAPS_AXES |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
247 /*DICAPS_ALL */ , |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
248 DFB_TRUE, |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
249 &devdata->events)); |
2860
6ce28e5287e9
Date: Sun, 07 Dec 2008 13:35:23 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
250 } |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
251 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
252 devdata->initialized = 1; |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
253 |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
254 /* simple window manager support */ |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
255 stemp = SDL_getenv(DFBENV_USE_WM); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
256 if (stemp) |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
257 devdata->has_own_wm = atoi(stemp); |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
258 else |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
259 devdata->has_own_wm = 0; |
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
260 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
261 devdata->dfb = dfb; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
262 devdata->firstwin = NULL; |
464
1c4be4a16410
Date: Fri, 23 Aug 2002 11:48:56 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
263 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
264 _this->driverdata = devdata; |
464
1c4be4a16410
Date: Fri, 23 Aug 2002 11:48:56 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
265 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
266 DirectFB_InitModes(_this); |
464
1c4be4a16410
Date: Fri, 23 Aug 2002 11:48:56 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
267 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
268 #if SDL_DIRECTFB_OPENGL |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
269 DirectFB_GL_Initialize(_this); |
1165
4fa705cdecb9
Date: Tue, 1 Nov 2005 02:51:09 +0000
Ryan C. Gordon <icculus@icculus.org>
parents:
1029
diff
changeset
|
270 #endif |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
271 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
272 DirectFB_AddRenderDriver(_this); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
273 DirectFB_InitMouse(_this); |
2721
e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2259
diff
changeset
|
274 DirectFB_InitKeyboard(_this); |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
275 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
276 return 0; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
277 |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
278 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
279 error: |
2998
d364ee9b9c15
Date: Sun, 04 Jan 2009 20:53:30 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2860
diff
changeset
|
280 SDL_DFB_FREE(devdata); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
281 SDL_DFB_RELEASE(dfb); |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
282 return -1; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
283 } |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
284 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
285 static void |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
286 DirectFB_VideoQuit(_THIS) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
287 { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
288 DFB_DeviceData *devdata = (DFB_DeviceData *) _this->driverdata; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
289 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
290 DirectFB_QuitModes(_this); |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
291 DirectFB_QuitKeyboard(_this); |
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
292 DirectFB_QuitMouse(_this); |
728
5446a009107a
MGA CRTC2 support for DirectFB target contributed by Thomas Jarosch.
Ryan C. Gordon <icculus@icculus.org>
parents:
546
diff
changeset
|
293 |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
294 SDL_DFB_RELEASE(devdata->events); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
295 SDL_DFB_RELEASE(devdata->dfb); |
728
5446a009107a
MGA CRTC2 support for DirectFB target contributed by Thomas Jarosch.
Ryan C. Gordon <icculus@icculus.org>
parents:
546
diff
changeset
|
296 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
297 #if SDL_DIRECTFB_OPENGL |
2737
140a7edcf2bd
Date: Sun, 31 Aug 2008 17:53:59 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2735
diff
changeset
|
298 DirectFB_GL_Shutdown(_this); |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
299 #endif |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
300 |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
301 devdata->initialized = 0; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
302 } |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
303 |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
304 #if 0 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
305 static int |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
306 DirectFB_SetDisplayGammaRamp(_THIS, Uint16 * ramp) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
307 { |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1777
diff
changeset
|
308 return -1; |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
309 } |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
310 |
2226
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
311 static int |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
312 DirectFB_GetDisplayGammaRamp(_THIS, Uint16 * ramp) |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
313 { |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
314 return -1; |
0e70b4b8cf84
Date: Sat, 11 Aug 2007 02:03:16 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents:
2113
diff
changeset
|
315 } |
3023
d72a0dd80e8b
DirectFB cleanups & simple window manager
Couriersud <couriersud@arcor.de>
parents:
3013
diff
changeset
|
316 #endif |