3
*************************************************************************
5
ArmageTron -- Just another Tron Lightcycle Game in 3D.
6
Copyright (C) 2000 Manuel Moos (manuel@moosnet.de)
8
**************************************************************************
10
This program is free software; you can redistribute it and/or
11
modify it under the terms of the GNU General Public License
12
as published by the Free Software Foundation; either version 2
13
of the License, or (at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
***************************************************************************
28
#ifndef ArmageTron_SCREEN_H
29
#define ArmageTron_SCREEN_H
32
#include "tCallback.h"
33
#include "tCallbackString.h"
36
ArmageTron_320_200=0,ArmageTron_320_240,ArmageTron_400_300,
37
ArmageTron_512_384,ArmageTron_640_480,ArmageTron_800_600,
38
ArmageTron_1024_768,ArmageTron_1280_800,ArmageTron_1280_854,ArmageTron_1280_1024,
39
ArmageTron_1600_1200,ArmageTron_1680_1050,ArmageTron_2048_1572,ArmageTron_Custom, ArmageTron_Invalid=-1
44
ArmageTron_ColorDepth_16, ArmageTron_ColorDepth_Desktop,
45
ArmageTron_ColorDepth_32
54
rScreenSize( int width, int height ); //!< constructor
55
explicit rScreenSize( rResolution r = ArmageTron_Invalid ); //!< constructor
56
void UpdateSize(); //!< update size from res enum
58
bool operator ==( rScreenSize const & other ) const; //!< comparison operator
59
bool operator !=( rScreenSize const & other ) const; //!< comparison operator
61
int Compare( rScreenSize const & other ) const; //!< comparison function
68
rScreenSize windowSize;
70
rColorDepth colorDepth;
74
REAL aspect; // aspect ratio of pixels ( width/height )
76
rScreenSettings(rResolution r,
78
rColorDepth cd=ArmageTron_ColorDepth_Desktop,
83
extern rScreenSettings currentScreensetting;
84
extern rScreenSettings lastSuccess;
87
extern SDL_Surface *sr_screen;
89
extern int sr_screenWidth,sr_screenHeight;
91
extern bool sr_alphaBlend;
92
extern bool sr_screenshotIsPlanned;
93
extern bool sr_smoothShading;
95
extern bool sr_glOut; // do we have gl-output at all?
96
extern bool sr_textOut; // display game text graphically?
97
extern bool sr_FPSOut; // display frame counter?
98
extern bool sr_ZTrick; // Quake-Style z-buffer trick: do
99
extern bool sr_useDisplayLists; // use GL display lists
100
// not delete the screen, just pait the background with depth test
101
// disabled. Gives 20% speedup.
104
#define rMIRROR_OFF 0
105
#define rMIRROR_OBJECTS 1
106
#define rMIRROR_WALLS 2
107
#define rMIRROR_ALL 10
109
extern int sr_floorMirror;
112
#define rFLOOR_GRID 1
113
#define rFLOOR_TEXTURE 2
114
#define rFLOOR_TWOTEXTURE 3
116
extern int sr_floorDetail;
119
#define rFEAT_DEFAULT 0
122
extern int sr_lineAntialias;
123
extern int sr_polygonAntialias;
124
extern int sr_perspectiveCorrection;
126
extern bool sr_highRim;
127
extern bool sr_upperSky,sr_lowerSky;
128
extern bool sr_skyWobble;
129
extern bool sr_dither;
130
extern bool sr_infinityPlane;
131
extern bool sr_laggometer;
132
extern bool sr_predictObjects;
133
extern bool sr_texturesTruecolor;
134
extern bool sr_keepWindowActive;
136
extern tString renderer_identification; // type of renderer used
138
extern tString gl_vendor;
139
extern tString gl_renderer;
140
extern tString gl_version;
141
extern tString gl_extensions;
143
class rPerFrameTask:public tCallback{
145
rPerFrameTask(VOIDFUNC *f);
146
static void DoPerFrameTasks();
149
class rRenderIdCallback:public tCallbackString{
151
rRenderIdCallback(STRINGRETFUNC *f);
152
static tString RenderId();
155
class rCallbackBeforeScreenModeChange:public tCallback{
157
rCallbackBeforeScreenModeChange(VOIDFUNC *f);
161
class rCallbackAfterScreenModeChange:public tCallback{
163
rCallbackAfterScreenModeChange(VOIDFUNC *f);
167
bool sr_InitDisplay();
168
void sr_ExitDisplay();
169
void sr_ReinitDisplay();
171
void sr_LoadDefaultConfig();
173
void sr_ResetRenderState(bool menu=0);
174
void sr_DepthOffset(bool offset);
175
void sr_Activate(bool active); // set activation staus