| 147 | } |
| 148 | |
| 149 | void 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 | |
| 170 | void ExampleBase::ResizeEventHandler::OnTimer(LLGL::Window& sender, std::uint32_t timerID) |
| 171 | { |
nothing calls this directly
no test coverage detected