MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / CMainApplication

Class CMainApplication

samples/hellovr_vulkan/hellovr_vulkan_main.cpp:107–320  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Purpose: ------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

105// Purpose:
106//------------------------------------------------------------------------------
107class CMainApplication
108{
109public:
110 CMainApplication( int argc, char *argv[] );
111 virtual ~CMainApplication();
112
113 bool BInit();
114 bool BInitVulkan();
115 bool BInitVulkanInstance();
116 bool BInitVulkanDevice();
117 bool BInitVulkanSwapchain();
118 bool BInitCompositor();
119 bool GetVulkanInstanceExtensionsRequired( std::vector< std::string > &outInstanceExtensionList );
120 bool GetVulkanDeviceExtensionsRequired( VkPhysicalDevice pPhysicalDevice, std::vector< std::string > &outDeviceExtensionList );
121
122 void SetupRenderModels();
123
124 void Shutdown();
125
126 void RunMainLoop();
127 bool HandleInput();
128 void ProcessVREvent( const vr::VREvent_t & event );
129 void RenderFrame();
130
131 bool SetupTexturemaps();
132 static void GenMipMapRGBA( const uint8_t *pSrc, uint8_t *ppDst, int nSrcWidth, int nSrcHeight, int *pDstWidthOut, int *pDstHeightOut );
133
134 void SetupScene();
135 void AddCubeToScene( Matrix4 mat, std::vector<float> &vertdata );
136 void AddCubeVertex( float fl0, float fl1, float fl2, float fl3, float fl4, std::vector<float> &vertdata );
137
138 void UpdateControllerAxes();
139
140 bool SetupStereoRenderTargets();
141 void SetupCompanionWindow();
142 void SetupCameras();
143
144 void RenderStereoTargets();
145 void RenderCompanionWindow();
146 void RenderScene( vr::Hmd_Eye nEye );
147
148 Matrix4 GetHMDMatrixProjectionEye( vr::Hmd_Eye nEye );
149 Matrix4 GetHMDMatrixPoseEye( vr::Hmd_Eye nEye );
150 Matrix4 GetCurrentViewProjectionMatrix( vr::Hmd_Eye nEye );
151 void UpdateHMDMatrixPose();
152
153 Matrix4 ConvertSteamVRMatrixToMatrix4( const vr::HmdMatrix34_t &matPose );
154
155 bool CreateAllShaders();
156 void CreateAllDescriptorSets();
157
158 void SetupRenderModelForTrackedDevice( vr::TrackedDeviceIndex_t unTrackedDeviceIndex );
159 VulkanRenderModel *FindOrLoadRenderModel( vr::TrackedDeviceIndex_t unTrackedDeviceIndex, const char *pchRenderModelName );
160
161private:
162 bool m_bDebugVulkan;
163 bool m_bVerbose;
164 bool m_bPerf;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected