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

Latest commit

 

History

History
142 lines (112 loc) · 4.76 KB

SDL_DirectFB_video.h

File metadata and controls

142 lines (112 loc) · 4.76 KB
 
1
2
/*
SDL - Simple DirectMedia Layer
Feb 1, 2006
Feb 1, 2006
3
Copyright (C) 1997-2006 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"
Aug 31, 2008
Aug 31, 2008
60
61
#define DFBENV_USE_YUV_UNDERLAY "SDL_DIRECTFB_YUV_UNDERLAY"
#define DFBENV_USE_YUV_DIRECT "SDL_DIRECTFB_YUV_DIRECT"
Aug 11, 2007
Aug 11, 2007
62
63
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
#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)
114
115
116
/* Private display data */
Aug 11, 2007
Aug 11, 2007
117
118
119
120
121
122
#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
124
125
126
int initialized;
IDirectFB *dfb;
Aug 11, 2007
Aug 11, 2007
127
128
int mouse;
int keyboard;
Aug 26, 2008
Aug 26, 2008
129
int kbdgeneric;
Aug 11, 2007
Aug 11, 2007
130
DFB_WindowData *firstwin;
Jul 10, 2006
Jul 10, 2006
131
Aug 31, 2008
Aug 31, 2008
132
int use_yuv_underlays;
Aug 11, 2007
Aug 11, 2007
133
Aug 26, 2008
Aug 26, 2008
134
/* OpenGL */
Aug 11, 2007
Aug 11, 2007
135
136
void (*glFinish) (void);
void (*glFlush) (void);
Aug 31, 2008
Aug 31, 2008
138
139
/* global events */
IDirectFBEventBuffer *events;
Aug 11, 2007
Aug 11, 2007
140
};
Aug 31, 2002
Aug 31, 2002
141
142
#endif /* _SDL_DirectFB_video_h */