21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_DIRECTFB
42 #include <directfb_version.h>
43 #include <directfb_strings.h>
47 #include "../SDL_sysvideo.h"
48 #include "../SDL_pixels_c.h"
49 #include "../../events/SDL_events_c.h"
60 static int DirectFB_VideoInit(
_THIS);
61 static void DirectFB_VideoQuit(
_THIS);
63 static int DirectFB_Available(
void);
67 "directfb",
"DirectFB",
68 DirectFB_Available, DirectFB_CreateDevice
71 static const DirectFBSurfaceDrawingFlagsNames(drawing_flags);
72 static const DirectFBSurfaceBlittingFlagsNames(blitting_flags);
73 static const DirectFBAccelerationMaskNames(acceleration_mask);
78 DirectFB_Available(
void)
95 DirectFB_CreateDevice(
int devindex)
131 #if SDL_DIRECTFB_OPENGL
149 device->
free = DirectFB_DeleteDevice;
159 DirectFB_DeviceInformation(IDirectFB * dfb)
161 DFBGraphicsDeviceDescription desc;
164 dfb->GetDeviceDescription(dfb, &desc);
171 SDL_DFB_LOG(
"Driver Vendor: %s", desc.driver.vendor);
172 SDL_DFB_LOG(
"Driver Version: %d.%d", desc.driver.major,
175 SDL_DFB_LOG(
"Video memory: %d", desc.video_memory);
178 for (n = 0; blitting_flags[
n].flag; n++) {
179 if (desc.blitting_flags & blitting_flags[n].flag)
184 for (n = 0; drawing_flags[
n].flag; n++) {
185 if (desc.drawing_flags & drawing_flags[n].flag)
191 for (n = 0; acceleration_mask[
n].mask; n++) {
192 if (desc.acceleration_mask & acceleration_mask[n].mask)
199 static int readBoolEnv(
const char *env_name,
int def_val)
211 DirectFB_VideoInit(
_THIS)
213 IDirectFB *dfb =
NULL;
214 DFB_DeviceData *devdata =
NULL;
226 DirectFBSetOption(
"system",
"x11");
228 DirectFBSetOption(
"disable-module",
"x11input");
233 if (!devdata->use_linux_input)
236 DirectFBSetOption(
"disable-module",
"linux_input");
241 DirectFB_DeviceInformation(dfb);
247 if (devdata->use_linux_input) {
261 devdata->initialized = 1;
264 devdata->firstwin =
NULL;
265 devdata->grabbed_window =
NULL;
271 #if SDL_DIRECTFB_OPENGL
272 DirectFB_GL_Initialize(
_this);
288 DirectFB_VideoQuit(
_THIS)
296 devdata->events->Reset(devdata->events);
300 #if SDL_DIRECTFB_OPENGL
301 DirectFB_GL_Shutdown(
_this);
304 devdata->initialized = 0;
309 static const struct {
310 DFBSurfacePixelFormat dfb;
312 } pixelformat_tab[] =
332 #if (DFB_VERSION_ATLEAST(1,2,0))
355 #if (DFB_VERSION_ATLEAST(1,3,0))
359 #if (DFB_VERSION_ATLEAST(1,4,3))
387 for (i=0; pixelformat_tab[
i].dfb != DSPF_UNKNOWN; i++)
388 if (pixelformat_tab[i].dfb == pixelformat)
390 return pixelformat_tab[
i].sdl;
395 DFBSurfacePixelFormat
400 for (i=0; pixelformat_tab[
i].dfb != DSPF_UNKNOWN; i++)
401 if (pixelformat_tab[i].sdl == format)
403 return pixelformat_tab[
i].dfb;
412 for (i=0, j=0; pixelformat_tab[
i].dfb != DSPF_UNKNOWN; i++)