23 #if SDL_VIDEO_DRIVER_DIRECTFB
48 #include <directfb_version.h>
49 #include <directfb_strings.h>
53 #include "../SDL_sysvideo.h"
54 #include "../SDL_pixels_c.h"
55 #include "../../events/SDL_events_c.h"
66 static int DirectFB_VideoInit(
_THIS);
67 static void DirectFB_VideoQuit(
_THIS);
69 static int DirectFB_Available(
void);
73 "directfb",
"DirectFB",
74 DirectFB_Available, DirectFB_CreateDevice
77 static const DirectFBSurfaceDrawingFlagsNames(drawing_flags);
78 static const DirectFBSurfaceBlittingFlagsNames(blitting_flags);
79 static const DirectFBAccelerationMaskNames(acceleration_mask);
84 DirectFB_Available(
void)
101 DirectFB_CreateDevice(
int devindex)
138 #if SDL_DIRECTFB_OPENGL
156 device->
free = DirectFB_DeleteDevice;
166 DirectFB_DeviceInformation(IDirectFB * dfb)
168 DFBGraphicsDeviceDescription desc;
171 dfb->GetDeviceDescription(dfb, &desc);
178 SDL_DFB_LOG(
"Driver Vendor: %s", desc.driver.vendor);
179 SDL_DFB_LOG(
"Driver Version: %d.%d", desc.driver.major,
182 SDL_DFB_LOG(
"Video memoory: %d", desc.video_memory);
185 for (n = 0; blitting_flags[
n].flag; n++) {
186 if (desc.blitting_flags & blitting_flags[n].flag)
191 for (n = 0; drawing_flags[
n].flag; n++) {
192 if (desc.drawing_flags & drawing_flags[n].flag)
198 for (n = 0; acceleration_mask[
n].mask; n++) {
199 if (desc.acceleration_mask & acceleration_mask[n].mask)
206 static int readBoolEnv(
const char *env_name,
int def_val)
218 DirectFB_VideoInit(
_THIS)
220 IDirectFB *dfb =
NULL;
233 DirectFBSetOption(
"system",
"x11");
235 DirectFBSetOption(
"disable-module",
"x11input");
244 DirectFBSetOption(
"disable-module",
"linux_input");
249 DirectFB_DeviceInformation(dfb);
279 #if SDL_DIRECTFB_OPENGL
280 DirectFB_GL_Initialize(
_this);
296 DirectFB_VideoQuit(
_THIS)
308 #if SDL_DIRECTFB_OPENGL
309 DirectFB_GL_Shutdown(
_this);
317 static const struct {
318 DFBSurfacePixelFormat dfb;
320 } pixelformat_tab[] =
339 #if (DFB_VERSION_ATLEAST(1,2,0))
362 #if (DFB_VERSION_ATLEAST(1,3,0))
366 #if (DFB_VERSION_ATLEAST(1,4,3))
395 for (i=0; pixelformat_tab[
i].dfb != DSPF_UNKNOWN; i++)
396 if (pixelformat_tab[i].dfb == pixelformat)
398 return pixelformat_tab[
i].sdl;
403 DFBSurfacePixelFormat
408 for (i=0; pixelformat_tab[
i].dfb != DSPF_UNKNOWN; i++)
409 if (pixelformat_tab[i].sdl == format)
411 return pixelformat_tab[
i].dfb;
420 for (i=0, j=0; pixelformat_tab[
i].dfb != DSPF_UNKNOWN; i++)
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
void DirectFB_ShowWindow(_THIS, SDL_Window *window)
void(* MinimizeWindow)(_THIS, SDL_Window *window)
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void(* RaiseWindow)(_THIS, SDL_Window *window)
int DirectFB_CreateWindow(_THIS, SDL_Window *window)
SDL_bool DirectFB_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
SDL_WindowShaper * DirectFB_CreateShaper(SDL_Window *window)
#define SDL_DFB_LOG(x...)
void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo *ri)
void(* HideWindow)(_THIS, SDL_Window *window)
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
void SDL_DirectFB_UnLoadLibrary(void)
DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format)
void(* SetWindowGrab)(_THIS, SDL_Window *window, SDL_bool grabbed)
Uint32 texture_formats[16]
void(* SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon)
void DirectFB_RaiseWindow(_THIS, SDL_Window *window)
void DirectFB_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
EGLImageKHR EGLint * name
Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat)
int(* CreateWindowFrom)(_THIS, SDL_Window *window, const void *data)
int DirectFB_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
#define SDL_DFB_RELEASE(x)
void DirectFB_QuitMouse(_THIS)
int(* GL_SetSwapInterval)(_THIS, int interval)
static SDL_VideoDevice * _this
void DirectFB_InitMouse(_THIS)
uint32_t Uint32
An unsigned 32-bit integer type.
#define DFBENV_USE_LINUX_INPUT
int(* CreateWindow)(_THIS, SDL_Window *window)
void DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
#define DFBENV_USE_YUV_UNDERLAY
int(* SetWindowShape)(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode)
void DirectFB_QuitKeyboard(_THIS)
void DirectFB_QuitModes(_THIS)
void DirectFB_InitModes(_THIS)
void DirectFB_InitKeyboard(_THIS)
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
void(* SetWindowPosition)(_THIS, SDL_Window *window)
void(* PumpEvents)(_THIS)
int DirectFB_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shapeMode)
void DirectFB_PumpEventsWindow(_THIS)
SDL_WindowShaper *(* CreateShaper)(SDL_Window *window)
int(* GL_GetSwapInterval)(_THIS)
#define DFBENV_USE_YUV_DIRECT
#define SDL_DFB_ALLOC_CLEAR(r, s)
#define SDL_DFB_CHECKERR(x...)
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
void(* MaximizeWindow)(_THIS, SDL_Window *window)
Information on the capabilities of a render driver or context.
void(* DestroyWindow)(_THIS, SDL_Window *window)
SDL_Window * grabbed_window
int DirectFB_ResizeWindowShape(SDL_Window *window)
void(* SetWindowSize)(_THIS, SDL_Window *window)
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
#define DFBENV_USE_X11_CHECK
void DirectFB_SetWindowTitle(_THIS, SDL_Window *window)
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
void DirectFB_MaximizeWindow(_THIS, SDL_Window *window)
int(* GL_LoadLibrary)(_THIS, const char *path)
void(* GL_SwapWindow)(_THIS, SDL_Window *window)
void(* ShowWindow)(_THIS, SDL_Window *window)
Uint32 num_texture_formats
SDL_ShapeDriver shape_driver
void DirectFB_SetWindowSize(_THIS, SDL_Window *window)
DECLSPEC char *SDLCALL SDL_getenv(const char *name)
void(* SetWindowTitle)(_THIS, SDL_Window *window)
void DirectFB_MinimizeWindow(_THIS, SDL_Window *window)
void DirectFB_DestroyWindow(_THIS, SDL_Window *window)
void DirectFB_SetWindowPosition(_THIS, SDL_Window *window)
void *(* GL_GetProcAddress)(_THIS, const char *proc)
int DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
void DirectFB_HideWindow(_THIS, SDL_Window *window)
int(* ResizeWindowShape)(SDL_Window *window)
void DirectFB_RestoreWindow(_THIS, SDL_Window *window)
void DirectFB_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
int SDL_DirectFB_LoadLibrary(void)
void(* RestoreWindow)(_THIS, SDL_Window *window)
IDirectFBEventBuffer * events