2018-04-13 18:23:45 +02:00
|
|
|
/*
|
|
|
|
gl_local.h - renderer local declarations
|
|
|
|
Copyright (C) 2010 Uncle Mike
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GL_LOCAL_H
|
|
|
|
#define GL_LOCAL_H
|
2019-02-23 19:49:46 +01:00
|
|
|
#include "port.h"
|
|
|
|
#include "xash3d_types.h"
|
|
|
|
#include "cvardef.h"
|
|
|
|
#include "const.h"
|
|
|
|
#include "com_model.h"
|
2018-04-13 18:23:45 +02:00
|
|
|
#include "cl_entity.h"
|
|
|
|
#include "render_api.h"
|
|
|
|
#include "protocol.h"
|
|
|
|
#include "dlight.h"
|
|
|
|
#include "gl_frustum.h"
|
2019-02-18 19:25:26 +01:00
|
|
|
#include "ref_api.h"
|
2020-02-10 11:07:06 +01:00
|
|
|
#include "xash3d_mathlib.h"
|
2019-02-23 19:49:46 +01:00
|
|
|
#include "ref_params.h"
|
|
|
|
#include "enginefeatures.h"
|
|
|
|
#include "com_strings.h"
|
|
|
|
#include "pm_movevars.h"
|
2023-05-20 19:27:15 +02:00
|
|
|
#include "common/cvar.h"
|
2019-04-05 00:36:26 +02:00
|
|
|
#include "gl_export.h"
|
2019-10-26 14:42:00 +02:00
|
|
|
#include "wadfile.h"
|
2019-04-04 22:13:17 +02:00
|
|
|
|
2023-02-21 23:32:47 +01:00
|
|
|
#if XASH_PSVITA
|
|
|
|
int VGL_ShimInit( void );
|
|
|
|
void VGL_ShimShutdown( void );
|
|
|
|
void VGL_ShimEndFrame( void );
|
|
|
|
#endif
|
2023-10-04 23:24:40 +02:00
|
|
|
#if !defined(XASH_GL_STATIC)
|
2023-10-04 17:29:29 +02:00
|
|
|
#include "gl2_shim/gl2_shim.h"
|
|
|
|
#endif
|
2023-02-21 23:32:47 +01:00
|
|
|
|
2019-03-19 23:20:58 +01:00
|
|
|
#ifndef offsetof
|
2021-10-03 03:26:40 +02:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define offsetof(s,m) __builtin_offsetof(s,m)
|
|
|
|
#else
|
|
|
|
#define offsetof(s,m) (size_t)&(((s *)0)->m)
|
|
|
|
#endif
|
|
|
|
#endif
|
2019-02-23 19:49:46 +01:00
|
|
|
|
2019-03-16 11:23:41 +01:00
|
|
|
#define ASSERT(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )
|
|
|
|
#define Assert(x) if(!( x )) gEngfuncs.Host_Error( "assert failed at %s:%i\n", __FILE__, __LINE__ )
|
2019-02-27 00:23:03 +01:00
|
|
|
|
|
|
|
#include <stdio.h>
|
2019-02-23 19:49:46 +01:00
|
|
|
|
2019-02-24 16:45:27 +01:00
|
|
|
#define WORLD (gEngfuncs.GetWorld())
|
|
|
|
#define WORLDMODEL (gEngfuncs.pfnGetModelByIndex( 1 ))
|
|
|
|
#define MOVEVARS (gEngfuncs.pfnGetMoveVars())
|
2019-02-27 00:23:03 +01:00
|
|
|
|
|
|
|
// make mod_ref.h?
|
|
|
|
#define LM_SAMPLE_SIZE 16
|
2019-02-23 19:49:46 +01:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
|
2021-06-01 18:28:52 +02:00
|
|
|
extern poolhandle_t r_temppool;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
#define BLOCK_SIZE tr.block_size // lightmap blocksize
|
|
|
|
#define BLOCK_SIZE_DEFAULT 128 // for keep backward compatibility
|
|
|
|
#define BLOCK_SIZE_MAX 1024
|
|
|
|
|
2021-11-29 14:22:52 +01:00
|
|
|
#define MAX_TEXTURES 8192 // a1ba: increased by users request
|
2018-04-13 18:23:45 +02:00
|
|
|
#define MAX_DETAIL_TEXTURES 256
|
|
|
|
#define MAX_LIGHTMAPS 256
|
|
|
|
#define SUBDIVIDE_SIZE 64
|
|
|
|
#define MAX_DECAL_SURFS 4096
|
|
|
|
#define MAX_DRAW_STACK 2 // normal view and menu view
|
|
|
|
|
|
|
|
#define SHADEDOT_QUANT 16 // precalculated dot products for quantized angles
|
|
|
|
#define SHADE_LAMBERT 1.495f
|
2018-06-09 00:28:35 +02:00
|
|
|
#define DEFAULT_ALPHATEST 0.0f
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
// refparams
|
|
|
|
#define RP_NONE 0
|
|
|
|
#define RP_ENVVIEW BIT( 0 ) // used for cubemapshot
|
|
|
|
#define RP_OLDVIEWLEAF BIT( 1 )
|
|
|
|
#define RP_CLIPPLANE BIT( 2 )
|
|
|
|
|
|
|
|
#define RP_NONVIEWERREF (RP_ENVVIEW)
|
|
|
|
#define R_ModelOpaque( rm ) ( rm == kRenderNormal )
|
|
|
|
#define R_StaticEntity( ent ) ( VectorIsNull( ent->origin ) && VectorIsNull( ent->angles ))
|
2019-03-22 14:36:46 +01:00
|
|
|
#define RP_LOCALCLIENT( e ) ((e) != NULL && (e)->index == ENGINE_GET_PARM( PARM_PLAYER_INDEX ) && e->player )
|
2018-04-13 18:23:45 +02:00
|
|
|
#define RP_NORMALPASS() ( FBitSet( RI.params, RP_NONVIEWERREF ) == 0 )
|
|
|
|
|
2019-03-22 14:36:46 +01:00
|
|
|
#define CL_IsViewEntityLocalPlayer() ( ENGINE_GET_PARM( PARM_VIEWENT_INDEX ) == ENGINE_GET_PARM( PARM_PLAYER_INDEX ) )
|
2019-02-24 16:45:27 +01:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
#define CULL_VISIBLE 0 // not culled
|
|
|
|
#define CULL_BACKSIDE 1 // backside of transparent wall
|
|
|
|
#define CULL_FRUSTUM 2 // culled by frustum
|
|
|
|
#define CULL_VISFRAME 3 // culled by PVS
|
|
|
|
#define CULL_OTHER 4 // culled by other reason
|
|
|
|
|
2021-06-07 01:40:40 +02:00
|
|
|
#define HACKS_RELATED_HLMODS // some HL-mods works differently under Xash and can't be fixed without some hacks at least at current time
|
|
|
|
|
2023-05-19 03:35:54 +02:00
|
|
|
#define SKYBOX_BASE_NUM 5800 // set skybox base (to let some mods load hi-res skyboxes)
|
|
|
|
#define SKYBOX_MAX_SIDES 6 // box can only have 6 sides
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
typedef struct gltexture_s
|
|
|
|
{
|
|
|
|
char name[256]; // game path, including extension (can be store image programs)
|
|
|
|
word srcWidth; // keep unscaled sizes
|
|
|
|
word srcHeight;
|
|
|
|
word width; // upload width\height
|
|
|
|
word height;
|
|
|
|
word depth; // texture depth or count of layers for 2D_ARRAY
|
|
|
|
byte numMips; // mipmap count
|
|
|
|
|
|
|
|
GLuint target; // glTarget
|
|
|
|
GLuint texnum; // gl texture binding
|
|
|
|
GLint format; // uploaded format
|
|
|
|
GLint encode; // using GLSL decoder
|
|
|
|
texFlags_t flags;
|
|
|
|
|
|
|
|
rgba_t fogParams; // some water textures
|
|
|
|
// contain info about underwater fog
|
|
|
|
rgbdata_t *original; // keep original image
|
|
|
|
|
|
|
|
// debug info
|
|
|
|
size_t size; // upload size for debug targets
|
|
|
|
|
|
|
|
// detail textures stuff
|
|
|
|
float xscale;
|
|
|
|
float yscale;
|
|
|
|
|
|
|
|
int servercount;
|
|
|
|
uint hashValue;
|
|
|
|
struct gltexture_s *nextHash;
|
2018-10-04 08:08:48 +02:00
|
|
|
} gl_texture_t;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int params; // rendering parameters
|
|
|
|
|
|
|
|
qboolean drawWorld; // ignore world for drawing PlayerModel
|
|
|
|
qboolean isSkyVisible; // sky is visible
|
|
|
|
qboolean onlyClientDraw; // disabled by client request
|
2021-01-03 02:28:45 +01:00
|
|
|
qboolean drawOrtho; // draw world as orthogonal projection
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
float fov_x, fov_y; // current view fov
|
|
|
|
|
|
|
|
cl_entity_t *currententity;
|
|
|
|
model_t *currentmodel;
|
|
|
|
cl_entity_t *currentbeam; // same as above but for beams
|
|
|
|
|
|
|
|
int viewport[4];
|
|
|
|
gl_frustum_t frustum;
|
|
|
|
|
|
|
|
mleaf_t *viewleaf;
|
|
|
|
mleaf_t *oldviewleaf;
|
|
|
|
vec3_t pvsorigin;
|
|
|
|
vec3_t vieworg; // locked vieworigin
|
|
|
|
vec3_t viewangles;
|
|
|
|
vec3_t vforward;
|
|
|
|
vec3_t vright;
|
|
|
|
vec3_t vup;
|
|
|
|
|
|
|
|
vec3_t cullorigin;
|
|
|
|
vec3_t cull_vforward;
|
|
|
|
vec3_t cull_vright;
|
|
|
|
vec3_t cull_vup;
|
|
|
|
|
|
|
|
float farClip;
|
|
|
|
|
|
|
|
qboolean fogCustom;
|
|
|
|
qboolean fogEnabled;
|
|
|
|
qboolean fogSkybox;
|
|
|
|
vec4_t fogColor;
|
|
|
|
float fogDensity;
|
|
|
|
float fogStart;
|
|
|
|
float fogEnd;
|
|
|
|
int cached_contents; // in water
|
|
|
|
int cached_waterlevel; // was in water
|
|
|
|
|
2023-05-19 03:35:54 +02:00
|
|
|
float skyMins[2][SKYBOX_MAX_SIDES];
|
|
|
|
float skyMaxs[2][SKYBOX_MAX_SIDES];
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
matrix4x4 objectMatrix; // currententity matrix
|
|
|
|
matrix4x4 worldviewMatrix; // modelview for world
|
|
|
|
matrix4x4 modelviewMatrix; // worldviewMatrix * objectMatrix
|
|
|
|
|
|
|
|
matrix4x4 projectionMatrix;
|
|
|
|
matrix4x4 worldviewProjectionMatrix; // worldviewMatrix * projectionMatrix
|
|
|
|
byte visbytes[(MAX_MAP_LEAFS+7)/8];// actual PVS for current frame
|
|
|
|
|
|
|
|
float viewplanedist;
|
|
|
|
mplane_t clipPlane;
|
|
|
|
} ref_instance_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
cl_entity_t *solid_entities[MAX_VISIBLE_PACKET]; // opaque moving or alpha brushes
|
|
|
|
cl_entity_t *trans_entities[MAX_VISIBLE_PACKET]; // translucent brushes
|
|
|
|
cl_entity_t *beam_entities[MAX_VISIBLE_PACKET];
|
|
|
|
uint num_solid_entities;
|
|
|
|
uint num_trans_entities;
|
|
|
|
uint num_beam_entities;
|
|
|
|
} draw_list_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2018-04-19 22:11:24 +02:00
|
|
|
int defaultTexture; // use for bad textures
|
|
|
|
int particleTexture;
|
2018-04-13 18:23:45 +02:00
|
|
|
int whiteTexture;
|
|
|
|
int grayTexture;
|
|
|
|
int blackTexture;
|
|
|
|
int solidskyTexture; // quake1 solid-sky layer
|
|
|
|
int alphaskyTexture; // quake1 alpha-sky layer
|
|
|
|
int lightmapTextures[MAX_LIGHTMAPS];
|
|
|
|
int dlightTexture; // custom dlight texture
|
2023-05-19 03:35:54 +02:00
|
|
|
int skyboxTextures[SKYBOX_MAX_SIDES]; // skybox sides
|
2018-04-19 22:11:24 +02:00
|
|
|
int cinTexture; // cinematic texture
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
int skytexturenum; // this not a gl_texturenum!
|
|
|
|
int skyboxbasenum; // start with 5800
|
|
|
|
|
|
|
|
// entity lists
|
|
|
|
draw_list_t draw_stack[MAX_DRAW_STACK];
|
|
|
|
int draw_stack_pos;
|
|
|
|
draw_list_t *draw_list;
|
|
|
|
|
|
|
|
msurface_t *draw_decals[MAX_DECAL_SURFS];
|
|
|
|
int num_draw_decals;
|
2019-07-19 19:23:08 +02:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
// OpenGL matrix states
|
|
|
|
qboolean modelviewIdentity;
|
|
|
|
|
|
|
|
int visframecount; // PVS frame
|
|
|
|
int dlightframecount; // dynamic light frame
|
|
|
|
int realframecount; // not including viewpasses
|
|
|
|
int framecount;
|
|
|
|
|
|
|
|
qboolean ignore_lightgamma;
|
|
|
|
qboolean fCustomRendering;
|
|
|
|
qboolean fResetVis;
|
|
|
|
qboolean fFlipViewModel;
|
|
|
|
|
2019-07-27 12:27:40 +02:00
|
|
|
byte visbytes[(MAX_MAP_LEAFS+7)/8]; // member custom PVS
|
2018-04-13 18:23:45 +02:00
|
|
|
int lightstylevalue[MAX_LIGHTSTYLES]; // value 0 - 65536
|
|
|
|
int block_size; // lightmap blocksize
|
|
|
|
|
|
|
|
double frametime; // special frametime for multipass rendering (will set to 0 on a nextview)
|
|
|
|
float blend; // global blend value
|
|
|
|
|
|
|
|
// cull info
|
|
|
|
vec3_t modelorg; // relative to viewpoint
|
2019-02-27 00:23:03 +01:00
|
|
|
|
|
|
|
qboolean fCustomSkybox;
|
2019-02-18 19:25:26 +01:00
|
|
|
} gl_globals_t;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint c_world_polys;
|
|
|
|
uint c_studio_polys;
|
|
|
|
uint c_sprite_polys;
|
|
|
|
uint c_alias_polys;
|
|
|
|
uint c_world_leafs;
|
|
|
|
|
|
|
|
uint c_view_beams_count;
|
|
|
|
uint c_active_tents_count;
|
|
|
|
uint c_alias_models_drawn;
|
|
|
|
uint c_studio_models_drawn;
|
|
|
|
uint c_sprite_models_drawn;
|
|
|
|
uint c_particle_count;
|
|
|
|
|
|
|
|
uint c_client_ents; // entities that moved to client
|
2018-06-19 15:22:30 +02:00
|
|
|
double t_world_node;
|
|
|
|
double t_world_draw;
|
2018-04-13 18:23:45 +02:00
|
|
|
} ref_speeds_t;
|
|
|
|
|
|
|
|
extern ref_speeds_t r_stats;
|
|
|
|
extern ref_instance_t RI;
|
2019-02-18 19:25:26 +01:00
|
|
|
extern gl_globals_t tr;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
extern float gldepthmin, gldepthmax;
|
|
|
|
#define r_numEntities (tr.draw_list->num_solid_entities + tr.draw_list->num_trans_entities)
|
|
|
|
#define r_numStatics (r_stats.c_client_ents)
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_backend.c
|
|
|
|
//
|
|
|
|
void GL_BackendStartFrame( void );
|
|
|
|
void GL_BackendEndFrame( void );
|
|
|
|
void GL_CleanUpTextureUnits( int last );
|
|
|
|
void GL_Bind( GLint tmu, GLenum texnum );
|
|
|
|
void GL_MultiTexCoord2f( GLenum texture, GLfloat s, GLfloat t );
|
|
|
|
void GL_SetTexCoordArrayMode( GLenum mode );
|
|
|
|
void GL_LoadTexMatrixExt( const float *glmatrix );
|
|
|
|
void GL_LoadMatrix( const matrix4x4 source );
|
|
|
|
void GL_TexGen( GLenum coord, GLenum mode );
|
|
|
|
void GL_SelectTexture( GLint texture );
|
|
|
|
void GL_CleanupAllTextureUnits( void );
|
|
|
|
void GL_LoadIdentityTexMatrix( void );
|
|
|
|
void GL_DisableAllTexGens( void );
|
|
|
|
void GL_SetRenderMode( int mode );
|
2023-08-21 09:01:59 +02:00
|
|
|
void GL_EnableTextureUnit( int tmu, qboolean enable );
|
2018-04-13 18:23:45 +02:00
|
|
|
void GL_TextureTarget( uint target );
|
|
|
|
void GL_Cull( GLenum cull );
|
|
|
|
void R_ShowTextures( void );
|
2019-03-06 14:23:33 +01:00
|
|
|
void SCR_TimeRefresh_f( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
2019-03-15 19:23:59 +01:00
|
|
|
//
|
|
|
|
// gl_beams.c
|
|
|
|
//
|
|
|
|
void CL_DrawBeams( int fTrans, BEAM *active_beams );
|
|
|
|
qboolean R_BeamCull( const vec3_t start, const vec3_t end, qboolean pvsOnly );
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
//
|
|
|
|
// gl_cull.c
|
|
|
|
//
|
|
|
|
int R_CullModel( cl_entity_t *e, const vec3_t absmin, const vec3_t absmax );
|
|
|
|
qboolean R_CullBox( const vec3_t mins, const vec3_t maxs );
|
|
|
|
int R_CullSurface( msurface_t *surf, gl_frustum_t *frustum, uint clipflags );
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_decals.c
|
|
|
|
//
|
|
|
|
void DrawSurfaceDecals( msurface_t *fa, qboolean single, qboolean reverse );
|
|
|
|
float *R_DecalSetupVerts( decal_t *pDecal, msurface_t *surf, int texture, int *outCount );
|
|
|
|
void DrawSingleDecal( decal_t *pDecal, msurface_t *fa );
|
|
|
|
void R_EntityRemoveDecals( model_t *mod );
|
|
|
|
void DrawDecalsBatch( void );
|
|
|
|
void R_ClearDecals( void );
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_draw.c
|
|
|
|
//
|
|
|
|
void R_Set2DMode( qboolean enable );
|
2019-02-24 16:45:27 +01:00
|
|
|
void R_DrawTileClear( int texnum, int x, int y, int w, int h );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_UploadStretchRaw( int texture, int cols, int rows, int width, int height, const byte *data );
|
|
|
|
|
2018-06-09 00:28:35 +02:00
|
|
|
//
|
|
|
|
// gl_drawhulls.c
|
|
|
|
//
|
|
|
|
void R_DrawWorldHull( void );
|
|
|
|
void R_DrawModelHull( void );
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
//
|
|
|
|
// gl_image.c
|
|
|
|
//
|
|
|
|
void R_SetTextureParameters( void );
|
2018-10-04 08:08:48 +02:00
|
|
|
gl_texture_t *R_GetTexture( GLenum texnum );
|
|
|
|
#define GL_LoadTextureInternal( name, pic, flags ) GL_LoadTextureFromBuffer( name, pic, flags, false )
|
|
|
|
#define GL_UpdateTextureInternal( name, pic, flags ) GL_LoadTextureFromBuffer( name, pic, flags, true )
|
2018-10-27 22:31:55 +02:00
|
|
|
int GL_LoadTexture( const char *name, const byte *buf, size_t size, int flags );
|
|
|
|
int GL_LoadTextureArray( const char **names, int flags );
|
2018-10-04 08:08:48 +02:00
|
|
|
int GL_LoadTextureFromBuffer( const char *name, rgbdata_t *pic, texFlags_t flags, qboolean update );
|
2018-04-13 18:23:45 +02:00
|
|
|
byte *GL_ResampleTexture( const byte *source, int in_w, int in_h, int out_w, int out_h, qboolean isNormalMap );
|
|
|
|
int GL_CreateTexture( const char *name, int width, int height, const void *buffer, texFlags_t flags );
|
|
|
|
int GL_CreateTextureArray( const char *name, int width, int height, int depth, const void *buffer, texFlags_t flags );
|
|
|
|
void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor );
|
2018-10-04 08:08:48 +02:00
|
|
|
void GL_UpdateTexSize( int texnum, int width, int height, int depth );
|
|
|
|
void GL_ApplyTextureParams( gl_texture_t *tex );
|
2018-04-13 18:23:45 +02:00
|
|
|
int GL_FindTexture( const char *name );
|
|
|
|
void GL_FreeTexture( GLenum texnum );
|
|
|
|
const char *GL_Target( GLenum target );
|
2018-04-19 22:11:24 +02:00
|
|
|
void R_InitDlightTexture( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_TextureList_f( void );
|
|
|
|
void R_InitImages( void );
|
|
|
|
void R_ShutdownImages( void );
|
2023-10-06 18:24:02 +02:00
|
|
|
int GL_TexMemory( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// gl_rlight.c
|
|
|
|
//
|
2019-03-06 14:23:33 +01:00
|
|
|
void CL_RunLightStyles( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_PushDlights( void );
|
|
|
|
void R_AnimateLight( void );
|
|
|
|
void R_GetLightSpot( vec3_t lightspot );
|
|
|
|
void R_MarkLights( dlight_t *light, int bit, mnode_t *node );
|
2018-06-09 00:28:35 +02:00
|
|
|
colorVec R_LightVec( const vec3_t start, const vec3_t end, vec3_t lightspot, vec3_t lightvec );
|
2018-04-13 18:23:45 +02:00
|
|
|
int R_CountSurfaceDlights( msurface_t *surf );
|
|
|
|
colorVec R_LightPoint( const vec3_t p0 );
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_rmain.c
|
|
|
|
//
|
|
|
|
void R_ClearScene( void );
|
|
|
|
void R_LoadIdentity( void );
|
|
|
|
void R_RenderScene( void );
|
|
|
|
void R_DrawCubemapView( const vec3_t origin, const vec3_t angles, int size );
|
|
|
|
void R_SetupRefParams( const struct ref_viewpass_s *rvp );
|
|
|
|
void R_TranslateForEntity( cl_entity_t *e );
|
|
|
|
void R_RotateForEntity( cl_entity_t *e );
|
|
|
|
void R_SetupGL( qboolean set_gl_state );
|
2019-03-15 19:23:59 +01:00
|
|
|
void R_AllowFog( qboolean allowed );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_SetupFrustum( void );
|
|
|
|
void R_FindViewLeaf( void );
|
2019-06-17 06:05:36 +02:00
|
|
|
void R_CheckGamma( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_PushScene( void );
|
|
|
|
void R_PopScene( void );
|
|
|
|
void R_DrawFog( void );
|
2019-04-15 00:19:05 +02:00
|
|
|
int CL_FxBlend( cl_entity_t *e );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// gl_rmath.c
|
|
|
|
//
|
|
|
|
void Matrix4x4_ToArrayFloatGL( const matrix4x4 in, float out[16] );
|
|
|
|
void Matrix4x4_Concat( matrix4x4 out, const matrix4x4 in1, const matrix4x4 in2 );
|
|
|
|
void Matrix4x4_ConcatTranslate( matrix4x4 out, float x, float y, float z );
|
|
|
|
void Matrix4x4_ConcatRotate( matrix4x4 out, float angle, float x, float y, float z );
|
|
|
|
void Matrix4x4_CreateProjection(matrix4x4 out, float xMax, float xMin, float yMax, float yMin, float zNear, float zFar);
|
|
|
|
void Matrix4x4_CreateOrtho(matrix4x4 m, float xLeft, float xRight, float yBottom, float yTop, float zNear, float zFar);
|
|
|
|
void Matrix4x4_CreateModelview( matrix4x4 out );
|
|
|
|
|
|
|
|
//
|
2019-03-15 19:23:59 +01:00
|
|
|
// gl_rmisc.c
|
2018-04-13 18:23:45 +02:00
|
|
|
//
|
2018-10-27 22:31:55 +02:00
|
|
|
void R_ClearStaticEntities( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// gl_rsurf.c
|
|
|
|
//
|
|
|
|
void R_MarkLeaves( void );
|
|
|
|
void R_DrawWorld( void );
|
|
|
|
void R_DrawWaterSurfaces( void );
|
|
|
|
void R_DrawBrushModel( cl_entity_t *e );
|
|
|
|
void GL_SubdivideSurface( msurface_t *fa );
|
|
|
|
void GL_BuildPolygonFromSurface( model_t *mod, msurface_t *fa );
|
|
|
|
void DrawGLPoly( glpoly_t *p, float xScale, float yScale );
|
|
|
|
texture_t *R_TextureAnimation( msurface_t *s );
|
|
|
|
void GL_SetupFogColorForSurfaces( void );
|
|
|
|
void R_DrawAlphaTextureChains( void );
|
|
|
|
void GL_RebuildLightmaps( void );
|
|
|
|
void GL_InitRandomTable( void );
|
|
|
|
void GL_BuildLightmaps( void );
|
|
|
|
void GL_ResetFogColor( void );
|
2019-10-05 01:07:49 +02:00
|
|
|
void R_GenerateVBO( void );
|
|
|
|
void R_ClearVBO( void );
|
2019-02-06 18:40:38 +01:00
|
|
|
void R_AddDecalVBO( decal_t *pdecal, msurface_t *surf );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
2019-03-15 19:23:59 +01:00
|
|
|
//
|
|
|
|
// gl_rpart.c
|
|
|
|
//
|
|
|
|
void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, float frametime );
|
|
|
|
void CL_DrawParticles( double frametime, particle_t *cl_active_particles, float partsize );
|
|
|
|
void CL_DrawTracers( double frametime, particle_t *cl_active_tracers );
|
|
|
|
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
//
|
|
|
|
// gl_sprite.c
|
|
|
|
//
|
|
|
|
void R_SpriteInit( void );
|
|
|
|
void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, uint texFlags );
|
|
|
|
mspriteframe_t *R_GetSpriteFrame( const model_t *pModel, int frame, float yaw );
|
|
|
|
void R_DrawSpriteModel( cl_entity_t *e );
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_studio.c
|
|
|
|
//
|
|
|
|
void R_StudioInit( void );
|
|
|
|
void R_StudioLerpMovement( cl_entity_t *e, double time, vec3_t origin, vec3_t angles );
|
|
|
|
struct mstudiotex_s *R_StudioGetTexture( cl_entity_t *e );
|
|
|
|
int R_GetEntityRenderMode( cl_entity_t *ent );
|
|
|
|
void R_DrawStudioModel( cl_entity_t *e );
|
|
|
|
player_info_t *pfnPlayerInfo( int index );
|
2018-06-09 00:28:35 +02:00
|
|
|
void R_GatherPlayerLight( void );
|
2023-03-28 19:42:44 +02:00
|
|
|
float R_StudioEstimateFrame( cl_entity_t *e, mstudioseqdesc_t *pseqdesc, double time );
|
2019-03-15 19:23:59 +01:00
|
|
|
void R_StudioLerpMovement( cl_entity_t *e, double time, vec3_t origin, vec3_t angles );
|
2019-03-16 02:17:56 +01:00
|
|
|
void R_StudioResetPlayerModels( void );
|
2019-03-15 19:23:59 +01:00
|
|
|
void CL_InitStudioAPI( void );
|
|
|
|
void Mod_StudioLoadTextures( model_t *mod, void *data );
|
|
|
|
void Mod_StudioUnloadTextures( void *data );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// gl_alias.c
|
|
|
|
//
|
|
|
|
void Mod_LoadAliasModel( model_t *mod, const void *buffer, qboolean *loaded );
|
|
|
|
void R_DrawAliasModel( cl_entity_t *e );
|
|
|
|
void R_AliasInit( void );
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_warp.c
|
|
|
|
//
|
2018-04-17 02:53:01 +02:00
|
|
|
void R_InitSkyClouds( mip_t *mt, struct texture_s *tx, qboolean custom_palette );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_AddSkyBoxSurface( msurface_t *fa );
|
|
|
|
void R_ClearSkyBox( void );
|
|
|
|
void R_DrawSkyBox( void );
|
|
|
|
void R_DrawClouds( void );
|
|
|
|
void EmitWaterPolys( msurface_t *warp, qboolean reverse );
|
|
|
|
|
2019-02-18 19:25:26 +01:00
|
|
|
//
|
|
|
|
// gl_vgui.c
|
|
|
|
//
|
|
|
|
void VGUI_DrawInit( void );
|
|
|
|
void VGUI_DrawShutdown( void );
|
|
|
|
void VGUI_SetupDrawingText( int *pColor );
|
|
|
|
void VGUI_SetupDrawingRect( int *pColor );
|
|
|
|
void VGUI_SetupDrawingImage( int *pColor );
|
|
|
|
void VGUI_BindTexture( int id );
|
|
|
|
void VGUI_EnableTexture( qboolean enable );
|
|
|
|
void VGUI_CreateTexture( int id, int width, int height );
|
|
|
|
void VGUI_UploadTexture( int id, const char *buffer, int width, int height );
|
|
|
|
void VGUI_UploadTextureBlock( int id, int drawX, int drawY, const byte *rgba, int blockWidth, int blockHeight );
|
|
|
|
void VGUI_DrawQuad( const vpoint_t *ul, const vpoint_t *lr );
|
|
|
|
void VGUI_GetTextureSizes( int *width, int *height );
|
|
|
|
int VGUI_GenerateTexture( void );
|
|
|
|
|
2019-03-16 12:15:05 +01:00
|
|
|
//#include "vid_common.h"
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// renderer exports
|
|
|
|
//
|
|
|
|
qboolean R_Init( void );
|
|
|
|
void R_Shutdown( void );
|
2019-03-16 03:15:32 +01:00
|
|
|
void GL_SetupAttributes( int safegl );
|
|
|
|
void GL_OnContextCreated( void );
|
2019-03-15 19:23:59 +01:00
|
|
|
void GL_InitExtensions( void );
|
|
|
|
void GL_ClearExtensions( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
void VID_CheckChanges( void );
|
2018-10-27 22:31:55 +02:00
|
|
|
int GL_LoadTexture( const char *name, const byte *buf, size_t size, int flags );
|
2018-04-13 18:23:45 +02:00
|
|
|
void GL_FreeImage( const char *name );
|
|
|
|
qboolean VID_ScreenShot( const char *filename, int shot_type );
|
|
|
|
qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qboolean skyshot );
|
|
|
|
void R_BeginFrame( qboolean clearScene );
|
2019-05-12 17:02:59 +02:00
|
|
|
void R_RenderFrame( const struct ref_viewpass_s *vp );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_EndFrame( void );
|
|
|
|
void R_ClearScene( void );
|
|
|
|
void R_GetTextureParms( int *w, int *h, int texnum );
|
|
|
|
void R_GetSpriteParms( int *frameWidth, int *frameHeight, int *numFrames, int curFrame, const struct model_s *pSprite );
|
|
|
|
void R_DrawStretchRaw( float x, float y, float w, float h, int cols, int rows, const byte *data, qboolean dirty );
|
|
|
|
void R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, int texnum );
|
|
|
|
qboolean R_SpeedsMessage( char *out, size_t size );
|
|
|
|
void R_SetupSky( const char *skyboxname );
|
|
|
|
qboolean R_CullBox( const vec3_t mins, const vec3_t maxs );
|
2018-04-23 22:07:54 +02:00
|
|
|
int R_WorldToScreen( const vec3_t point, vec3_t screen );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_ScreenToWorld( const vec3_t screen, vec3_t point );
|
|
|
|
qboolean R_AddEntity( struct cl_entity_s *pRefEntity, int entityType );
|
|
|
|
void Mod_LoadMapSprite( struct model_s *mod, const void *buffer, size_t size, qboolean *loaded );
|
2019-03-17 12:26:57 +01:00
|
|
|
void Mod_SpriteUnloadTextures( void *data );
|
2018-04-13 18:23:45 +02:00
|
|
|
void Mod_UnloadAliasModel( struct model_s *mod );
|
2019-03-17 12:26:57 +01:00
|
|
|
void Mod_AliasUnloadTextures( void *data );
|
2018-04-13 18:23:45 +02:00
|
|
|
void GL_SetRenderMode( int mode );
|
|
|
|
void R_RunViewmodelEvents( void );
|
|
|
|
void R_DrawViewModel( void );
|
|
|
|
int R_GetSpriteTexture( const struct model_s *m_pSpriteModel, int frame );
|
|
|
|
void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos, int flags, float scale );
|
|
|
|
void R_RemoveEfrags( struct cl_entity_s *ent );
|
|
|
|
void R_AddEfrags( struct cl_entity_s *ent );
|
|
|
|
void R_DecalRemoveAll( int texture );
|
2019-03-15 19:23:59 +01:00
|
|
|
int R_CreateDecalList( decallist_t *pList );
|
|
|
|
void R_ClearAllDecals( void );
|
2018-04-13 18:23:45 +02:00
|
|
|
byte *Mod_GetCurrentVis( void );
|
2019-03-15 19:23:59 +01:00
|
|
|
void Mod_SetOrthoBounds( const float *mins, const float *maxs );
|
2018-04-13 18:23:45 +02:00
|
|
|
void R_NewMap( void );
|
2019-03-15 19:23:59 +01:00
|
|
|
void CL_AddCustomBeam( cl_entity_t *pEnvBeam );
|
2018-04-13 18:23:45 +02:00
|
|
|
|
2019-02-24 16:45:27 +01:00
|
|
|
//
|
|
|
|
// gl_opengl.c
|
|
|
|
//
|
|
|
|
#define GL_CheckForErrors() GL_CheckForErrors_( __FILE__, __LINE__ )
|
|
|
|
void GL_CheckForErrors_( const char *filename, const int fileline );
|
|
|
|
const char *GL_ErrorString( int err );
|
|
|
|
qboolean GL_Support( int r_ext );
|
|
|
|
int GL_MaxTextureUnits( void );
|
2019-08-08 04:52:36 +02:00
|
|
|
qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, const char *cvarname, int r_ext );
|
2019-02-24 16:45:27 +01:00
|
|
|
void GL_SetExtension( int r_ext, int enable );
|
|
|
|
|
|
|
|
//
|
|
|
|
// gl_triapi.c
|
|
|
|
//
|
2019-03-15 19:23:59 +01:00
|
|
|
void TriRenderMode( int mode );
|
2019-02-24 16:45:27 +01:00
|
|
|
void TriBegin( int mode );
|
|
|
|
void TriEnd( void );
|
|
|
|
void TriTexCoord2f( float u, float v );
|
|
|
|
void TriVertex3fv( const float *v );
|
|
|
|
void TriVertex3f( float x, float y, float z );
|
2019-03-15 19:23:59 +01:00
|
|
|
void _TriColor4f( float r, float g, float b, float a );
|
2019-03-28 16:11:10 +01:00
|
|
|
void _TriColor4ub( byte r, byte g, byte b, byte a );
|
2019-03-22 14:36:46 +01:00
|
|
|
void TriColor4f( float r, float g, float b, float a );
|
2019-03-15 19:23:59 +01:00
|
|
|
void TriColor4ub( byte r, byte g, byte b, byte a );
|
2019-03-22 14:36:46 +01:00
|
|
|
void TriBrightness( float brightness );
|
|
|
|
int TriWorldToScreen( const float *world, float *screen );
|
2019-02-24 16:45:27 +01:00
|
|
|
int TriSpriteTexture( model_t *pSpriteModel, int frame );
|
2019-03-15 19:23:59 +01:00
|
|
|
void TriFog( float flFogColor[3], float flStart, float flEnd, int bOn );
|
|
|
|
void TriGetMatrix( const int pname, float *matrix );
|
|
|
|
void TriFogParams( float flDensity, int iFogSkybox );
|
|
|
|
void TriCullFace( TRICULLSTYLE mode );
|
2019-02-24 16:45:27 +01:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
/*
|
|
|
|
=======================================================================
|
|
|
|
|
|
|
|
GL STATE MACHINE
|
|
|
|
|
|
|
|
=======================================================================
|
|
|
|
*/
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
GL_OPENGL_110 = 0, // base
|
|
|
|
GL_ARB_MULTITEXTURE,
|
|
|
|
GL_TEXTURE_CUBEMAP_EXT,
|
|
|
|
GL_ANISOTROPY_EXT,
|
|
|
|
GL_TEXTURE_LOD_BIAS,
|
|
|
|
GL_TEXTURE_COMPRESSION_EXT,
|
|
|
|
GL_SHADER_GLSL100_EXT,
|
|
|
|
GL_TEXTURE_2D_RECT_EXT,
|
|
|
|
GL_TEXTURE_ARRAY_EXT,
|
|
|
|
GL_TEXTURE_3D_EXT,
|
|
|
|
GL_CLAMPTOEDGE_EXT,
|
|
|
|
GL_ARB_TEXTURE_NPOT_EXT,
|
|
|
|
GL_CLAMP_TEXBORDER_EXT,
|
|
|
|
GL_ARB_TEXTURE_FLOAT_EXT,
|
|
|
|
GL_ARB_DEPTH_FLOAT_EXT,
|
|
|
|
GL_ARB_SEAMLESS_CUBEMAP,
|
|
|
|
GL_EXT_GPU_SHADER4, // shaders only
|
|
|
|
GL_DEPTH_TEXTURE,
|
|
|
|
GL_DEBUG_OUTPUT,
|
2019-02-06 18:12:33 +01:00
|
|
|
GL_ARB_VERTEX_BUFFER_OBJECT_EXT,
|
2019-11-17 16:51:03 +01:00
|
|
|
GL_DRAW_RANGEELEMENTS_EXT,
|
2021-11-22 10:48:39 +01:00
|
|
|
GL_TEXTURE_MULTISAMPLE,
|
2022-03-03 10:23:00 +01:00
|
|
|
GL_ARB_TEXTURE_COMPRESSION_BPTC,
|
2023-10-04 23:24:40 +02:00
|
|
|
GL_SHADER_OBJECTS_EXT,
|
2023-10-05 02:32:02 +02:00
|
|
|
GL_ARB_VERTEX_ARRAY_OBJECT_EXT,
|
2018-04-13 18:23:45 +02:00
|
|
|
GL_EXTCOUNT, // must be last
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GLHW_GENERIC, // where everthing works the way it should
|
|
|
|
GLHW_RADEON, // where you don't have proper GLSL support
|
|
|
|
GLHW_NVIDIA, // Geforce 8/9 class DX10 hardware
|
|
|
|
GLHW_INTEL // Intel Mobile Graphics
|
|
|
|
} glHWType_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char *renderer_string; // ptrs to OpenGL32.dll, use with caution
|
|
|
|
const char *vendor_string;
|
|
|
|
const char *version_string;
|
|
|
|
|
|
|
|
glHWType_t hardware_type;
|
|
|
|
|
|
|
|
// list of supported extensions
|
|
|
|
const char *extensions_string;
|
|
|
|
byte extension[GL_EXTCOUNT];
|
|
|
|
|
|
|
|
int max_texture_units;
|
|
|
|
int max_texture_coords;
|
|
|
|
int max_teximage_units;
|
|
|
|
GLint max_2d_texture_size;
|
|
|
|
GLint max_2d_rectangle_size;
|
|
|
|
GLint max_2d_texture_layers;
|
|
|
|
GLint max_3d_texture_size;
|
|
|
|
GLint max_cubemap_size;
|
|
|
|
|
|
|
|
GLfloat max_texture_anisotropy;
|
|
|
|
GLfloat max_texture_lod_bias;
|
|
|
|
|
|
|
|
GLint max_vertex_uniforms;
|
|
|
|
GLint max_vertex_attribs;
|
|
|
|
|
2018-04-19 22:11:24 +02:00
|
|
|
GLint max_multisamples;
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
int color_bits;
|
|
|
|
int alpha_bits;
|
|
|
|
int depth_bits;
|
|
|
|
int stencil_bits;
|
2018-04-17 02:53:01 +02:00
|
|
|
int msaasamples;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
gl_context_type_t context;
|
|
|
|
gles_wrapper_t wrapper;
|
|
|
|
|
|
|
|
qboolean softwareGammaUpdate;
|
2019-06-17 06:05:36 +02:00
|
|
|
qboolean fCustomRenderer;
|
2018-04-17 02:53:01 +02:00
|
|
|
int prev_width;
|
|
|
|
int prev_height;
|
2018-04-13 18:23:45 +02:00
|
|
|
} glconfig_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
|
2019-02-23 19:49:46 +01:00
|
|
|
int width, height;
|
2018-04-13 18:23:45 +02:00
|
|
|
int activeTMU;
|
|
|
|
GLint currentTextures[MAX_TEXTURE_UNITS];
|
2023-05-16 22:44:52 +02:00
|
|
|
GLint currentTexturesIndex[MAX_TEXTURE_UNITS];
|
2018-04-13 18:23:45 +02:00
|
|
|
GLuint currentTextureTargets[MAX_TEXTURE_UNITS];
|
|
|
|
GLboolean texIdentityMatrix[MAX_TEXTURE_UNITS];
|
|
|
|
GLint genSTEnabled[MAX_TEXTURE_UNITS]; // 0 - disabled, OR 1 - S, OR 2 - T, OR 4 - R
|
|
|
|
GLint texCoordArrayMode[MAX_TEXTURE_UNITS]; // 0 - disabled, 1 - enabled, 2 - cubemap
|
2019-05-19 14:01:23 +02:00
|
|
|
GLint isFogEnabled;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
|
|
|
int faceCull;
|
|
|
|
|
|
|
|
qboolean stencilEnabled;
|
|
|
|
qboolean in2DMode;
|
|
|
|
} glstate_t;
|
|
|
|
|
2019-03-16 12:15:05 +01:00
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
qboolean initialized; // OpenGL subsystem started
|
|
|
|
qboolean extended; // extended context allows to GL_Debug
|
|
|
|
} glwstate_t;
|
|
|
|
|
|
|
|
extern glconfig_t glConfig;
|
|
|
|
extern glstate_t glState;
|
2019-02-23 19:49:46 +01:00
|
|
|
// move to engine
|
2019-03-16 12:15:05 +01:00
|
|
|
extern glwstate_t glw_state;
|
2019-02-24 16:45:27 +01:00
|
|
|
extern ref_api_t gEngfuncs;
|
|
|
|
extern ref_globals_t *gpGlobals;
|
2018-04-13 18:23:45 +02:00
|
|
|
|
2019-03-22 14:36:46 +01:00
|
|
|
#define ENGINE_GET_PARM_ (*gEngfuncs.EngineGetParm)
|
|
|
|
#define ENGINE_GET_PARM( parm ) ENGINE_GET_PARM_( ( parm ), 0 )
|
|
|
|
|
2018-04-13 18:23:45 +02:00
|
|
|
//
|
|
|
|
// renderer cvars
|
|
|
|
//
|
2023-05-20 19:27:15 +02:00
|
|
|
extern convar_t gl_texture_anisotropy;
|
|
|
|
extern convar_t gl_extensions;
|
|
|
|
extern convar_t gl_check_errors;
|
|
|
|
extern convar_t gl_texture_lodbias;
|
|
|
|
extern convar_t gl_texture_nearest;
|
|
|
|
extern convar_t gl_lightmap_nearest;
|
|
|
|
extern convar_t gl_keeptjunctions;
|
|
|
|
extern convar_t gl_round_down;
|
|
|
|
extern convar_t gl_wireframe;
|
|
|
|
extern convar_t gl_polyoffset;
|
|
|
|
extern convar_t gl_finish;
|
|
|
|
extern convar_t gl_nosort;
|
|
|
|
extern convar_t gl_test; // cvar to testify new effects
|
|
|
|
extern convar_t gl_msaa;
|
|
|
|
extern convar_t gl_stencilbits;
|
|
|
|
|
|
|
|
extern convar_t r_lighting_extended;
|
|
|
|
extern convar_t r_lighting_ambient;
|
|
|
|
extern convar_t r_studio_lambert;
|
|
|
|
extern convar_t r_detailtextures;
|
|
|
|
extern convar_t r_novis;
|
|
|
|
extern convar_t r_nocull;
|
|
|
|
extern convar_t r_lockpvs;
|
|
|
|
extern convar_t r_lockfrustum;
|
|
|
|
extern convar_t r_traceglow;
|
|
|
|
extern convar_t r_vbo;
|
|
|
|
extern convar_t r_vbo_dlightmode;
|
2023-10-14 07:11:25 +02:00
|
|
|
extern convar_t r_studio_sort_textures;
|
|
|
|
extern convar_t r_studio_drawelements;
|
2018-04-17 02:53:01 +02:00
|
|
|
|
2019-02-24 16:45:27 +01:00
|
|
|
//
|
|
|
|
// engine shared convars
|
|
|
|
//
|
2021-12-06 02:57:32 +01:00
|
|
|
DECLARE_ENGINE_SHARED_CVAR_LIST()
|
2019-02-24 16:45:27 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// engine callbacks
|
|
|
|
//
|
|
|
|
#include "crtlib.h"
|
|
|
|
|
2019-03-06 15:14:25 +01:00
|
|
|
#define Mem_Malloc( pool, size ) gEngfuncs._Mem_Alloc( pool, size, false, __FILE__, __LINE__ )
|
|
|
|
#define Mem_Calloc( pool, size ) gEngfuncs._Mem_Alloc( pool, size, true, __FILE__, __LINE__ )
|
|
|
|
#define Mem_Realloc( pool, ptr, size ) gEngfuncs._Mem_Realloc( pool, ptr, size, true, __FILE__, __LINE__ )
|
|
|
|
#define Mem_Free( mem ) gEngfuncs._Mem_Free( mem, __FILE__, __LINE__ )
|
|
|
|
#define Mem_AllocPool( name ) gEngfuncs._Mem_AllocPool( name, __FILE__, __LINE__ )
|
|
|
|
#define Mem_FreePool( pool ) gEngfuncs._Mem_FreePool( pool, __FILE__, __LINE__ )
|
|
|
|
#define Mem_EmptyPool( pool ) gEngfuncs._Mem_EmptyPool( pool, __FILE__, __LINE__ )
|
2019-02-24 16:45:27 +01:00
|
|
|
|
|
|
|
#endif // GL_LOCAL_H
|