21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_DIRECTFB
43 #include <directfb_version.h>
44 #include <directfb_strings.h>
48 #include "../SDL_sysvideo.h"
49 #include "../SDL_pixels_c.h"
50 #include "../../events/SDL_events_c.h"
61 static int DirectFB_VideoInit(
_THIS);
62 static void DirectFB_VideoQuit(
_THIS);
67 "directfb",
"DirectFB",
71 static const DirectFBSurfaceDrawingFlagsNames(drawing_flags);
72 static const DirectFBSurfaceBlittingFlagsNames(blitting_flags);
73 static const DirectFBAccelerationMaskNames(acceleration_mask);
86 DirectFB_CreateDevice(
int devindex)
98 device->VideoInit = DirectFB_VideoInit;
99 device->VideoQuit = DirectFB_VideoQuit;
122 #if SDL_DIRECTFB_OPENGL
123 device->GL_LoadLibrary = DirectFB_GL_LoadLibrary;
124 device->GL_GetProcAddress = DirectFB_GL_GetProcAddress;
125 device->GL_MakeCurrent = DirectFB_GL_MakeCurrent;
127 device->GL_CreateContext = DirectFB_GL_CreateContext;
128 device->GL_SetSwapInterval = DirectFB_GL_SetSwapInterval;
129 device->GL_GetSwapInterval = DirectFB_GL_GetSwapInterval;
130 device->GL_SwapWindow = DirectFB_GL_SwapWindow;
131 device->GL_DeleteContext = DirectFB_GL_DeleteContext;
141 device->Vulkan_LoadLibrary = DirectFB_Vulkan_LoadLibrary;
142 device->Vulkan_UnloadLibrary = DirectFB_Vulkan_UnloadLibrary;
143 device->Vulkan_GetInstanceExtensions = DirectFB_Vulkan_GetInstanceExtensions;
144 device->Vulkan_CreateSurface = DirectFB_Vulkan_CreateSurface;
147 device->free = DirectFB_DeleteDevice;
157 DirectFB_DeviceInformation(IDirectFB * dfb)
159 DFBGraphicsDeviceDescription desc;
162 dfb->GetDeviceDescription(dfb, &desc);
169 SDL_DFB_LOG(
"Driver Vendor: %s", desc.driver.vendor);
170 SDL_DFB_LOG(
"Driver Version: %d.%d", desc.driver.major,
173 SDL_DFB_LOG(
"Video memory: %d", desc.video_memory);
176 for (
n = 0; blitting_flags[
n].flag;
n++) {
177 if (desc.blitting_flags & blitting_flags[
n].flag)
182 for (
n = 0; drawing_flags[
n].flag;
n++) {
183 if (desc.drawing_flags & drawing_flags[
n].flag)
189 for (
n = 0; acceleration_mask[
n].mask;
n++) {
190 if (desc.acceleration_mask & acceleration_mask[
n].mask)
197 static int readBoolEnv(
const char *env_name,
int def_val)
209 DirectFB_VideoInit(
_THIS)
211 IDirectFB *dfb =
NULL;
212 DFB_DeviceData *devdata =
NULL;
224 DirectFBSetOption(
"system",
"x11");
226 DirectFBSetOption(
"disable-module",
"x11input");
231 if (!devdata->use_linux_input)
234 DirectFBSetOption(
"disable-module",
"linux_input");
239 DirectFB_DeviceInformation(dfb);
245 if (devdata->use_linux_input) {
259 devdata->initialized = 1;
262 devdata->firstwin =
NULL;
263 devdata->grabbed_window =
NULL;
269 #if SDL_DIRECTFB_OPENGL
270 DirectFB_GL_Initialize(
_this);
286 DirectFB_VideoQuit(
_THIS)
294 devdata->events->Reset(devdata->events);
298 #if SDL_DIRECTFB_OPENGL
299 DirectFB_GL_Shutdown(
_this);
302 devdata->initialized = 0;
307 static const struct {
308 DFBSurfacePixelFormat dfb;
310 } pixelformat_tab[] =
325 #if (DFB_VERSION_ATLEAST(1,5,0))
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++)
void SDL_DirectFB_UnLoadLibrary(void)
int SDL_DirectFB_LoadLibrary(void)
void DirectFB_PumpEventsWindow(_THIS)
void DirectFB_QuitKeyboard(_THIS)
void DirectFB_InitKeyboard(_THIS)
void DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
void DirectFB_InitModes(_THIS)
int DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
void DirectFB_QuitModes(_THIS)
void DirectFB_InitMouse(_THIS)
void DirectFB_QuitMouse(_THIS)
int DirectFB_ResizeWindowShape(SDL_Window *window)
int DirectFB_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shapeMode)
SDL_WindowShaper * DirectFB_CreateShaper(SDL_Window *window)
#define DFBENV_USE_YUV_DIRECT
#define SDL_DFB_CHECKERR(x...)
#define DFBENV_USE_LINUX_INPUT
#define SDL_DFB_ALLOC_CLEAR(r, s)
#define DFBENV_USE_X11_CHECK
void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo *ri)
#define SDL_DFB_LOG(x...)
#define DFBENV_USE_YUV_UNDERLAY
#define SDL_DFB_RELEASE(x)
DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format)
Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat)
void DirectFB_DestroyWindow(_THIS, SDL_Window *window)
void DirectFB_SetWindowPosition(_THIS, SDL_Window *window)
void DirectFB_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
void DirectFB_ShowWindow(_THIS, SDL_Window *window)
void DirectFB_MinimizeWindow(_THIS, SDL_Window *window)
void DirectFB_SetWindowTitle(_THIS, SDL_Window *window)
void DirectFB_SetWindowSize(_THIS, SDL_Window *window)
void DirectFB_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
void DirectFB_RestoreWindow(_THIS, SDL_Window *window)
int DirectFB_CreateWindow(_THIS, SDL_Window *window)
int DirectFB_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
void DirectFB_HideWindow(_THIS, SDL_Window *window)
SDL_bool DirectFB_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
int DirectFB_SetWindowOpacity(_THIS, SDL_Window *window, float opacity)
void DirectFB_MaximizeWindow(_THIS, SDL_Window *window)
void DirectFB_RaiseWindow(_THIS, SDL_Window *window)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLuint const GLchar * name
@ SDL_PIXELFORMAT_INDEX1LSB
@ SDL_PIXELFORMAT_ABGR4444
@ SDL_PIXELFORMAT_INDEX4MSB
@ SDL_PIXELFORMAT_RGBA8888
@ SDL_PIXELFORMAT_ARGB1555
@ SDL_PIXELFORMAT_ABGR8888
@ SDL_PIXELFORMAT_BGRA8888
@ SDL_PIXELFORMAT_ABGR1555
@ SDL_PIXELFORMAT_ARGB8888
@ SDL_PIXELFORMAT_ARGB4444
@ SDL_PIXELFORMAT_INDEX1MSB
@ SDL_PIXELFORMAT_INDEX4LSB
@ SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_UNKNOWN
VideoBootStrap DirectFB_bootstrap
static SDL_VideoDevice * _this
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
static SDL_AudioDeviceID device
Information on the capabilities of a render driver or context.
Uint32 texture_formats[16]
Uint32 num_texture_formats