- added VR mode init code as this is actually functional with the new renderer.

Also moved a few things out of gl_texture.cpp as this file is scheduled to go away with Polymost.
This commit is contained in:
Christoph Oelckers 2021-04-05 20:12:11 +02:00
parent 7c4e9ea87e
commit e098e0ca2e
4 changed files with 34 additions and 17 deletions

View file

@ -30,6 +30,7 @@
#include "v_video.h" #include "v_video.h"
static IHardwareTexture* (*layercallback)(int layer, int translation); static IHardwareTexture* (*layercallback)(int layer, int translation);
TArray<UserShaderDesc> usershaders;
void FMaterial::SetLayerCallback(IHardwareTexture* (*cb)(int layer, int translation)) void FMaterial::SetLayerCallback(IHardwareTexture* (*cb)(int layer, int translation))
{ {

View file

@ -1412,3 +1412,10 @@ DEFINE_GLOBAL(gameaction)
DEFINE_GLOBAL(gamestate) DEFINE_GLOBAL(gamestate)
DEFINE_GLOBAL(demoplayback) DEFINE_GLOBAL(demoplayback)
DEFINE_GLOBAL(consoleplayer) DEFINE_GLOBAL(consoleplayer)
void InitBuildTiles()
{
// need to find a better way to handle this thing.
}

View file

@ -731,3 +731,29 @@ DEFINE_ACTION_FUNCTION(_PlayerMenu, DrawPlayerSprite)
return 0; return 0;
} }
#ifdef _WIN32
EXTERN_CVAR(Bool, vr_enable_quadbuffered)
#endif
void UpdateVRModes(bool considerQuadBuffered)
{
FOptionValues** pVRModes = OptionValues.CheckKey("VRMode");
if (pVRModes == nullptr) return;
TArray<FOptionValues::Pair>& vals = (*pVRModes)->mValues;
TArray<FOptionValues::Pair> filteredValues;
int cnt = vals.Size();
for (int i = 0; i < cnt; ++i) {
auto const& mode = vals[i];
if (mode.Value == 7) { // Quad-buffered stereo
#ifdef _WIN32
if (!vr_enable_quadbuffered) continue;
#else
continue; // Remove quad-buffered option on Mac and Linux
#endif
if (!considerQuadBuffered) continue; // Probably no compatible screen mode was found
}
filteredValues.Push(mode);
}
vals = filteredValues;
}

View file

@ -86,20 +86,3 @@ bool GLInstance::SetTexture(FGameTexture* tex, int paletteid, int sampler, bool
return true; return true;
} }
//===========================================================================
//
// stand-ins for the texture system. Nothing of this is used right now, but needs to be present to satisfy the linker
//
//===========================================================================
void InitBuildTiles()
{
}
TArray<UserShaderDesc> usershaders;
void UpdateVRModes(bool considerQuadBuffered = true)
{
// should update the menu.
}