1 /*
2 Copyright (C) 2003-2006 Andrey Nazarov
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 
19 */
20 
21 #ifdef _WIN32
22 #define DEFAULT_OPENGL_DRIVER	"opengl32"
23 #else
24 #define DEFAULT_OPENGL_DRIVER	"libGL.so"
25 #endif
26 
27 typedef enum {
28 	SETMODE_ERROR,
29 	SETMODE_WINDOWED,
30 	SETMODE_FULLSCREEN
31 } vidSetModeResult_t;
32 
33 typedef enum {
34 	QVF_MINIDRIVER			= ( 1 << 0 ),
35 	QVF_ACCELERATED			= ( 1 << 1 ),
36 	QVF_STEREO_ENABLED		= ( 1 << 2 ),
37 	QVF_GAMMARAMP_ENABLED		= ( 1 << 3 ),
38 	QVF_FULLSCREEN_ENABLED		= ( 1 << 4 )
39 } vidFlags_t;
40 
41 typedef struct {
42 	void (*Shutdown)( void );
43 	void (*UpdateGamma)( const byte *table );
44 	vidFlags_t (*GetFlags)( void );
45 	qboolean (*Init)( void );
46 	vidSetModeResult_t (*SetMode)( int *pwidth, int *pheight, int mode, qboolean fullscreen );
47 	void *(*GetProcAddr)( const char *symbol );
48 	void (*BeginFrame)( float stereo_separation );
49 	void (*EndFrame)( void );
50 } vidGLAPI_t;
51 
52 typedef struct {
53 	void (*Shutdown)( void );
54 	void (*UpdateGamma)( const byte *table );
55 	vidFlags_t (*GetFlags)( void );
56 	qboolean (*Init)( void );
57 	vidSetModeResult_t (*SetMode)( int *pwidth, int *pheight, byte **buffer, int *rowbytes,
58 			const byte *palette, int mode, qboolean fullscreen );
59 	byte *(*GetSurface)( int *rowbytes );
60 	void (*UpdatePalette)( const byte *palette );
61 	void (*BeginFrame)( float stereo_separation );
62 	void (*EndFrame)( byte **buffer, int *rowbytes );
63 } vidSWAPI_t;
64 
65 void Video_PumpEvents( void );
66 void Video_FillInputAPI( inputAPI_t *api );
67 void Video_FillGLAPI( vidGLAPI_t *api );
68 void Video_FillSWAPI( vidSWAPI_t *api );
69 
70 #ifdef OPENGL_RENDERER
71 extern vidGLAPI_t   video;
72 #elif (defined SOFTWARE_RENDERER)
73 extern vidSWAPI_t   video;
74 #endif
75 
76 
77