24 #ifndef _SDL_DirectFB_video_h
25 #define _SDL_DirectFB_video_h
28 #include <directfb_version.h>
30 #include "../SDL_sysvideo.h"
36 #define DFB_VERSIONNUM(X, Y, Z) \
37 ((X)*1000 + (Y)*100 + (Z))
39 #define DFB_COMPILEDVERSION \
40 DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
42 #define DFB_VERSION_ATLEAST(X, Y, Z) \
43 (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
45 #if (DFB_VERSION_ATLEAST(1,0,0))
46 #ifdef SDL_VIDEO_OPENGL
47 #define SDL_DIRECTFB_OPENGL 1
50 #error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
57 #define USE_MULTI_API (0)
64 #if (DFB_COMPILEDVERSION == DFB_VERSIONNUM(1, 4, 3))
65 #define ENABLE_LUT8 (0)
67 #define ENABLE_LUT8 (1)
70 #define DIRECTFB_DEBUG 1
72 #define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY"
73 #define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT"
74 #define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK"
75 #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT"
76 #define DFBENV_USE_WM "SDL_DIRECTFB_WM"
78 #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0)
79 #define SDL_DFB_FREE(x) do { SDL_free((x)); (x) = NULL; } while (0)
80 #define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0)
82 #define SDL_DFB_CONTEXT "SDL_DirectFB"
84 #define SDL_DFB_ERR(x...) SDL_LogError(SDL_LOG_CATEGORY_ERROR, x)
87 #define SDL_DFB_LOG(x...) SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, x)
89 #define SDL_DFB_DEBUG(x...) SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, x)
93 SDL_DFB_LOG(
"%s (%d):%s", src_file, src_line, DirectFBErrorString (ret) );
99 #define SDL_DFB_CHECK(x...) do { sdl_dfb_check( x, __FILE__, __LINE__); } while (0)
100 #define SDL_DFB_CHECKERR(x...) do { if ( sdl_dfb_check( x, __FILE__, __LINE__) != DFB_OK ) goto error; } while (0)
104 #define SDL_DFB_CHECK(x...) x
105 #define SDL_DFB_CHECKERR(x...) do { if (x != DFB_OK ) goto error; } while (0)
106 #define SDL_DFB_LOG(x...) do {} while (0)
107 #define SDL_DFB_DEBUG(x...) do {} while (0)
112 #define SDL_DFB_CALLOC(r, n, s) \
114 r = SDL_calloc (n, s); \
116 SDL_DFB_ERR("Out of memory"); \
122 #define SDL_DFB_ALLOC_CLEAR(r, s) SDL_DFB_CALLOC(r, 1, s)
126 #define SDL_DFB_DEVICEDATA(dev) DFB_DeviceData *devdata = (dev ? (DFB_DeviceData *) ((dev)->driverdata) : NULL)
128 #define DFB_MAX_SCREENS 10
#define SDL_DFB_LOG(x...)
void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo *ri)
DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format)
Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat)
uint32_t Uint32
An unsigned 32-bit integer type.
DFB_KeyboardData keyboard[10]
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
static DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line)
Information on the capabilities of a render driver or context.
SDL_Window * grabbed_window
SDL_Scancode
The SDL keyboard scancode representation.
IDirectFBEventBuffer * events