00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __TR_TYPES_H
00024 #define __TR_TYPES_H
00025
00026
00027 #define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces
00028 #define MAX_ENTITIES 1023 // can't be increased without changing drawsurf bit packing
00029
00030
00031 #define RF_MINLIGHT 1 // allways have some light (viewmodel, some items)
00032 #define RF_THIRD_PERSON 2 // don't draw through eyes, only mirrors (player bodies, chat sprites)
00033 #define RF_FIRST_PERSON 4 // only draw through eyes (view weapon, damage blood blob)
00034 #define RF_DEPTHHACK 8 // for view weapon Z crunching
00035 #define RF_NOSHADOW 64 // don't add stencil shadows
00036
00037 #define RF_LIGHTING_ORIGIN 128 // use refEntity->lightingOrigin instead of refEntity->origin
00038
00039
00040
00041 #define RF_SHADOW_PLANE 256 // use refEntity->shadowPlane
00042 #define RF_WRAP_FRAMES 512 // mod the model frames by the maxframes to allow continuous
00043
00044
00045
00046 #define RDF_NOWORLDMODEL 1 // used for player configuration screen
00047 #define RDF_HYPERSPACE 4 // teleportation effect
00048
00049 typedef struct {
00050 vec3_t xyz;
00051 float st[2];
00052 byte modulate[4];
00053 } polyVert_t;
00054
00055 typedef struct poly_s {
00056 qhandle_t hShader;
00057 int numVerts;
00058 polyVert_t *verts;
00059 } poly_t;
00060
00061 typedef enum {
00062 RT_MODEL,
00063 RT_POLY,
00064 RT_SPRITE,
00065 RT_BEAM,
00066 RT_RAIL_CORE,
00067 RT_RAIL_RINGS,
00068 RT_LIGHTNING,
00069 RT_PORTALSURFACE,
00070
00071 RT_MAX_REF_ENTITY_TYPE
00072 } refEntityType_t;
00073
00074 typedef struct {
00075 refEntityType_t reType;
00076 int renderfx;
00077
00078 qhandle_t hModel;
00079
00080
00081 vec3_t lightingOrigin;
00082 float shadowPlane;
00083
00084 vec3_t axis[3];
00085 qboolean nonNormalizedAxes;
00086 float origin[3];
00087 int frame;
00088
00089
00090 float oldorigin[3];
00091 int oldframe;
00092 float backlerp;
00093
00094
00095 int skinNum;
00096 qhandle_t customSkin;
00097 qhandle_t customShader;
00098
00099
00100 byte shaderRGBA[4];
00101 float shaderTexCoord[2];
00102 float shaderTime;
00103
00104
00105 float radius;
00106 float rotation;
00107 } refEntity_t;
00108
00109
00110 #define MAX_RENDER_STRINGS 8
00111 #define MAX_RENDER_STRING_LENGTH 32
00112
00113 typedef struct {
00114 int x, y, width, height;
00115 float fov_x, fov_y;
00116 vec3_t vieworg;
00117 vec3_t viewaxis[3];
00118
00119
00120 int time;
00121
00122 int rdflags;
00123
00124
00125 byte areamask[MAX_MAP_AREA_BYTES];
00126
00127
00128 char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH];
00129 } refdef_t;
00130
00131
00132 typedef enum {
00133 STEREO_CENTER,
00134 STEREO_LEFT,
00135 STEREO_RIGHT
00136 } stereoFrame_t;
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 typedef enum {
00147 TC_NONE,
00148 TC_S3TC
00149 } textureCompression_t;
00150
00151 typedef enum {
00152 GLDRV_ICD,
00153
00154
00155
00156
00157 GLDRV_STANDALONE,
00158 GLDRV_VOODOO
00159 } glDriverType_t;
00160
00161 typedef enum {
00162 GLHW_GENERIC,
00163 GLHW_3DFX_2D3D,
00164
00165
00166 GLHW_RIVA128,
00167 GLHW_RAGEPRO,
00168 GLHW_PERMEDIA2
00169 } glHardwareType_t;
00170
00171 typedef struct {
00172 char renderer_string[MAX_STRING_CHARS];
00173 char vendor_string[MAX_STRING_CHARS];
00174 char version_string[MAX_STRING_CHARS];
00175 char extensions_string[BIG_INFO_STRING];
00176
00177 int maxTextureSize;
00178 int maxActiveTextures;
00179
00180 int colorBits, depthBits, stencilBits;
00181
00182 glDriverType_t driverType;
00183 glHardwareType_t hardwareType;
00184
00185 qboolean deviceSupportsGamma;
00186 textureCompression_t textureCompression;
00187 qboolean textureEnvAddAvailable;
00188
00189 int vidWidth, vidHeight;
00190
00191
00192
00193 float windowAspect;
00194
00195 int displayFrequency;
00196
00197
00198
00199
00200 qboolean isFullscreen;
00201 qboolean stereoEnabled;
00202 qboolean smpActive;
00203 } glconfig_t;
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 #if defined(Q3_VM) || defined(_WIN32)
00217
00218 #define _3DFX_DRIVER_NAME "3dfxvgl"
00219 #define OPENGL_DRIVER_NAME "opengl32"
00220
00221 #else
00222
00223 #define _3DFX_DRIVER_NAME "libMesaVoodooGL.so"
00224
00225 #define OPENGL_DRIVER_NAME "libGL.so.1"
00226
00227 #endif // !defined _WIN32
00228
00229 #endif // __TR_TYPES_H