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

Latest commit

 

History

History
150 lines (120 loc) · 5.08 KB

SDL_DirectFB_video.h

File metadata and controls

150 lines (120 loc) · 5.08 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
37
38
39
40
41
42
43
44
45
46
47
48
#define LOG_CHANNEL stdout
#if (DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23)
#error "SDL_DIRECTFB: Please compile against libdirectfb version >=0.9.24"
#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 4, 2009
Jan 4, 2009
60
61
62
63
#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 */
Aug 11, 2007
Aug 11, 2007
64
65
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#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__ ); \
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)
116
117
118
/* Private display data */
Aug 11, 2007
Aug 11, 2007
119
120
121
122
123
124
#define SDL_DFB_DEVICEDATA(dev) DFB_DeviceData *devdata = (DFB_DeviceData *) ((dev)->driverdata)
#define DFB_MAX_SCREENS 10
typedef struct _DFB_DeviceData DFB_DeviceData;
struct _DFB_DeviceData
Jul 10, 2006
Jul 10, 2006
126
127
128
int initialized;
IDirectFB *dfb;
Dec 8, 2008
Dec 8, 2008
129
130
131
132
133
134
135
136
int num_mice;
int mouse_id[0x100];
int num_keyboard;
struct
{
int is_generic;
int id;
} keyboard[10];
Aug 11, 2007
Aug 11, 2007
137
DFB_WindowData *firstwin;
Jul 10, 2006
Jul 10, 2006
138
Aug 31, 2008
Aug 31, 2008
139
int use_yuv_underlays;
Jan 4, 2009
Jan 4, 2009
140
int use_linux_input;
Aug 11, 2007
Aug 11, 2007
141
Aug 26, 2008
Aug 26, 2008
142
/* OpenGL */
Aug 11, 2007
Aug 11, 2007
143
144
void (*glFinish) (void);
void (*glFlush) (void);
Aug 31, 2008
Aug 31, 2008
146
147
/* global events */
IDirectFBEventBuffer *events;
Aug 11, 2007
Aug 11, 2007
148
};
Aug 31, 2002
Aug 31, 2002
149
150
#endif /* _SDL_DirectFB_video_h */