00001 00006 /* 00007 All original material Copyright (C) 2002-2010 UFO: Alien Invasion. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either version 2 00012 of the License, or (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00017 00018 See the GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 00024 */ 00025 00026 #ifndef R_LOCAL_H 00027 #define R_LOCAL_H 00028 00029 #include "../../common/common.h" 00030 #include "../cl_renderer.h" 00031 #include "../cl_video.h" 00032 00033 #include "r_gl.h" 00034 #include "r_state.h" 00035 #include "r_array.h" 00036 #include "r_material.h" 00037 #include "r_image.h" 00038 #include "r_model.h" 00039 #include "r_thread.h" 00040 #include "r_framebuffer.h" 00041 #include "r_lightmap.h" 00042 #include "r_corona.h" 00043 #include "r_flare.h" 00044 00045 void R_DrawBlendSurfaces(const mBspSurfaces_t *list); 00046 void R_DrawOpaqueSurfaces(const mBspSurfaces_t *surfs); 00047 void R_DrawOpaqueWarpSurfaces(mBspSurfaces_t *surfs); 00048 void R_DrawBlendWarpSurfaces(mBspSurfaces_t *surfs); 00049 void R_DrawAlphaTestSurfaces(mBspSurfaces_t *surfs); 00050 void R_DrawMaterialSurfaces(mBspSurfaces_t *surfs); 00051 00052 void R_SetSurfaceBumpMappingParameters(const mBspSurface_t *surf, const image_t *normalMap); 00053 00054 /*==================================================== */ 00055 00056 extern cvar_t *r_brightness; 00057 extern cvar_t *r_contrast; 00058 extern cvar_t *r_saturation; 00059 00060 extern cvar_t *r_drawworld; 00061 extern cvar_t *r_drawentities; 00062 extern cvar_t *r_nocull; 00063 extern cvar_t *r_isometric; 00064 extern cvar_t *r_anisotropic; 00065 extern cvar_t *r_texture_lod; /* lod_bias */ 00066 extern cvar_t *r_materials; 00067 extern cvar_t *r_screenshot_format; 00068 extern cvar_t *r_screenshot_jpeg_quality; 00069 extern cvar_t *r_lightmap; 00070 extern cvar_t *r_debug_normals; 00071 extern cvar_t *r_debug_tangents; 00072 extern cvar_t *r_ext_texture_compression; 00073 extern cvar_t *r_checkerror; 00074 extern cvar_t *r_showbox; 00075 extern cvar_t *r_shadows; 00076 extern cvar_t *r_soften; 00077 extern cvar_t *r_modulate; 00078 extern cvar_t *r_drawbuffer; 00079 extern cvar_t *r_driver; 00080 extern cvar_t *r_swapinterval; 00081 extern cvar_t *r_multisample; 00082 extern cvar_t *r_threads; 00083 extern cvar_t *r_wire; 00084 extern cvar_t *r_vertexbuffers; 00085 extern cvar_t *r_maxlightmap; 00086 extern cvar_t *r_warp; 00087 extern cvar_t *r_lights; 00088 extern cvar_t *r_programs; 00089 extern cvar_t *r_postprocess; 00090 extern cvar_t *r_shownormals; 00091 extern cvar_t *r_bumpmap; 00092 extern cvar_t *r_specular; 00093 extern cvar_t *r_hardness; 00094 extern cvar_t *r_parallax; 00095 extern cvar_t *r_fog; 00096 extern cvar_t *r_flares; 00097 extern cvar_t *r_coronas; 00098 extern cvar_t *r_dynamic_lights; 00099 00100 /* private renderer variables */ 00101 typedef struct rlocals_s { 00102 /* view origin angle vectors */ 00103 vec3_t up; 00104 vec3_t forward; 00105 vec3_t right; 00106 00107 /* for box culling */ 00108 cBspPlane_t frustum[4]; 00109 00110 int frame; 00111 int tracenum; 00112 00113 float world_matrix[16]; 00114 00119 const model_t* bufferMapTile; 00120 } rlocals_t; 00121 00122 extern rlocals_t r_locals; 00123 00124 qboolean R_CullMeshModel(entity_t *e); 00125 00126 void R_DrawModelParticle(modelInfo_t *mi); 00127 void R_DrawBrushModel(const entity_t *e); 00128 void R_DrawBspNormals(int tile); 00129 qboolean R_CullBspModel(const entity_t *e); 00130 qboolean R_CullSphere(const vec3_t centre, const float radius, const unsigned int clipflags); 00131 void R_GetLevelSurfaceLists(void); 00132 void R_DrawEntities(void); 00133 void R_DrawInitLocal(void); 00134 void R_DrawParticles(void); 00135 void R_SetupFrustum(void); 00136 00137 typedef enum { 00138 GLHW_GENERIC, 00139 GLHW_MESA, 00140 GLHW_INTEL, 00141 GLHW_ATI, 00142 GLHW_NVIDIA 00143 } hardwareType_t; 00144 00146 typedef struct { 00147 const char *rendererString; 00148 const char *vendorString; 00149 const char *versionString; 00150 const char *extensionsString; 00151 const char *shadingLanguageVersion; 00152 int maxTextureSize; 00153 int maxTextureUnits; 00154 int maxTextureCoords; 00155 int maxVertexAttribs; 00156 int maxLights; 00157 int maxDrawBuffers; 00158 int maxRenderbufferSize; 00159 int maxColorAttachments; 00160 int maxVertexTextureImageUnits; 00161 00162 char lodDir[8]; 00163 00164 int videoMemory; 00165 00166 qboolean hwgamma; 00167 00168 int32_t maxAnisotropic; 00169 qboolean anisotropic; 00170 qboolean frameBufferObject; 00171 qboolean drawBuffers; 00172 00173 int gl_solid_format; 00174 int gl_alpha_format; 00175 00176 int gl_compressed_solid_format; 00177 int gl_compressed_alpha_format; 00178 00179 int gl_filter_min; 00180 int gl_filter_max; 00182 qboolean lod_bias; 00183 00184 qboolean nonPowerOfTwo; 00186 hardwareType_t hardwareType; 00187 } rconfig_t; 00188 00189 extern rconfig_t r_config; 00190 00191 /* 00192 ==================================================================== 00193 IMPLEMENTATION SPECIFIC FUNCTIONS 00194 ==================================================================== 00195 */ 00196 00197 qboolean Rimp_Init(void); 00198 void Rimp_Shutdown(void); 00199 qboolean R_InitGraphics(qboolean fullscreen, int width, int height); 00200 00201 #endif /* R_LOCAL_H */