| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef TR_COMMON_H |
| 23 |
#define TR_COMMON_H |
| 24 |
|
| 25 |
#include "../qcommon/q_shared.h" |
| 26 |
#include "../renderercommon/tr_public.h" |
| 27 |
#include "qgl.h" |
| 28 |
|
| 29 |
typedef enum |
| 30 |
{ |
| 31 |
IMGTYPE_COLORALPHA, |
| 32 |
IMGTYPE_NORMAL, |
| 33 |
IMGTYPE_NORMALHEIGHT, |
| 34 |
IMGTYPE_DELUXE, |
| 35 |
} imgType_t; |
| 36 |
|
| 37 |
typedef enum |
| 38 |
{ |
| 39 |
IMGFLAG_NONE = 0x0000, |
| 40 |
IMGFLAG_MIPMAP = 0x0001, |
| 41 |
IMGFLAG_PICMIP = 0x0002, |
| 42 |
IMGFLAG_CUBEMAP = 0x0004, |
| 43 |
IMGFLAG_NO_COMPRESSION = 0x0010, |
| 44 |
IMGFLAG_NOLIGHTSCALE = 0x0020, |
| 45 |
IMGFLAG_CLAMPTOEDGE = 0x0040, |
| 46 |
IMGFLAG_GENNORMALMAP = 0x0080, |
| 47 |
} imgFlags_t; |
| 48 |
|
| 49 |
typedef struct image_s { |
| 50 |
char imgName[MAX_QPATH]; |
| 51 |
int width, height; |
| 52 |
int uploadWidth, uploadHeight; |
| 53 |
GLuint texnum; |
| 54 |
|
| 55 |
int frameUsed; |
| 56 |
|
| 57 |
int internalFormat; |
| 58 |
int TMU; |
| 59 |
|
| 60 |
imgType_t type; |
| 61 |
imgFlags_t flags; |
| 62 |
|
| 63 |
struct image_s* next; |
| 64 |
} image_t; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
#define LIGHTMAP_2D -4 // shader is for 2D rendering |
| 69 |
#define LIGHTMAP_BY_VERTEX -3 // pre-lit triangle models |
| 70 |
#define LIGHTMAP_WHITEIMAGE -2 |
| 71 |
#define LIGHTMAP_NONE -1 |
| 72 |
|
| 73 |
extern refimport_t ri; |
| 74 |
extern glconfig_t glConfig; |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
extern qboolean textureFilterAnisotropic; |
| 81 |
extern int maxAnisotropy; |
| 82 |
extern float displayAspect; |
| 83 |
extern qboolean haveClampToEdge; |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
extern cvar_t *r_stencilbits; |
| 89 |
extern cvar_t *r_depthbits; |
| 90 |
extern cvar_t *r_colorbits; |
| 91 |
extern cvar_t *r_texturebits; |
| 92 |
extern cvar_t *r_ext_multisample; |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
extern cvar_t *r_mode; |
| 99 |
extern cvar_t *r_noborder; |
| 100 |
extern cvar_t *r_fullscreen; |
| 101 |
extern cvar_t *r_ignorehwgamma; |
| 102 |
extern cvar_t *r_drawBuffer; |
| 103 |
extern cvar_t *r_swapInterval; |
| 104 |
|
| 105 |
extern cvar_t *r_allowExtensions; |
| 106 |
extern cvar_t *r_ext_compressed_textures; |
| 107 |
extern cvar_t *r_ext_multitexture; |
| 108 |
extern cvar_t *r_ext_compiled_vertex_array; |
| 109 |
extern cvar_t *r_ext_texture_env_add; |
| 110 |
|
| 111 |
extern cvar_t *r_ext_texture_filter_anisotropic; |
| 112 |
extern cvar_t *r_ext_max_anisotropy; |
| 113 |
|
| 114 |
extern cvar_t *r_stereoEnabled; |
| 115 |
|
| 116 |
extern cvar_t *r_saveFontData; |
| 117 |
|
| 118 |
qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode ); |
| 119 |
|
| 120 |
float R_NoiseGet4f( float x, float y, float z, double t ); |
| 121 |
void R_NoiseInit( void ); |
| 122 |
|
| 123 |
image_t *R_FindImageFile( const char *name, imgType_t type, imgFlags_t flags ); |
| 124 |
image_t *R_CreateImage( const char *name, byte *pic, int width, int height, imgType_t type, imgFlags_t flags, int internalFormat ); |
| 125 |
|
| 126 |
void R_IssuePendingRenderCommands( void ); |
| 127 |
qhandle_t RE_RegisterShaderLightMap( const char *name, int lightmapIndex ); |
| 128 |
qhandle_t RE_RegisterShader( const char *name ); |
| 129 |
qhandle_t RE_RegisterShaderNoMip( const char *name ); |
| 130 |
qhandle_t RE_RegisterShaderFromImage(const char *name, int lightmapIndex, image_t *image, qboolean mipRawImage); |
| 131 |
|
| 132 |
|
| 133 |
void R_InitFreeType( void ); |
| 134 |
void R_DoneFreeType( void ); |
| 135 |
void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font); |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
void R_LoadBMP( const char *name, byte **pic, int *width, int *height ); |
| 146 |
void R_LoadJPG( const char *name, byte **pic, int *width, int *height ); |
| 147 |
void R_LoadPCX( const char *name, byte **pic, int *width, int *height ); |
| 148 |
void R_LoadPNG( const char *name, byte **pic, int *width, int *height ); |
| 149 |
void R_LoadPVR( const char *name, byte **pic, int *width, int *height ); |
| 150 |
void R_LoadTGA( const char *name, byte **pic, int *width, int *height ); |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
void GLimp_Init( qboolean fixedFunction ); |
| 161 |
void GLimp_Shutdown( void ); |
| 162 |
void GLimp_EndFrame( void ); |
| 163 |
|
| 164 |
void GLimp_LogComment( char *comment ); |
| 165 |
void GLimp_Minimize(void); |
| 166 |
|
| 167 |
void GLimp_SetGamma( unsigned char red[256], |
| 168 |
unsigned char green[256], |
| 169 |
unsigned char blue[256] ); |
| 170 |
|
| 171 |
|
| 172 |
#endif |