engine: implement menu extensions to allow choosing renderers from GUI

This commit is contained in:
Alibek Omarov
2019-08-09 04:44:50 +03:00
parent a1ae770f70
commit 8323df240b
6 changed files with 29 additions and 18 deletions

View File

@@ -1185,12 +1185,27 @@ static void pfnEnableTextInput( int enable )
Key_EnableTextInput( enable, false );
}
static int pfnGetRenderers( unsigned int num, char *shortName, size_t size1, char *readableName, size_t size2 )
{
if( num >= ref.numRenderers )
return 0;
if( shortName && size1 )
Q_strncpy( shortName, ref.shortNames[num], size1 );
if( readableName && size2 )
Q_strncpy( readableName, ref.readableNames[num], size2 );
return 1;
}
static ui_extendedfuncs_t gExtendedfuncs =
{
pfnEnableTextInput,
Con_UtfProcessChar,
Con_UtfMoveLeft,
Con_UtfMoveRight
Con_UtfMoveRight,
pfnGetRenderers
};
void UI_UnloadProgs( void )