00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ArmageTron_SCREEN_H
00029 #define ArmageTron_SCREEN_H
00030
00031 #include "tString.h"
00032 #include "tCallback.h"
00033 #include "tCallbackString.h"
00034 #include "tRuby.h"
00035
00036 typedef enum {
00037 ArmageTron_Desktop=0,ArmageTron_320_200,ArmageTron_Min=ArmageTron_320_200, ArmageTron_320_240,ArmageTron_400_300,
00038 ArmageTron_512_384,ArmageTron_640_480,ArmageTron_800_600,
00039 ArmageTron_1024_768,ArmageTron_1280_800,ArmageTron_1280_854,ArmageTron_1280_1024,
00040 ArmageTron_1600_1200,ArmageTron_1680_1050,ArmageTron_2048_1572,ArmageTron_Custom, ArmageTron_Invalid=-1
00041 }
00042 rResolution;
00043
00044 typedef enum {
00045 ArmageTron_ColorDepth_16, ArmageTron_ColorDepth_Desktop,
00046 ArmageTron_ColorDepth_32
00047 }
00048 rColorDepth;
00049
00050 typedef enum {
00051 ArmageTron_VSync_On, ArmageTron_VSync_Default, ArmageTron_VSync_Off,
00052 ArmageTron_VSync_MotionBlur
00053 }
00054 rVSync;
00055
00056 struct rScreenSize
00057 {
00058 rResolution res;
00059 int width, height;
00060
00061 rScreenSize( int width, int height );
00062 explicit rScreenSize( rResolution r = ArmageTron_Invalid );
00063 void UpdateSize();
00064
00065 bool operator ==( rScreenSize const & other ) const;
00066 bool operator !=( rScreenSize const & other ) const;
00067
00068 int Compare( rScreenSize const & other ) const;
00069 };
00070
00071 class rScreenSettings
00072 {
00073 public:
00074 rScreenSize res;
00075 rScreenSize windowSize;
00076 bool fullscreen;
00077 rColorDepth colorDepth;
00078 rColorDepth zDepth;
00079 bool useSDL;
00080 bool checkErrors;
00081 rVSync vSync;
00082 REAL aspect;
00083
00084 rScreenSettings(rResolution r,
00085 bool fs=true,
00086 rColorDepth cd=ArmageTron_ColorDepth_Desktop,
00087 bool sdl=true,
00088 bool ce =true);
00089 };
00090
00091 bool sr_DesktopScreensizeSupported();
00092
00093 extern rScreenSettings currentScreensetting;
00094 extern rScreenSettings lastSuccess;
00095
00096 struct SDL_Surface;
00097 extern SDL_Surface *sr_screen;
00098
00099 extern int sr_screenWidth,sr_screenHeight;
00100
00101 extern bool sr_alphaBlend;
00102 extern bool sr_screenshotIsPlanned;
00103 extern bool sr_smoothShading;
00104
00105 extern bool sr_glOut;
00106 extern bool sr_textOut;
00107 extern bool sr_FPSOut;
00108
00110 enum rDisplayListUsage
00111 {
00112 rDisplayList_Off=0,
00113 rDisplayList_CAC,
00114 rDisplayList_CAE,
00115 rDisplayList_Count
00116 };
00117
00118 extern rDisplayListUsage sr_useDisplayLists;
00119
00120
00121
00122
00123 #define rMIRROR_OFF 0
00124 #define rMIRROR_OBJECTS 1
00125 #define rMIRROR_WALLS 2
00126 #define rMIRROR_ALL 10
00127
00128 extern int sr_floorMirror;
00129
00130 #define rFLOOR_OFF 0
00131 #define rFLOOR_GRID 1
00132 #define rFLOOR_TEXTURE 2
00133 #define rFLOOR_TWOTEXTURE 3
00134
00135 extern int sr_floorDetail;
00136
00137 #define rFEAT_OFF -1
00138 #define rFEAT_DEFAULT 0
00139 #define rFEAT_ON 1
00140
00141 extern bool sr_highRim;
00142 extern bool sr_upperSky,sr_lowerSky;
00143 extern bool sr_skyWobble;
00144 extern bool sr_dither;
00145 extern bool sr_infinityPlane;
00146 extern bool sr_laggometer;
00147 extern bool sr_predictObjects;
00148 extern bool sr_texturesTruecolor;
00149 extern bool sr_keepWindowActive;
00150
00151 extern tString renderer_identification;
00152
00153 extern tString gl_vendor;
00154 extern tString gl_renderer;
00155 extern tString gl_version;
00156 extern tString gl_extensions;
00157
00158 class rPerFrameTask:public tCallback{
00159 public:
00160 rPerFrameTask(AA_VOIDFUNC *f);
00161 static void DoPerFrameTasks();
00162 };
00163
00164 #ifdef HAVE_LIBRUBY
00165 class rPerFrameTaskRuby : public tCallbackRuby {
00166 public:
00167 rPerFrameTaskRuby();
00168 static void DoPerFrameTasks();
00169 };
00170 #endif
00171
00172 class rRenderIdCallback:public tCallbackString{
00173 public:
00174 rRenderIdCallback(STRINGRETFUNC *f);
00175 static tString RenderId();
00176 };
00177
00178 class rCallbackBeforeScreenModeChange:public tCallback{
00179 public:
00180 rCallbackBeforeScreenModeChange(AA_VOIDFUNC *f);
00181 static void Exec();
00182 };
00183
00184 class rCallbackAfterScreenModeChange:public tCallback{
00185 public:
00186 rCallbackAfterScreenModeChange(AA_VOIDFUNC *f);
00187 static void Exec();
00188 };
00189
00190 bool sr_InitDisplay();
00191 void sr_ExitDisplay();
00192 void sr_ReinitDisplay();
00193
00194 void sr_LoadDefaultConfig();
00195
00196 void sr_ResetRenderState(bool menu=0);
00197 void sr_DepthOffset(bool offset);
00198 void sr_Activate(bool active);
00199
00200 void sr_LockSDL();
00201 void sr_UnlockSDL();
00202 #endif