You can now change resolution by pressing buttons.
This commit is contained in:
@@ -25,6 +25,17 @@ bool MainMenuSystem::OnButtonClick(const Events::ButtonClicked& e)
|
||||
//Run host code
|
||||
} else if(e.EntityName == "Quit") {
|
||||
printf("No, you stay");
|
||||
} else if (e.EntityName == "Res1080") {
|
||||
glfwSetWindowSize(m_Renderer->Window(), 1920, 1080);
|
||||
printf("1080");
|
||||
} else if (e.EntityName == "Res720") {
|
||||
glfwSetWindowSize(m_Renderer->Window(), 1280, 720);
|
||||
glViewport(0, 0, 1280, 720);
|
||||
printf("720");
|
||||
} else if (e.EntityName == "Res480") {
|
||||
glfwSetWindowSize(m_Renderer->Window(), 854, 480);
|
||||
glViewport(0, 0, 854, 480);
|
||||
printf("480");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -60,7 +60,7 @@ void Renderer::InitializeWindow()
|
||||
}
|
||||
|
||||
int windowSize[2];
|
||||
glfwGetWindowSize(m_Window, &windowSize[0], &windowSize[1]);
|
||||
glfwGetFramebufferSize(m_Window, &windowSize[0], &windowSize[1]);
|
||||
m_ViewportSize = Rectangle(windowSize[0], windowSize[1]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user