Mercurial > sdl-ios-xcode
comparison src/video/directfb/SDL_DirectFB_video.h @ 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 | d364ee9b9c15 |
children | 490f3e4fe753 |
comparison
equal
deleted
inserted
replaced
3022:db20dde98dd3 | 3023:d72a0dd80e8b |
---|---|
32 #include "SDL_mouse.h" | 32 #include "SDL_mouse.h" |
33 | 33 |
34 #define DEBUG 0 | 34 #define DEBUG 0 |
35 #define LOG_CHANNEL stdout | 35 #define LOG_CHANNEL stdout |
36 | 36 |
37 #if (DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23) | 37 #if (DIRECTFB_MAJOR_VERSION < 1) |
38 #error "SDL_DIRECTFB: Please compile against libdirectfb version >=0.9.24" | 38 #error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0" |
39 #endif | 39 #endif |
40 | 40 |
41 #if (DIRECTFB_MAJOR_VERSION >= 1) && (DIRECTFB_MINOR_VERSION >= 0) && (DIRECTFB_MICRO_VERSION >= 0 ) | 41 #if (DIRECTFB_MAJOR_VERSION >= 1) && (DIRECTFB_MINOR_VERSION >= 0) && (DIRECTFB_MICRO_VERSION >= 0 ) |
42 #define SDL_DIRECTFB_OPENGL 1 | 42 #define SDL_DIRECTFB_OPENGL 1 |
43 #include <directfbgl.h> | 43 #include <directfbgl.h> |
54 */ | 54 */ |
55 #include "SDL_DirectFB_modes.h" | 55 #include "SDL_DirectFB_modes.h" |
56 #include "SDL_DirectFB_mouse.h" | 56 #include "SDL_DirectFB_mouse.h" |
57 #include "SDL_DirectFB_opengl.h" | 57 #include "SDL_DirectFB_opengl.h" |
58 #include "SDL_DirectFB_window.h" | 58 #include "SDL_DirectFB_window.h" |
59 #include "SDL_DirectFB_WM.h" | |
59 | 60 |
60 #define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY" /* Default: off */ | 61 #define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY" /* Default: off */ |
61 #define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT" /* Default: off */ | 62 #define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT" /* Default: off */ |
62 #define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK" /* Default: on */ | 63 #define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK" /* Default: on */ |
63 #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ | 64 #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ |
65 #define DFBENV_USE_WM "SDL_DIRECTFB_WM" /* Default: off */ | |
64 | 66 |
65 #define SDL_DFB_RELEASE(x) do { if ( x ) { x->Release(x); x = NULL; } } while (0) | 67 #define SDL_DFB_RELEASE(x) do { if ( x ) { x->Release(x); x = NULL; } } while (0) |
66 #define SDL_DFB_FREE(x) do { if ( x ) { SDL_free(x); x = NULL; } } while (0) | 68 #define SDL_DFB_FREE(x) do { if ( x ) { SDL_free(x); x = NULL; } } while (0) |
67 #define SDL_DFB_UNLOCK(x) do { if ( x ) { x->Unlock(x); } } while (0) | 69 #define SDL_DFB_UNLOCK(x) do { if ( x ) { x->Unlock(x); } } while (0) |
68 | 70 |
86 #define SDL_DFB_CHECK(x...) \ | 88 #define SDL_DFB_CHECK(x...) \ |
87 do { \ | 89 do { \ |
88 ret = x; \ | 90 ret = x; \ |
89 if (ret != DFB_OK) { \ | 91 if (ret != DFB_OK) { \ |
90 fprintf(LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ | 92 fprintf(LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ |
93 fprintf(LOG_CHANNEL, "\t%s\n", #x ); \ | |
94 fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \ | |
91 SDL_SetError( #x, DirectFBErrorString (ret) ); \ | 95 SDL_SetError( #x, DirectFBErrorString (ret) ); \ |
92 } \ | 96 } \ |
93 } while (0) | 97 } while (0) |
94 | 98 |
95 #define SDL_DFB_CHECKERR(x...) \ | 99 #define SDL_DFB_CHECKERR(x...) \ |
114 } \ | 118 } \ |
115 } while (0) | 119 } while (0) |
116 | 120 |
117 /* Private display data */ | 121 /* Private display data */ |
118 | 122 |
119 #define SDL_DFB_DEVICEDATA(dev) DFB_DeviceData *devdata = (DFB_DeviceData *) ((dev)->driverdata) | 123 #define SDL_DFB_DEVICEDATA(dev) DFB_DeviceData *devdata = (dev ? (DFB_DeviceData *) ((dev)->driverdata) : NULL) |
120 | 124 |
121 #define DFB_MAX_SCREENS 10 | 125 #define DFB_MAX_SCREENS 10 |
122 | 126 |
123 typedef struct _DFB_DeviceData DFB_DeviceData; | 127 typedef struct _DFB_DeviceData DFB_DeviceData; |
124 struct _DFB_DeviceData | 128 struct _DFB_DeviceData |
136 } keyboard[10]; | 140 } keyboard[10]; |
137 DFB_WindowData *firstwin; | 141 DFB_WindowData *firstwin; |
138 | 142 |
139 int use_yuv_underlays; | 143 int use_yuv_underlays; |
140 int use_linux_input; | 144 int use_linux_input; |
145 int has_own_wm; | |
141 | 146 |
142 /* OpenGL */ | 147 /* OpenGL */ |
143 void (*glFinish) (void); | 148 void (*glFinish) (void); |
144 void (*glFlush) (void); | 149 void (*glFlush) (void); |
145 | 150 |