Skip to content

Commit

Permalink
[Window] Now updating properly all viewport on window size changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Oct 29, 2023
1 parent 4575265 commit 6ae638a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/client/core/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ void Window::display() {

void Window::onEvent(const SDL_Event &event) {
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
bgfx::setViewRect(0, 0, 0, (uint16_t)event.window.data1, (uint16_t)event.window.data2);
for (int i = 0; i < 8; ++i)
bgfx::setViewRect(i, 0, 0, (uint16_t)event.window.data1, (uint16_t)event.window.data2);

m_size.x = (unsigned int)event.window.data1;
m_size.y = (unsigned int)event.window.data2;
Expand Down

0 comments on commit 6ae638a

Please sign in to comment.