2021-01-09 22:21:58 +01:00
|
|
|
#include "vk_core.h"
|
2021-12-27 22:50:39 +01:00
|
|
|
#include "vk_cvar.h"
|
2021-01-09 22:21:58 +01:00
|
|
|
#include "vk_common.h"
|
2021-01-04 21:39:09 +01:00
|
|
|
#include "vk_textures.h"
|
2021-01-09 22:21:58 +01:00
|
|
|
#include "vk_renderstate.h"
|
2022-05-30 22:04:19 +02:00
|
|
|
#include "vk_overlay.h"
|
2021-02-01 20:05:04 +01:00
|
|
|
#include "vk_scene.h"
|
2021-01-23 19:54:44 +01:00
|
|
|
#include "vk_framectl.h"
|
2021-02-03 19:06:21 +01:00
|
|
|
#include "vk_lightmap.h"
|
2021-02-06 22:13:08 +01:00
|
|
|
#include "vk_sprite.h"
|
2021-02-08 19:57:27 +01:00
|
|
|
#include "vk_studio.h"
|
2021-02-17 22:26:09 +01:00
|
|
|
#include "vk_beams.h"
|
2021-06-06 23:17:35 +02:00
|
|
|
#include "vk_brush.h"
|
2021-01-04 21:39:09 +01:00
|
|
|
|
2021-01-03 02:52:53 +01:00
|
|
|
#include "xash3d_types.h"
|
2021-01-04 21:39:09 +01:00
|
|
|
#include "com_strings.h"
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
#include <memory.h>
|
|
|
|
|
|
|
|
ref_api_t gEngine = {0};
|
|
|
|
ref_globals_t *gpGlobals = NULL;
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static const char *R_GetConfigName( void )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
|
|
|
return "vk";
|
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static qboolean R_SetDisplayTransform( ref_screen_rotation_t rotate, int x, int y, float scale_x, float scale_y )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED_ARGS("(%d, %d, %d, %f, %f)", rotate, x, y, scale_x, scale_y);
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// only called for GL contexts
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_SetupAttributes( int safegl )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_ClearExtensions( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_BackendStartFrame( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_BackendEndFrame( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
// debug
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_ShowTextures( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
|
|
|
//PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
// texture management
|
2021-01-20 20:16:06 +01:00
|
|
|
static const byte *R_GetTextureOriginalBuffer( unsigned int idx )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static qboolean VID_CubemapShot( const char *base, uint size, const float *vieworg, qboolean skyshot )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// light
|
2021-01-20 20:16:06 +01:00
|
|
|
static colorVec R_LightPoint( const float *p )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return (colorVec){0};
|
|
|
|
}
|
|
|
|
|
|
|
|
// decals
|
|
|
|
// Shoots a decal onto the surface of the BSP. position is the center of the decal in world coords
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_DecalShoot( int textureIndex, int entityIndex, int modelIndex, vec3_t pos, int flags, float scale )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_DecalRemoveAll( int texture )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static int R_CreateDecalList( struct decallist_s *pList )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_ClearAllDecals( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
// studio interface
|
2021-01-20 20:16:06 +01:00
|
|
|
static float R_StudioEstimateFrame( cl_entity_t *e, mstudioseqdesc_t *pseqdesc )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return 1.f;
|
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_StudioLerpMovement( cl_entity_t *e, double time, vec3_t origin, vec3_t angles )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
// bmodel
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_InitSkyClouds( struct mip_s *mt, struct texture_s *tx, qboolean custom_palette )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
|
|
|
|
extern void GL_SubdivideSurface( msurface_t *fa );
|
|
|
|
|
|
|
|
|
|
|
|
static void Mod_LoadAliasModel( model_t *mod, const void *buffer, qboolean *loaded )
|
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED_ARGS("(%p, %s), %p, %d", mod, mod->name, buffer, *loaded);
|
2021-01-20 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static qboolean Mod_ProcessRenderData( model_t *mod, qboolean create, const byte *buffer )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-01-20 20:16:06 +01:00
|
|
|
qboolean loaded = true;
|
|
|
|
|
2021-01-27 21:00:11 +01:00
|
|
|
// TODO does this ever happen?
|
|
|
|
if (!create && mod->type == mod_brush)
|
|
|
|
gEngine.Con_Printf( S_WARN "VK FIXME Trying to unload brush model %s\n", mod->name);
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
if( create )
|
|
|
|
{
|
|
|
|
switch( mod->type )
|
|
|
|
{
|
|
|
|
case mod_studio:
|
2021-02-08 19:57:27 +01:00
|
|
|
Mod_LoadStudioModel( mod, buffer, &loaded );
|
2021-01-20 20:16:06 +01:00
|
|
|
break;
|
|
|
|
case mod_sprite:
|
|
|
|
Mod_LoadSpriteModel( mod, buffer, &loaded, mod->numtexinfo );
|
|
|
|
break;
|
|
|
|
case mod_alias:
|
|
|
|
Mod_LoadAliasModel( mod, buffer, &loaded );
|
|
|
|
break;
|
|
|
|
case mod_brush:
|
2021-01-27 21:00:11 +01:00
|
|
|
// FIXME this happens before we get R_NewMap, which frees all current buffers
|
|
|
|
// loaded = VK_LoadBrushModel( mod, buffer );
|
2021-01-20 20:16:06 +01:00
|
|
|
break;
|
|
|
|
default: gEngine.Host_Error( "Mod_LoadModel: unsupported type %d\n", mod->type );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( loaded && gEngine.drawFuncs->Mod_ProcessUserData )
|
|
|
|
gEngine.drawFuncs->Mod_ProcessUserData( mod, create, buffer );
|
|
|
|
|
2021-04-07 21:11:20 +02:00
|
|
|
if( !create ) {
|
|
|
|
switch( mod->type )
|
|
|
|
{
|
|
|
|
case mod_brush:
|
|
|
|
VK_BrushModelDestroy( mod );
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
PRINT_NOT_IMPLEMENTED_ARGS("destroy (%p, %d, %s)", mod, mod->type, mod->name);
|
|
|
|
}
|
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
|
|
|
|
return loaded;
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// efx implementation
|
2021-01-20 20:16:06 +01:00
|
|
|
static void CL_DrawParticles( double frametime, particle_t *particles, float partsize )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void CL_DrawTracers( double frametime, particle_t *tracers )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
// Xash3D Render Interface
|
|
|
|
// Get renderer info (doesn't changes engine state at all)
|
2021-01-04 21:39:09 +01:00
|
|
|
|
|
|
|
static const char *getParmName(int parm)
|
|
|
|
{
|
|
|
|
switch(parm){
|
|
|
|
case PARM_TEX_WIDTH: return "PARM_TEX_WIDTH";
|
|
|
|
case PARM_TEX_HEIGHT: return "PARM_TEX_HEIGHT";
|
|
|
|
case PARM_TEX_SRC_WIDTH: return "PARM_TEX_SRC_WIDTH";
|
|
|
|
case PARM_TEX_SRC_HEIGHT: return "PARM_TEX_SRC_HEIGHT";
|
|
|
|
case PARM_TEX_SKYBOX: return "PARM_TEX_SKYBOX";
|
|
|
|
case PARM_TEX_SKYTEXNUM: return "PARM_TEX_SKYTEXNUM";
|
|
|
|
case PARM_TEX_LIGHTMAP: return "PARM_TEX_LIGHTMAP";
|
|
|
|
case PARM_TEX_TARGET: return "PARM_TEX_TARGET";
|
|
|
|
case PARM_TEX_TEXNUM: return "PARM_TEX_TEXNUM";
|
|
|
|
case PARM_TEX_FLAGS: return "PARM_TEX_FLAGS";
|
|
|
|
case PARM_TEX_DEPTH: return "PARM_TEX_DEPTH";
|
|
|
|
case PARM_TEX_GLFORMAT: return "PARM_TEX_GLFORMAT";
|
|
|
|
case PARM_TEX_ENCODE: return "PARM_TEX_ENCODE";
|
|
|
|
case PARM_TEX_MIPCOUNT: return "PARM_TEX_MIPCOUNT";
|
|
|
|
case PARM_BSP2_SUPPORTED: return "PARM_BSP2_SUPPORTED";
|
|
|
|
case PARM_SKY_SPHERE: return "PARM_SKY_SPHERE";
|
|
|
|
case PARAM_GAMEPAUSED: return "PARAM_GAMEPAUSED";
|
|
|
|
case PARM_MAP_HAS_DELUXE: return "PARM_MAP_HAS_DELUXE";
|
|
|
|
case PARM_MAX_ENTITIES: return "PARM_MAX_ENTITIES";
|
|
|
|
case PARM_WIDESCREEN: return "PARM_WIDESCREEN";
|
|
|
|
case PARM_FULLSCREEN: return "PARM_FULLSCREEN";
|
|
|
|
case PARM_SCREEN_WIDTH: return "PARM_SCREEN_WIDTH";
|
|
|
|
case PARM_SCREEN_HEIGHT: return "PARM_SCREEN_HEIGHT";
|
|
|
|
case PARM_CLIENT_INGAME: return "PARM_CLIENT_INGAME";
|
|
|
|
case PARM_FEATURES: return "PARM_FEATURES";
|
|
|
|
case PARM_ACTIVE_TMU: return "PARM_ACTIVE_TMU";
|
|
|
|
case PARM_LIGHTSTYLEVALUE: return "PARM_LIGHTSTYLEVALUE";
|
|
|
|
case PARM_MAX_IMAGE_UNITS: return "PARM_MAX_IMAGE_UNITS";
|
|
|
|
case PARM_CLIENT_ACTIVE: return "PARM_CLIENT_ACTIVE";
|
|
|
|
case PARM_REBUILD_GAMMA: return "PARM_REBUILD_GAMMA";
|
|
|
|
case PARM_DEDICATED_SERVER: return "PARM_DEDICATED_SERVER";
|
|
|
|
case PARM_SURF_SAMPLESIZE: return "PARM_SURF_SAMPLESIZE";
|
|
|
|
case PARM_GL_CONTEXT_TYPE: return "PARM_GL_CONTEXT_TYPE";
|
|
|
|
case PARM_GLES_WRAPPER: return "PARM_GLES_WRAPPER";
|
|
|
|
case PARM_STENCIL_ACTIVE: return "PARM_STENCIL_ACTIVE";
|
|
|
|
case PARM_WATER_ALPHA: return "PARM_WATER_ALPHA";
|
|
|
|
case PARM_TEX_MEMORY: return "PARM_TEX_MEMORY";
|
|
|
|
case PARM_DELUXEDATA: return "PARM_DELUXEDATA";
|
|
|
|
case PARM_SHADOWDATA: return "PARM_SHADOWDATA";
|
2021-12-24 22:30:02 +01:00
|
|
|
case PARM_MODERNFLASHLIGHT: return "PARM_MODERNFLASHLIGHT";
|
2021-01-04 21:39:09 +01:00
|
|
|
default: return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static int VK_RefGetParm( int parm, int arg )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-01-04 21:39:09 +01:00
|
|
|
vk_texture_t *tex = NULL;
|
|
|
|
|
|
|
|
switch(parm){
|
|
|
|
case PARM_TEX_WIDTH:
|
|
|
|
case PARM_TEX_SRC_WIDTH: // TODO why is this separate?
|
|
|
|
tex = findTexture(arg);
|
|
|
|
return tex->width;
|
|
|
|
case PARM_TEX_HEIGHT:
|
|
|
|
case PARM_TEX_SRC_HEIGHT:
|
|
|
|
tex = findTexture(arg);
|
|
|
|
return tex->height;
|
2021-01-20 20:16:06 +01:00
|
|
|
case PARM_TEX_FLAGS:
|
|
|
|
tex = findTexture(arg);
|
|
|
|
return tex->flags;
|
2021-12-24 22:30:02 +01:00
|
|
|
case PARM_MODERNFLASHLIGHT:
|
2021-12-27 22:50:39 +01:00
|
|
|
if (CVAR_TO_BOOL( vk_rtx )) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
|
|
|
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED_ARGS("(%s(%d), %d)", getParmName(parm), parm, arg);
|
2021-01-04 21:39:09 +01:00
|
|
|
|
2021-01-03 02:52:53 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GetDetailScaleForTexture( int texture, float *xScale, float *yScale )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GetExtraParmsForTexture( int texture, byte *red, byte *green, byte *blue, byte *alpha )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static float GetFrameTime( void )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return 1.f;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set renderer info (tell engine about changes)
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_SetCurrentEntity( struct cl_entity_s *ent )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_SetCurrentModel( struct model_s *mod )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
|
|
|
|
2021-01-04 21:39:09 +01:00
|
|
|
|
|
|
|
// Decals manipulating (draw & remove)
|
2021-01-20 20:16:06 +01:00
|
|
|
static void DrawSingleDecal( struct decal_s *pDecal, struct msurface_s *fa )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static float *R_DecalSetupVerts( struct decal_s *pDecal, struct msurface_s *surf, int texture, int *outCount )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_EntityRemoveDecals( struct model_s *mod )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
|
|
|
|
2021-01-04 21:39:09 +01:00
|
|
|
// AVI
|
2021-01-20 20:16:06 +01:00
|
|
|
static void AVI_UploadRawFrame( int texture, int cols, int rows, int width, int height, const byte *data )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
|
|
|
|
2021-01-04 21:39:09 +01:00
|
|
|
// glState related calls (must use this instead of normal gl-calls to prevent de-synchornize local states between engine and the client)
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_Bind( int tmu, unsigned int texnum )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_SelectTexture( int tmu )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_LoadTextureMatrix( const float *glmatrix )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_TexMatrixIdentity( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_CleanUpTextureUnits( int last )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_TexGen( unsigned int coord, unsigned int mode )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_TextureTarget( unsigned int target )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_TexCoordArrayMode( unsigned int texmode )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_UpdateTexSize( int texnum, int width, int height, int depth )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Misc renderer functions
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_DrawParticles( const struct ref_viewpass_s *rvp, qboolean trans_pass, float frametime )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-02-14 02:19:59 +01:00
|
|
|
|
2021-08-08 04:56:38 +02:00
|
|
|
colorVec R_LightVec( const float *start, const float *end, float *lightspot, float *lightvec );
|
2021-01-03 02:52:53 +01:00
|
|
|
|
2021-01-20 20:16:06 +01:00
|
|
|
static struct mstudiotex_s *R_StudioGetTexture( struct cl_entity_s *e )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// setup map bounds for ortho-projection when we in dev_overview mode
|
2021-01-20 20:16:06 +01:00
|
|
|
static void GL_OrthoBounds( const float *mins, const float *maxs )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
// grab r_speeds message
|
2021-01-20 20:16:06 +01:00
|
|
|
static qboolean R_SpeedsMessage( char *out, size_t size )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// get visdata for current frame from custom renderer
|
2021-01-20 20:16:06 +01:00
|
|
|
static byte* Mod_GetCurrentVis( void )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
2021-02-01 01:53:24 +01:00
|
|
|
|
2021-01-03 02:52:53 +01:00
|
|
|
// GL_GetProcAddress for client renderer
|
2021-01-20 20:16:06 +01:00
|
|
|
static void* R_GetProcAddress( const char *name )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TriAPI Interface
|
|
|
|
// NOTE: implementation isn't required to be compatible
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriRenderMode( int mode )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriBegin( int primitiveCode )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriEnd( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriColor4f( float r, float g, float b, float a )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriTexCoord2f( float u, float v )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriVertex3fv( const float *worldPnt )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriVertex3f( float x, float y, float z )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriFog( float flFogColor[3], float flStart, float flEnd, int bOn )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void R_ScreenToWorld( const float *screen, float *world )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriGetMatrix( const int pname, float *matrix )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriFogParams( float flDensity, int iFogSkybox )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void TriCullFace( TRICULLSTYLE mode )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
// vgui drawing implementation
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_DrawInit( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_DrawShutdown( void )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_SetupDrawingText( int *pColor )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_SetupDrawingRect( int *pColor )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_SetupDrawingImage( int *pColor )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_BindTexture( int id )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_EnableTexture( qboolean enable )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_CreateTexture( int id, int width, int height )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_UploadTexture( int id, const char *buffer, int width, int height )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_UploadTextureBlock( int id, int drawX, int drawY, const byte *rgba, int blockWidth, int blockHeight )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_DrawQuad( const vpoint_t *ul, const vpoint_t *lr )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static void VGUI_GetTextureSizes( int *width, int *height )
|
2021-01-04 21:39:09 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-04 21:39:09 +01:00
|
|
|
}
|
2021-01-20 20:16:06 +01:00
|
|
|
static int VGUI_GenerateTexture( void )
|
2021-01-03 02:52:53 +01:00
|
|
|
{
|
2021-02-06 22:38:38 +01:00
|
|
|
PRINT_NOT_IMPLEMENTED();
|
2021-01-03 02:52:53 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-12-10 01:42:38 +01:00
|
|
|
static const ref_device_t *pfnGetRenderDevice( unsigned int idx )
|
|
|
|
{
|
|
|
|
if( idx >= vk_core.num_devices )
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return &vk_core.devices[idx];
|
|
|
|
}
|
|
|
|
|
2021-01-03 02:52:53 +01:00
|
|
|
ref_interface_t gReffuncs =
|
|
|
|
{
|
|
|
|
.R_Init = R_VkInit,
|
|
|
|
.R_Shutdown = R_VkShutdown,
|
|
|
|
R_GetConfigName,
|
|
|
|
R_SetDisplayTransform,
|
|
|
|
|
|
|
|
GL_SetupAttributes,
|
|
|
|
.GL_InitExtensions = NULL, // Unused in Vulkan renderer
|
|
|
|
GL_ClearExtensions,
|
|
|
|
|
|
|
|
R_BeginFrame,
|
2021-01-20 20:16:06 +01:00
|
|
|
R_RenderScene, // Not called ever?
|
2021-01-03 02:52:53 +01:00
|
|
|
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,
|
2021-01-04 21:39:09 +01:00
|
|
|
VK_LoadTextureFromBuffer,
|
2021-01-03 02:52:53 +01:00
|
|
|
GL_ProcessTexture,
|
2021-11-19 20:31:45 +01:00
|
|
|
XVK_SetupSky,
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
R_Set2DMode,
|
|
|
|
R_DrawStretchRaw,
|
|
|
|
R_DrawStretchPic,
|
|
|
|
R_DrawTileClear,
|
|
|
|
CL_FillRGBA,
|
|
|
|
CL_FillRGBABlend,
|
2021-10-30 19:09:32 +02:00
|
|
|
R_WorldToScreen,
|
2021-01-03 02:52:53 +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,
|
2021-02-03 19:06:21 +01:00
|
|
|
VK_RunLightStyles,
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
R_GetSpriteParms,
|
|
|
|
R_GetSpriteTexture,
|
|
|
|
|
|
|
|
Mod_LoadMapSprite,
|
|
|
|
Mod_ProcessRenderData,
|
|
|
|
Mod_StudioLoadTextures,
|
|
|
|
|
|
|
|
CL_DrawParticles,
|
|
|
|
CL_DrawTracers,
|
|
|
|
CL_DrawBeams,
|
|
|
|
R_BeamCull,
|
|
|
|
|
2021-01-04 21:39:09 +01:00
|
|
|
VK_RefGetParm,
|
2021-01-03 02:52:53 +01:00
|
|
|
GetDetailScaleForTexture,
|
|
|
|
GetExtraParmsForTexture,
|
|
|
|
GetFrameTime,
|
|
|
|
|
|
|
|
R_SetCurrentEntity,
|
|
|
|
R_SetCurrentModel,
|
|
|
|
|
2021-01-04 21:39:09 +01:00
|
|
|
VK_FindTexture,
|
|
|
|
VK_TextureName,
|
|
|
|
VK_TextureData,
|
|
|
|
VK_LoadTexture,
|
|
|
|
VK_CreateTexture,
|
|
|
|
VK_LoadTextureArray,
|
|
|
|
VK_CreateTextureArray,
|
|
|
|
VK_FreeTexture,
|
2021-01-03 02:52:53 +01:00
|
|
|
|
|
|
|
DrawSingleDecal,
|
|
|
|
R_DecalSetupVerts,
|
|
|
|
R_EntityRemoveDecals,
|
|
|
|
|
|
|
|
AVI_UploadRawFrame,
|
|
|
|
|
|
|
|
GL_Bind,
|
|
|
|
GL_SelectTexture,
|
|
|
|
GL_LoadTextureMatrix,
|
|
|
|
GL_TexMatrixIdentity,
|
|
|
|
GL_CleanUpTextureUnits,
|
|
|
|
GL_TexGen,
|
|
|
|
GL_TextureTarget,
|
|
|
|
GL_TexCoordArrayMode,
|
|
|
|
GL_UpdateTexSize,
|
|
|
|
NULL, // Reserved0
|
|
|
|
NULL, // Reserved1
|
|
|
|
|
|
|
|
GL_DrawParticles,
|
|
|
|
R_LightVec,
|
|
|
|
R_StudioGetTexture,
|
|
|
|
|
2021-02-20 23:54:57 +01:00
|
|
|
VK_RenderFrame,
|
2021-01-03 02:52:53 +01:00
|
|
|
GL_OrthoBounds,
|
|
|
|
R_SpeedsMessage,
|
|
|
|
Mod_GetCurrentVis,
|
|
|
|
R_NewMap,
|
|
|
|
R_ClearScene,
|
|
|
|
R_GetProcAddress,
|
|
|
|
|
|
|
|
TriRenderMode,
|
|
|
|
TriBegin,
|
|
|
|
TriEnd,
|
|
|
|
TriColor4f,
|
|
|
|
TriColor4ub,
|
|
|
|
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,
|
2021-12-10 01:42:38 +01:00
|
|
|
|
|
|
|
pfnGetRenderDevice,
|
2021-01-03 02:52:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
int EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t *engfuncs, ref_globals_t *globals )
|
|
|
|
{
|
|
|
|
if( version != REF_API_VERSION )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// fill in our callbacks
|
|
|
|
memcpy( funcs, &gReffuncs, sizeof( ref_interface_t ));
|
|
|
|
memcpy( &gEngine, engfuncs, sizeof( ref_api_t ));
|
|
|
|
gpGlobals = globals;
|
|
|
|
|
|
|
|
return REF_API_VERSION;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EXPORT GetRefHumanReadableName( char *out, size_t size )
|
|
|
|
{
|
|
|
|
Q_strncpy( out, "Vulkan", size );
|
|
|
|
}
|