mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
Fix window on fullscreen
This commit is contained in:
parent
f513c094a9
commit
88cb6bb481
2 changed files with 12 additions and 3 deletions
|
|
@ -71,10 +71,18 @@ bool Window::isMaximized() {
|
||||||
return glfwGetWindowAttrib(window, GLFW_MAXIMIZED);
|
return glfwGetWindowAttrib(window, GLFW_MAXIMIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Window::isFocused()
|
||||||
|
{
|
||||||
|
return glfwGetWindowAttrib(window, GLFW_FOCUSED);
|
||||||
|
}
|
||||||
|
|
||||||
void window_size_callback(GLFWwindow*, int width, int height) {
|
void window_size_callback(GLFWwindow*, int width, int height) {
|
||||||
glViewport(0, 0, width, height);
|
if (Window::isFocused()) {
|
||||||
Window::width = width;
|
glViewport(0, 0, width, height);
|
||||||
Window::height = height;
|
Window::width = width;
|
||||||
|
Window::height = height;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Window::isFullscreen() && !Window::isMaximized()) {
|
if (!Window::isFullscreen() && !Window::isMaximized()) {
|
||||||
Window::getSettings()->width = width;
|
Window::getSettings()->width = width;
|
||||||
Window::getSettings()->height = height;
|
Window::getSettings()->height = height;
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public:
|
||||||
static void toggleFullscreen();
|
static void toggleFullscreen();
|
||||||
static bool isFullscreen();
|
static bool isFullscreen();
|
||||||
static bool isMaximized();
|
static bool isMaximized();
|
||||||
|
static bool isFocused();
|
||||||
|
|
||||||
static void pushScissor(glm::vec4 area);
|
static void pushScissor(glm::vec4 area);
|
||||||
static void popScissor();
|
static void popScissor();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue