work on basic VR

This commit is contained in:
2026-05-30 20:43:02 +03:00
parent 4811ad0820
commit 3b128315e7
18 changed files with 716 additions and 29 deletions

View File

@@ -73,10 +73,31 @@ void CFunnyGameBridge::Init()
CreateInterfaceFn fnEngineFactory = GetEngineFactory();
g_pKotUI = (IKotUIManager*)fnEngineFactory(KOT_UI_INTEFACE_VERSION, NULL);
g_pAudioManager = (IAudioManager*)fnEngineFactory(AUDIO_MANAGER_INTERFACE_VERSION, NULL);
g_pXRManager = (IXRManager*)fnEngineFactory(OPEN_XR_INTERFACE_VERSION, NULL);
g_pAudioManager->Init();
g_pKotUI->ConnectInterface(g_pRenderContext, RENDER_CONTEXT_INTERFACE_VERSION);
g_pKotUI->Init();
g_pXRManager->ConnectInterface(g_pRenderContext, RENDER_CONTEXT_INTERFACE_VERSION);
g_pXRManager->Init();
g_pRenderContext->ConnectInterface(g_pXRManager, XR_INTERFACE_VERSION);
IXRHeadset *pHeadSet = g_pXRManager->GetHeadset(0);
for ( uint32_t i = 0; i < pHeadSet->GetSurfaceCount(); i++ )
{
XRRenderSurface_t surface = pHeadSet->GetSurface(0);
IImage *pImage = g_pRenderContext->CreateRenderTarget(surface.m_uWidth, surface.m_uHeight, IMAGE_FORMAT_RGBA8_UNORM, MULTISAMPLE_TYPE_1_SAMPLES);
pHeadSet->SetSurfaceImage(i, pImage);
IRenderCommandList *pDoSomething = g_pRenderContext->CreateCommandList();
pDoSomething->StartRecording();
pDoSomething->ClearImage(pImage, 1,0,0.5,1);
pDoSomething->EndRecording();
g_pRenderContext->SubmitCommandList(pDoSomething);
g_pRenderContext->DestroyCommandList(pDoSomething);
}
}
void CFunnyGameBridge::Tick( float fDelta )
@@ -173,6 +194,8 @@ void CFunnyGameBridge::Frame( float fDelta )
EntitySystem()->NetSendThink(pCurrentServer);
}
g_pWorldRenderer->Frame(fDelta);
g_pXRManager->Frame();
}
void CFunnyGameBridge::Shutdown()