MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / OnResize

Method OnResize

deps/LLGL/examples/Cpp/ExampleBase/ExampleBase.cpp:149–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void ExampleBase::ResizeEventHandler::OnResize(LLGL::Window& sender, const LLGL::Extent2D& clientAreaSize)
150{
151 if (clientAreaSize.width >= 4 && clientAreaSize.height >= 4)
152 {
153 // Update video mode
154 auto videoMode = context_->GetVideoMode();
155 {
156 videoMode.resolution = clientAreaSize;
157 }
158 context_->SetVideoMode(videoMode);
159
160 // Update projection matrix
161 auto aspectRatio = static_cast<float>(videoMode.resolution.width) / static_cast<float>(videoMode.resolution.height);
162 projection_ = tutorial_.PerspectiveProjection(aspectRatio, 0.1f, 100.0f, Gs::Deg2Rad(45.0f));
163
164 // Re-draw frame
165 if (tutorial_.IsLoadingDone())
166 tutorial_.OnDrawFrame();
167 }
168}
169
170void ExampleBase::ResizeEventHandler::OnTimer(LLGL::Window& sender, std::uint32_t timerID)
171{

Callers

nothing calls this directly

Calls 4

SetVideoModeMethod · 0.80
PerspectiveProjectionMethod · 0.80
IsLoadingDoneMethod · 0.80
OnDrawFrameMethod · 0.45

Tested by

no test coverage detected