MCPcopy Create free account
hub / github.com/MethanePowered/MethaneKit / HelloCubeApp

Method HelloCubeApp

Apps/02-HelloCube/HelloCubeApp.cpp:92–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91public:
92 HelloCubeApp()
93 : GraphicsApp(
94 []() {
95 Graphics::CombinedAppSettings settings = Tutorials::GetGraphicsTutorialAppSettings(g_app_name, Tutorials::AppOptions::GetDefaultWithColorOnlyAndAnim());
96#ifdef UNIFORMS_ENABLED
97 settings.graphics_app.SetScreenPassAccess(Rhi::RenderPassAccessMask(Rhi::RenderPassAccess::ShaderResources));
98#else
99 settings.graphics_app.SetScreenPassAccess({});
100#endif
101 return settings;
102 }(),
103 "Tutorial demonstrating colored rotating cube rendering with Methane Kit.")
104#ifndef UNIFORMS_ENABLED
105 , m_proj_vertices(m_cube_mesh.GetVertices())
106#endif
107 {
108 m_camera.ResetOrientation({ { 13.0F, 13.0F, 13.0F }, { 0.0F, 0.0F, 0.0F }, { 0.0F, 1.0F, 0.0F } });
109
110 // Setup camera rotation animation
111 GetAnimations().emplace_back(Data::MakeTimeAnimationPtr([this](double, double delta_seconds)
112 {
113 m_camera.Rotate(m_camera.GetOrientation().up, static_cast<float>(delta_seconds * 360.F / 8.F));
114 return true;
115 }));
116 }
117
118 ~HelloCubeApp() override
119 {

Callers

nothing calls this directly

Calls 4

MakeTimeAnimationPtrFunction · 0.85
ResetOrientationMethod · 0.80
RotateMethod · 0.80

Tested by

no test coverage detected