feat: open window with size of workarea

dev
LeRoyce Pearson 2024-02-28 12:20:02 -07:00
parent 6f42b35e14
commit 197756e5c3
1 changed files with 5 additions and 1 deletions

View File

@ -132,8 +132,12 @@ pub fn main() !void {
seizer.backend.glfw.c.glfwWindowHint(seizer.backend.glfw.c.GLFW_CONTEXT_VERSION_MAJOR, 3); seizer.backend.glfw.c.glfwWindowHint(seizer.backend.glfw.c.GLFW_CONTEXT_VERSION_MAJOR, 3);
seizer.backend.glfw.c.glfwWindowHint(seizer.backend.glfw.c.GLFW_CONTEXT_VERSION_MINOR, 0); seizer.backend.glfw.c.glfwWindowHint(seizer.backend.glfw.c.GLFW_CONTEXT_VERSION_MINOR, 0);
const primary_monitor = seizer.backend.glfw.c.glfwGetPrimaryMonitor();
var workarea_size: [2]c_int = undefined;
seizer.backend.glfw.c.glfwGetMonitorWorkarea(primary_monitor, null, null, &workarea_size[0], &workarea_size[1]);
// Open window // Open window
const window = seizer.backend.glfw.c.glfwCreateWindow(720, 720, "Rummy", null, null) orelse return error.GlfwCreateWindow; const window = seizer.backend.glfw.c.glfwCreateWindow(workarea_size[0], workarea_size[1], "Rummy", null, null) orelse return error.GlfwCreateWindow;
errdefer seizer.backend.glfw.c.glfwDestroyWindow(window); errdefer seizer.backend.glfw.c.glfwDestroyWindow(window);
seizer.backend.glfw.c.glfwMakeContextCurrent(window); seizer.backend.glfw.c.glfwMakeContextCurrent(window);