2019-03-19 22:29:25 +01:00
|
|
|
/*
|
|
|
|
vid_sdl.c - SDL vid component
|
|
|
|
Copyright (C) 2018 a1batross
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "r_local.h"
|
|
|
|
|
|
|
|
ref_api_t gEngfuncs;
|
|
|
|
ref_globals_t *gpGlobals;
|
|
|
|
gl_globals_t tr;
|
|
|
|
ref_speeds_t r_stats;
|
2021-06-01 18:28:52 +02:00
|
|
|
poolhandle_t r_temppool;
|
2019-03-19 22:29:25 +01:00
|
|
|
viddef_t vid;
|
2019-04-08 00:09:02 +02:00
|
|
|
static void GAME_EXPORT R_ClearScreen( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static const byte * GAME_EXPORT R_GetTextureOriginalBuffer( unsigned int idx )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
2021-03-02 15:49:31 +01:00
|
|
|
image_t *glt = R_GetTexture( idx );
|
2019-03-19 22:29:25 +01:00
|
|
|
|
|
|
|
if( !glt || !glt->original || !glt->original->buffer )
|
2021-03-02 15:49:31 +01:00
|
|
|
return NULL;
|
2019-03-19 22:29:25 +01:00
|
|
|
|
2021-03-02 15:49:31 +01:00
|
|
|
return glt->original->buffer;
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
CL_FillRGBA
|
|
|
|
|
|
|
|
=============
|
|
|
|
*/
|
2019-04-08 00:09:02 +02:00
|
|
|
static void GAME_EXPORT CL_FillRGBA( float _x, float _y, float _w, float _h, int r, int g, int b, int a )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
2019-04-03 23:44:06 +02:00
|
|
|
vid.rendermode = kRenderTransAdd;
|
|
|
|
_TriColor4ub(r,g,b,a);
|
|
|
|
Draw_Fill(_x,_y,_w,_h);
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
pfnFillRGBABlend
|
|
|
|
|
|
|
|
=============
|
|
|
|
*/
|
|
|
|
static void GAME_EXPORT CL_FillRGBABlend( float _x, float _y, float _w, float _h, int r, int g, int b, int a )
|
|
|
|
{
|
2019-04-03 23:44:06 +02:00
|
|
|
vid.rendermode = kRenderTransAlpha;
|
|
|
|
_TriColor4ub(r,g,b,a);
|
|
|
|
Draw_Fill(_x,_y,_w,_h);
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
2019-04-13 15:50:27 +02:00
|
|
|
void Mod_UnloadTextures( model_t *mod );
|
2019-03-19 22:29:25 +01:00
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
qboolean GAME_EXPORT Mod_ProcessRenderData( model_t *mod, qboolean create, const byte *buf )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
qboolean loaded = true;
|
|
|
|
|
|
|
|
if( create )
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
switch( mod->type )
|
|
|
|
{
|
|
|
|
case mod_studio:
|
2019-03-30 14:24:58 +01:00
|
|
|
//Mod_LoadStudioModel( mod, buf, loaded );
|
2019-03-19 22:29:25 +01:00
|
|
|
break;
|
|
|
|
case mod_sprite:
|
2019-03-30 14:24:58 +01:00
|
|
|
Mod_LoadSpriteModel( mod, buf, &loaded, mod->numtexinfo );
|
2019-03-19 22:29:25 +01:00
|
|
|
break;
|
|
|
|
case mod_alias:
|
|
|
|
//Mod_LoadAliasModel( mod, buf, &loaded );
|
|
|
|
break;
|
|
|
|
case mod_brush:
|
|
|
|
// Mod_LoadBrushModel( mod, buf, loaded );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: gEngfuncs.Host_Error( "Mod_LoadModel: unsupported type %d\n", mod->type );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( loaded && gEngfuncs.drawFuncs->Mod_ProcessUserData )
|
|
|
|
gEngfuncs.drawFuncs->Mod_ProcessUserData( mod, create, buf );
|
|
|
|
|
2019-04-13 15:50:27 +02:00
|
|
|
if( !create )
|
|
|
|
Mod_UnloadTextures( mod );
|
2019-03-19 22:29:25 +01:00
|
|
|
|
|
|
|
return loaded;
|
|
|
|
}
|
|
|
|
|
2019-04-17 01:11:11 +02:00
|
|
|
|
|
|
|
static int GL_RefGetParm( int parm, int arg )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
image_t *glt;
|
|
|
|
|
|
|
|
switch( parm )
|
|
|
|
{
|
|
|
|
case PARM_TEX_WIDTH:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->width;
|
|
|
|
case PARM_TEX_HEIGHT:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->height;
|
|
|
|
case PARM_TEX_SRC_WIDTH:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->srcWidth;
|
|
|
|
case PARM_TEX_SRC_HEIGHT:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->srcHeight;
|
2019-04-17 01:11:11 +02:00
|
|
|
case PARM_TEX_GLFORMAT:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return 0; //glt->format;
|
|
|
|
case PARM_TEX_ENCODE:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return 0; //glt->encode;
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_TEX_MIPCOUNT:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->numMips;
|
|
|
|
case PARM_TEX_DEPTH:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->depth;
|
|
|
|
case PARM_TEX_SKYBOX:
|
|
|
|
Assert( arg >= 0 && arg < 6 );
|
|
|
|
return tr.skyboxTextures[arg];
|
|
|
|
case PARM_TEX_SKYTEXNUM:
|
2019-04-17 01:11:11 +02:00
|
|
|
return 0; //tr.skytexturenum;
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_TEX_LIGHTMAP:
|
|
|
|
arg = bound( 0, arg, MAX_LIGHTMAPS - 1 );
|
|
|
|
return tr.lightmapTextures[arg];
|
2019-04-17 01:11:11 +02:00
|
|
|
case PARM_TEX_TARGET:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return 0; //glt->target;
|
|
|
|
case PARM_TEX_TEXNUM:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return 0; //glt->texnum;
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_TEX_FLAGS:
|
|
|
|
glt = R_GetTexture( arg );
|
|
|
|
return glt->flags;
|
2023-10-06 18:24:02 +02:00
|
|
|
case PARM_TEX_MEMORY:
|
|
|
|
return R_TexMemory();
|
2019-04-17 01:11:11 +02:00
|
|
|
case PARM_ACTIVE_TMU:
|
|
|
|
return 0; //glState.activeTMU;
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_LIGHTSTYLEVALUE:
|
|
|
|
arg = bound( 0, arg, MAX_LIGHTSTYLES - 1 );
|
|
|
|
return tr.lightstylevalue[arg];
|
|
|
|
case PARM_MAX_IMAGE_UNITS:
|
2019-04-17 01:11:11 +02:00
|
|
|
return 0; //GL_MaxTextureUnits();
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_REBUILD_GAMMA:
|
2019-04-17 01:34:01 +02:00
|
|
|
return 0;
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_SURF_SAMPLESIZE:
|
|
|
|
if( arg >= 0 && arg < WORLDMODEL->numsurfaces )
|
|
|
|
return gEngfuncs.Mod_SampleSizeForFace( &WORLDMODEL->surfaces[arg] );
|
|
|
|
return LM_SAMPLE_SIZE;
|
2019-04-17 01:11:11 +02:00
|
|
|
case PARM_GL_CONTEXT_TYPE:
|
|
|
|
return 0; //glConfig.context;
|
|
|
|
case PARM_GLES_WRAPPER:
|
|
|
|
return 0; //glConfig.wrapper;
|
|
|
|
case PARM_STENCIL_ACTIVE:
|
|
|
|
return 0; //glState.stencilEnabled;
|
2019-03-19 22:29:25 +01:00
|
|
|
case PARM_SKY_SPHERE:
|
2019-03-22 18:46:57 +01:00
|
|
|
return ENGINE_GET_PARM_( parm, arg ) && !tr.fCustomSkybox;
|
2019-03-19 22:29:25 +01:00
|
|
|
default:
|
2019-03-22 18:46:57 +01:00
|
|
|
return ENGINE_GET_PARM_( parm, arg );
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static void GAME_EXPORT R_GetDetailScaleForTexture( int texture, float *xScale, float *yScale )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
image_t *glt = R_GetTexture( texture );
|
|
|
|
|
|
|
|
if( xScale ) *xScale = glt->xscale;
|
|
|
|
if( yScale ) *yScale = glt->yscale;
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static void GAME_EXPORT R_GetExtraParmsForTexture( int texture, byte *red, byte *green, byte *blue, byte *density )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
image_t *glt = R_GetTexture( texture );
|
|
|
|
|
|
|
|
if( red ) *red = glt->fogParams[0];
|
|
|
|
if( green ) *green = glt->fogParams[1];
|
|
|
|
if( blue ) *blue = glt->fogParams[2];
|
|
|
|
if( density ) *density = glt->fogParams[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static void GAME_EXPORT R_SetCurrentEntity( cl_entity_t *ent )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
RI.currententity = ent;
|
|
|
|
|
|
|
|
// set model also
|
|
|
|
if( RI.currententity != NULL )
|
|
|
|
{
|
|
|
|
RI.currentmodel = RI.currententity->model;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static void GAME_EXPORT R_SetCurrentModel( model_t *mod )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
RI.currentmodel = mod;
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static float GAME_EXPORT R_GetFrameTime( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
return tr.frametime;
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
static const char * GAME_EXPORT GL_TextureName( unsigned int texnum )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
2021-03-02 15:49:31 +01:00
|
|
|
return R_GetTexture( texnum )->name;
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
const byte * GAME_EXPORT GL_TextureData( unsigned int texnum )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
2021-03-02 15:49:31 +01:00
|
|
|
rgbdata_t *pic = R_GetTexture( texnum )->original;
|
2019-03-19 22:29:25 +01:00
|
|
|
|
2021-03-02 15:49:31 +01:00
|
|
|
if( pic != NULL )
|
|
|
|
return pic->buffer;
|
2019-03-19 22:29:25 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Mod_BrushUnloadTextures( model_t *mod )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2019-04-13 15:50:27 +02:00
|
|
|
|
|
|
|
gEngfuncs.Con_Printf("Unloading world\n");
|
|
|
|
tr.map_unload = true;
|
|
|
|
|
2019-03-19 22:29:25 +01:00
|
|
|
for( i = 0; i < mod->numtextures; i++ )
|
|
|
|
{
|
|
|
|
texture_t *tx = mod->textures[i];
|
|
|
|
if( !tx || tx->gl_texturenum == tr.defaultTexture )
|
|
|
|
continue; // free slot
|
|
|
|
|
2019-03-25 05:59:25 +01:00
|
|
|
GL_FreeTexture( tx->gl_texturenum ); // main texture
|
|
|
|
GL_FreeTexture( tx->fb_texturenum ); // luma texture
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Mod_UnloadTextures( model_t *mod )
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
Assert( mod != NULL );
|
|
|
|
|
|
|
|
switch( mod->type )
|
|
|
|
{
|
|
|
|
case mod_studio:
|
|
|
|
//Mod_StudioUnloadTextures( mod->cache.data );
|
|
|
|
break;
|
|
|
|
case mod_alias:
|
|
|
|
//Mod_AliasUnloadTextures( mod->cache.data );
|
|
|
|
break;
|
|
|
|
case mod_brush:
|
|
|
|
Mod_BrushUnloadTextures( mod );
|
|
|
|
break;
|
|
|
|
case mod_sprite:
|
2019-03-30 14:24:58 +01:00
|
|
|
Mod_SpriteUnloadTextures( mod->cache.data );
|
2019-03-19 22:29:25 +01:00
|
|
|
break;
|
|
|
|
default: gEngfuncs.Host_Error( "Mod_UnloadModel: unsupported type %d\n", mod->type );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT R_ProcessEntData( qboolean allocate )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// stubs
|
|
|
|
|
2020-01-25 09:54:56 +01:00
|
|
|
void GAME_EXPORT GL_SetTexCoordArrayMode( uint mode )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2019-03-22 13:33:14 +01:00
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
void GAME_EXPORT GL_BackendStartFrame( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
void GAME_EXPORT GL_BackendEndFrame( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_SetRenderMode(int mode)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
2019-03-20 15:44:21 +01:00
|
|
|
vid.rendermode = mode;
|
2019-03-19 22:29:25 +01:00
|
|
|
/// TODO: table shading/blending???
|
|
|
|
/// maybe, setup block drawing function pointers here
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
void GAME_EXPORT R_ShowTextures( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
// textures undone too
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
void GAME_EXPORT R_ShowTree( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
// do we really need this here???
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT R_SetupSky(const char *skyboxname)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
qboolean GAME_EXPORT VID_CubemapShot(const char *base, uint size, const float *vieworg, qboolean skyshot)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
// cubemaps? in my softrender???
|
2019-05-12 17:05:03 +02:00
|
|
|
return false;
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void R_InitSkyClouds(mip_t *mt, texture_t *tx, qboolean custom_palette)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_SubdivideSurface(msurface_t *fa)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT DrawSingleDecal(decal_t *pDecal, msurface_t *fa)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_SelectTexture(int texture)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_LoadTexMatrixExt(const float *glmatrix)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
void GAME_EXPORT GL_LoadIdentityTexMatrix( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_CleanUpTextureUnits(int last)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_TexGen(unsigned int coord, unsigned int mode)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT GL_TextureTarget(uint target)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
void GAME_EXPORT GL_BuildLightmaps( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
2019-03-27 15:34:37 +01:00
|
|
|
CL_RunLightStyles();
|
2019-03-19 22:29:25 +01:00
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
void GAME_EXPORT Mod_SetOrthoBounds(const float *mins, const float *maxs)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-04-08 00:09:02 +02:00
|
|
|
qboolean GAME_EXPORT R_SpeedsMessage(char *out, size_t size)
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:28:08 +02:00
|
|
|
byte *GAME_EXPORT Mod_GetCurrentVis( void )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-10-10 04:03:37 +02:00
|
|
|
const char *R_GetConfigName( void )
|
|
|
|
{
|
|
|
|
return "ref_soft"; // software specific cvars will go to ref_soft.cfg
|
|
|
|
}
|
|
|
|
|
2020-03-29 15:58:27 +02:00
|
|
|
static void* GAME_EXPORT R_GetProcAddress( const char *name )
|
|
|
|
{
|
|
|
|
return gEngfuncs.GL_GetProcAddress( name );
|
|
|
|
}
|
|
|
|
|
2019-03-19 22:29:25 +01:00
|
|
|
ref_interface_t gReffuncs =
|
|
|
|
{
|
|
|
|
R_Init,
|
|
|
|
R_Shutdown,
|
2019-10-10 04:03:37 +02:00
|
|
|
R_GetConfigName,
|
2019-10-30 19:43:40 +01:00
|
|
|
R_SetDisplayTransform,
|
2019-03-19 22:29:25 +01:00
|
|
|
|
|
|
|
GL_SetupAttributes,
|
|
|
|
GL_InitExtensions,
|
|
|
|
GL_ClearExtensions,
|
|
|
|
|
|
|
|
R_BeginFrame,
|
|
|
|
R_RenderScene,
|
|
|
|
R_EndFrame,
|
|
|
|
R_PushScene,
|
|
|
|
R_PopScene,
|
|
|
|
GL_BackendStartFrame,
|
|
|
|
GL_BackendEndFrame,
|
|
|
|
|
|
|
|
R_ClearScreen,
|
|
|
|
R_AllowFog,
|
|
|
|
GL_SetRenderMode,
|
|
|
|
|
|
|
|
R_AddEntity,
|
|
|
|
CL_AddCustomBeam,
|
|
|
|
R_ProcessEntData,
|
|
|
|
|
|
|
|
R_ShowTextures,
|
|
|
|
|
|
|
|
R_GetTextureOriginalBuffer,
|
|
|
|
GL_LoadTextureFromBuffer,
|
|
|
|
GL_ProcessTexture,
|
|
|
|
R_SetupSky,
|
|
|
|
|
|
|
|
R_Set2DMode,
|
|
|
|
R_DrawStretchRaw,
|
|
|
|
R_DrawStretchPic,
|
|
|
|
R_DrawTileClear,
|
|
|
|
CL_FillRGBA,
|
|
|
|
CL_FillRGBABlend,
|
2021-10-30 17:49:52 +02:00
|
|
|
R_WorldToScreen,
|
2019-03-19 22:29:25 +01:00
|
|
|
|
|
|
|
VID_ScreenShot,
|
|
|
|
VID_CubemapShot,
|
|
|
|
|
|
|
|
R_LightPoint,
|
|
|
|
|
|
|
|
R_DecalShoot,
|
|
|
|
R_DecalRemoveAll,
|
|
|
|
R_CreateDecalList,
|
|
|
|
R_ClearAllDecals,
|
|
|
|
|
|
|
|
R_StudioEstimateFrame,
|
|
|
|
R_StudioLerpMovement,
|
|
|
|
CL_InitStudioAPI,
|
|
|
|
|
|
|
|
R_InitSkyClouds,
|
|
|
|
GL_SubdivideSurface,
|
|
|
|
CL_RunLightStyles,
|
|
|
|
|
|
|
|
R_GetSpriteParms,
|
|
|
|
R_GetSpriteTexture,
|
|
|
|
|
|
|
|
Mod_LoadMapSprite,
|
|
|
|
Mod_ProcessRenderData,
|
|
|
|
Mod_StudioLoadTextures,
|
|
|
|
|
|
|
|
CL_DrawParticles,
|
|
|
|
CL_DrawTracers,
|
|
|
|
CL_DrawBeams,
|
|
|
|
R_BeamCull,
|
|
|
|
|
2019-04-17 01:11:11 +02:00
|
|
|
GL_RefGetParm,
|
2019-03-19 22:29:25 +01:00
|
|
|
R_GetDetailScaleForTexture,
|
|
|
|
R_GetExtraParmsForTexture,
|
|
|
|
R_GetFrameTime,
|
|
|
|
|
|
|
|
R_SetCurrentEntity,
|
|
|
|
R_SetCurrentModel,
|
|
|
|
|
|
|
|
GL_FindTexture,
|
|
|
|
GL_TextureName,
|
|
|
|
GL_TextureData,
|
|
|
|
GL_LoadTexture,
|
|
|
|
GL_CreateTexture,
|
|
|
|
GL_LoadTextureArray,
|
|
|
|
GL_CreateTextureArray,
|
|
|
|
GL_FreeTexture,
|
|
|
|
|
|
|
|
DrawSingleDecal,
|
|
|
|
R_DecalSetupVerts,
|
|
|
|
R_EntityRemoveDecals,
|
|
|
|
|
|
|
|
R_UploadStretchRaw,
|
|
|
|
|
|
|
|
GL_Bind,
|
|
|
|
GL_SelectTexture,
|
|
|
|
GL_LoadTexMatrixExt,
|
|
|
|
GL_LoadIdentityTexMatrix,
|
|
|
|
GL_CleanUpTextureUnits,
|
|
|
|
GL_TexGen,
|
|
|
|
GL_TextureTarget,
|
|
|
|
GL_SetTexCoordArrayMode,
|
|
|
|
GL_UpdateTexSize,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
|
|
|
|
CL_DrawParticlesExternal,
|
|
|
|
R_LightVec,
|
|
|
|
R_StudioGetTexture,
|
|
|
|
|
|
|
|
R_RenderFrame,
|
|
|
|
Mod_SetOrthoBounds,
|
|
|
|
R_SpeedsMessage,
|
|
|
|
Mod_GetCurrentVis,
|
|
|
|
R_NewMap,
|
|
|
|
R_ClearScene,
|
2020-03-29 15:58:27 +02:00
|
|
|
R_GetProcAddress,
|
2019-03-19 22:29:25 +01:00
|
|
|
|
|
|
|
TriRenderMode,
|
|
|
|
TriBegin,
|
|
|
|
TriEnd,
|
|
|
|
_TriColor4f,
|
2019-04-03 17:21:08 +02:00
|
|
|
_TriColor4ub,
|
2019-03-19 22:29:25 +01:00
|
|
|
TriTexCoord2f,
|
|
|
|
TriVertex3fv,
|
|
|
|
TriVertex3f,
|
|
|
|
TriFog,
|
|
|
|
R_ScreenToWorld,
|
|
|
|
TriGetMatrix,
|
|
|
|
TriFogParams,
|
|
|
|
TriCullFace,
|
|
|
|
|
|
|
|
VGUI_DrawInit,
|
|
|
|
VGUI_DrawShutdown,
|
|
|
|
VGUI_SetupDrawingText,
|
|
|
|
VGUI_SetupDrawingRect,
|
|
|
|
VGUI_SetupDrawingImage,
|
|
|
|
VGUI_BindTexture,
|
|
|
|
VGUI_EnableTexture,
|
|
|
|
VGUI_CreateTexture,
|
|
|
|
VGUI_UploadTexture,
|
|
|
|
VGUI_UploadTextureBlock,
|
|
|
|
VGUI_DrawQuad,
|
|
|
|
VGUI_GetTextureSizes,
|
|
|
|
VGUI_GenerateTexture,
|
|
|
|
};
|
|
|
|
|
2019-03-25 15:18:47 +01:00
|
|
|
int EXPORT GAME_EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t *engfuncs, ref_globals_t *globals )
|
2019-03-19 22:29:25 +01:00
|
|
|
{
|
|
|
|
if( version != REF_API_VERSION )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// fill in our callbacks
|
|
|
|
memcpy( funcs, &gReffuncs, sizeof( ref_interface_t ));
|
|
|
|
memcpy( &gEngfuncs, engfuncs, sizeof( ref_api_t ));
|
|
|
|
gpGlobals = globals;
|
|
|
|
|
|
|
|
return REF_API_VERSION;
|
|
|
|
}
|