Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
155 lines (125 loc) · 5.27 KB

SDL_DirectFB_video.h

File metadata and controls

155 lines (125 loc) · 5.27 KB
 
1
2
/*
SDL - Simple DirectMedia Layer
Dec 8, 2008
Dec 8, 2008
3
Copyright (C) 1997-2009 Sam Lantinga
4
5
This library is free software; you can redistribute it and/or
Feb 1, 2006
Feb 1, 2006
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
Feb 1, 2006
Feb 1, 2006
8
version 2.1 of the License, or (at your option) any later version.
9
10
11
12
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Feb 1, 2006
Feb 1, 2006
13
Lesser General Public License for more details.
Feb 1, 2006
Feb 1, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Feb 21, 2006
Feb 21, 2006
22
#include "SDL_config.h"
23
24
25
26
#ifndef _SDL_DirectFB_video_h
#define _SDL_DirectFB_video_h
Aug 31, 2008
Aug 31, 2008
27
28
#include "../SDL_sysvideo.h"
29
#include <directfb.h>
Aug 11, 2007
Aug 11, 2007
30
31
#include <directfb_version.h>
Aug 31, 2008
Aug 31, 2008
32
33
34
#include "SDL_mouse.h"
#define DEBUG 0
Aug 11, 2007
Aug 11, 2007
35
36
#define LOG_CHANNEL stdout
Jan 11, 2009
Jan 11, 2009
37
38
#if (DIRECTFB_MAJOR_VERSION < 1)
#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
Aug 11, 2007
Aug 11, 2007
39
40
41
42
43
44
45
46
47
48
#endif
#if (DIRECTFB_MAJOR_VERSION >= 1) && (DIRECTFB_MINOR_VERSION >= 0) && (DIRECTFB_MICRO_VERSION >= 0 )
#define SDL_DIRECTFB_OPENGL 1
#include <directfbgl.h>
#endif
#if SDL_DIRECTFB_OPENGL
#include "SDL_loadso.h"
#endif
Aug 31, 2008
Aug 31, 2008
50
51
52
53
54
55
56
57
58
#include "SDL_DirectFB_events.h"
/*
* #include "SDL_DirectFB_gamma.h"
* #include "SDL_DirectFB_keyboard.h"
*/
#include "SDL_DirectFB_modes.h"
#include "SDL_DirectFB_mouse.h"
#include "SDL_DirectFB_opengl.h"
#include "SDL_DirectFB_window.h"
Jan 11, 2009
Jan 11, 2009
59
#include "SDL_DirectFB_WM.h"
Jan 4, 2009
Jan 4, 2009
61
62
63
64
#define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY" /* Default: off */
#define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT" /* Default: off */
#define DFBENV_USE_X11_CHECK "SDL_DIRECTFB_X11_CHECK" /* Default: on */
#define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */
Jan 11, 2009
Jan 11, 2009
65
#define DFBENV_USE_WM "SDL_DIRECTFB_WM" /* Default: off */
Aug 11, 2007
Aug 11, 2007
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#define SDL_DFB_RELEASE(x) do { if ( x ) { x->Release(x); x = NULL; } } while (0)
#define SDL_DFB_FREE(x) do { if ( x ) { SDL_free(x); x = NULL; } } while (0)
#define SDL_DFB_UNLOCK(x) do { if ( x ) { x->Unlock(x); } } while (0)
#if DEBUG
#define SDL_DFB_DEBUG(x...) do { fprintf(LOG_CHANNEL, "%s:", __FUNCTION__); fprintf(LOG_CHANNEL, x); } while (0)
#define SDL_DFB_DEBUGC(x...) do { fprintf(LOG_CHANNEL, x); } while (0)
#else
#define SDL_DFB_DEBUG(x...) do { } while (0)
#define SDL_DFB_DEBUGC(x...) do { } while (0)
#endif
#define SDL_DFB_CONTEXT "SDL_DirectFB"
#define SDL_DFB_ERR(x...) \
do { \
fprintf(LOG_CHANNEL, "%s: %s <%d>:\n\t", \
SDL_DFB_CONTEXT, __FILE__, __LINE__ ); \
fprintf(LOG_CHANNEL, x ); \
} while (0)
#define SDL_DFB_CHECK(x...) \
do { \
ret = x; \
if (ret != DFB_OK) { \
fprintf(LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
Jan 11, 2009
Jan 11, 2009
93
94
fprintf(LOG_CHANNEL, "\t%s\n", #x ); \
fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \
Aug 11, 2007
Aug 11, 2007
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
SDL_SetError( #x, DirectFBErrorString (ret) ); \
} \
} while (0)
#define SDL_DFB_CHECKERR(x...) \
do { \
ret = x; \
if (ret != DFB_OK) { \
fprintf(LOG_CHANNEL, "%s <%d>:\n", __FILE__, __LINE__ ); \
fprintf(LOG_CHANNEL, "\t%s\n", #x ); \
fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \
SDL_SetError( #x, DirectFBErrorString (ret) ); \
goto error; \
} \
} while (0)
#define SDL_DFB_CALLOC(r, n, s) \
do { \
r = SDL_calloc (n, s); \
if (!(r)) { \
fprintf( LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
SDL_OutOfMemory(); \
goto error; \
} \
} while (0)
120
121
122
/* Private display data */
Jan 11, 2009
Jan 11, 2009
123
#define SDL_DFB_DEVICEDATA(dev) DFB_DeviceData *devdata = (dev ? (DFB_DeviceData *) ((dev)->driverdata) : NULL)
Aug 11, 2007
Aug 11, 2007
124
125
126
127
128
#define DFB_MAX_SCREENS 10
typedef struct _DFB_DeviceData DFB_DeviceData;
struct _DFB_DeviceData
Jul 10, 2006
Jul 10, 2006
130
131
132
int initialized;
IDirectFB *dfb;
Dec 8, 2008
Dec 8, 2008
133
134
135
136
137
138
139
140
int num_mice;
int mouse_id[0x100];
int num_keyboard;
struct
{
int is_generic;
int id;
} keyboard[10];
Aug 11, 2007
Aug 11, 2007
141
DFB_WindowData *firstwin;
Jul 10, 2006
Jul 10, 2006
142
Aug 31, 2008
Aug 31, 2008
143
int use_yuv_underlays;
Jan 4, 2009
Jan 4, 2009
144
int use_linux_input;
Jan 11, 2009
Jan 11, 2009
145
int has_own_wm;
Aug 11, 2007
Aug 11, 2007
146
Aug 26, 2008
Aug 26, 2008
147
/* OpenGL */
Aug 11, 2007
Aug 11, 2007
148
149
void (*glFinish) (void);
void (*glFlush) (void);
Aug 31, 2008
Aug 31, 2008
151
152
/* global events */
IDirectFBEventBuffer *events;
Aug 11, 2007
Aug 11, 2007
153
};
Aug 31, 2002
Aug 31, 2002
154
155
#endif /* _SDL_DirectFB_video_h */