StudioCherno / Walnut

Walnut is a simple application framework for Vulkan and Dear ImGui apps
MIT License
2.11k stars 392 forks source link

How can I add fullscreen to Walnut #60

Open infinitegame111 opened 1 year ago

infinitegame111 commented 1 year ago

No way of adding fullscreen appears to work for me with walnut, is there a way to do so when the app starts? If so how would I add this so my app will start fullscreened.

VagueLobster commented 1 year ago

You can do something like this:

GLFWmonitor* monitor = glfwGetPrimaryMonitor();

const GLFWvidmode* mode = glfwGetVideoMode(monitor);

glfwWindowHint(GLFW_RED_BITS, mode->redBits);
glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);

m_WindowHandle = glfwCreateWindow(fullscreenWidth, fullscreenHeight, "Window Title", monitor, nullptr)

You of course need to call it when creating the window 👍