aboutsummaryrefslogtreecommitdiff
path: root/modules/libvideo/g_video.h
blob: 7d2fc6b4896b2ff49d762def8d6d05a0ac8508eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
114
/*
 *  Copyright � 2006-2013 SplinterGU (Fenix/Bennugd)
 *  Copyright � 2002-2006 Fenix Team (Fenix)
 *  Copyright � 1999-2002 Jos� Luis Cebri�n Pag�e (Fenix)
 *
 *  This file is part of Bennu - Game Development
 *
 *  This software is provided 'as-is', without any express or implied
 *  warranty. In no event will the authors be held liable for any damages
 *  arising from the use of this software.
 *
 *  Permission is granted to anyone to use this software for any purpose,
 *  including commercial applications, and to alter it and redistribute it
 *  freely, subject to the following restrictions:
 *
 *     1. The origin of this software must not be misrepresented; you must not
 *     claim that you wrote the original software. If you use this software
 *     in a product, an acknowledgment in the product documentation would be
 *     appreciated but is not required.
 *
 *     2. Altered source versions must be plainly marked as such, and must not be
 *     misrepresented as being the original software.
 *
 *     3. This notice may not be removed or altered from any source
 *     distribution.
 *
 */

#ifndef __G_VIDEO_H
#define __G_VIDEO_H

/* --------------------------------------------------------------------------- */

#ifndef __BGDC__
#include <SDL.h>

#include "libgrbase.h"
#endif

/* --------------------------------------------------------------------------- */
/* Graph Mode */
#define MODE_WINDOW         0x0000
#define MODE_16BITS         0x0010
#define MODE_32BITS         0x0020
#define MODE_2XSCALE        0x0100
#define MODE_FULLSCREEN     0x0200
#define MODE_DOUBLEBUFFER   0x0400
#define MODE_HARDWARE       0x0800
#define MODE_MODAL          0x1000
#define MODE_FRAMELESS      0x2000
#define MODE_WAITVSYNC      0x4000

/* Scaler */
#define SCALE_NONE          0x0000
#define SCALE_SCALE2X       0x0001

/* Scale resolution orientation */
#define SRO_NORMAL          0
#define SRO_LEFT            1
#define SRO_DOWN            2
#define SRO_RIGHT           3

/* Scale resolution aspectratio */
#define SRA_STRETCH         0
#define SRA_PRESERVE        1

/* --------------------------------------------------------------------------- */

#ifndef __BGDC__
extern GRAPH * icon ;

extern SDL_Surface * screen ;
extern SDL_Surface * scale_screen ;

extern char * apptitle ;

extern int scr_width ;
extern int scr_height ;

extern int scr_initialized ;

extern int enable_16bits ;
extern int enable_scale ;
extern int full_screen ;
extern int double_buffer ;
extern int hardware_scr ;
extern int grab_input ;
extern int frameless ;
extern int scale_mode ;

extern int waitvsync ;

extern int scale_resolution ;
extern int * scale_resolution_table_w;
extern int * scale_resolution_table_h;

extern int scale_resolution_aspectratio;
extern int scale_resolution_orientation;

extern int scale_resolution_aspectratio_offx;
extern int scale_resolution_aspectratio_offy;

/* --------------------------------------------------------------------------- */

extern int gr_init( int width, int height );
extern void gr_set_caption( char * title );
extern int gr_set_icon( GRAPH * map );
extern int gr_set_mode( int width, int height, int depth );
extern void gr_wait_vsync();

/* --------------------------------------------------------------------------- */

#endif
#endif