Skip to content

Commit

Permalink
engine: add cvar r_refdll_loaded to indicate currently loaded rendere…
Browse files Browse the repository at this point in the history
…r (for menu options and etc)
  • Loading branch information
a1batross committed Oct 30, 2023
1 parent 102faae commit a658259
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine/client/ref_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CVAR_DEFINE_AUTO( gl_msaa_samples, "0", FCVAR_GLCONFIG, "samples number for mult
CVAR_DEFINE_AUTO( gl_clear, "0", FCVAR_ARCHIVE, "clearing screen after each frame" );
CVAR_DEFINE_AUTO( r_showtree, "0", FCVAR_ARCHIVE, "build the graph of visible BSP tree" );
static CVAR_DEFINE_AUTO( r_refdll, "", FCVAR_RENDERINFO, "choose renderer implementation, if supported" );
static CVAR_DEFINE_AUTO( r_refdll_loaded, "", FCVAR_READ_ONLY, "currently loaded renderer" );

void R_GetTextureParms( int *w, int *h, int texnum )
{
Expand Down Expand Up @@ -519,6 +520,7 @@ static qboolean R_LoadRenderer( const char *refopt )
return false;
}

Cvar_FullSet( "r_refdll_loaded", refopt, FCVAR_READ_ONLY );
Con_Reportf( "Renderer %s initialized\n", refdll );

return true;
Expand Down Expand Up @@ -610,6 +612,7 @@ qboolean R_Init( void )
Cvar_RegisterVariable( &gl_clear );
Cvar_RegisterVariable( &r_showtree );
Cvar_RegisterVariable( &r_refdll );
Cvar_RegisterVariable( &r_refdll_loaded );

// cvars that are expected to exist
Cvar_Get( "r_speeds", "0", FCVAR_ARCHIVE, "shows renderer speeds" );
Expand Down

0 comments on commit a658259

Please sign in to comment.