Window
This is a WIP project - Expect breaking changes to occur.
Overview
The window.java class is responsible for creating and handling the application window using GLFW.
Window()
public Window(int width, int height, String title) {}create()
public void create() {}Initializes GLFW, creates the window, sets up OpenGL context and prepares the window for rendering.
createCallbacks()
private void createCallbacks() {}Sets up GLFW callbacks for handling window events, such as resizing.
The size callback updates the window dimensions and marks the window as resized when the user changes the window size.
update()
public void update() {}Updates the window each frame by handling resizing, clearing the screen, polling events, and updating the FPS counter in the title.
swapBuffers()
public void swapBuffers() { GLFW.glfwSwapBuffers(window); }shouldClose()
public boolean shouldClose() { return GLFW.glfwWindowShouldClose(window); }destroy()
public void destroy() {}Getters and Setters
setBackgroundColor()
public void setBackgroundColor(float r, float g, float b) {}isFullscreen()
public boolean isFullscreen() { return isFullscreen; }setFullscreen()
public void setFullscreen(boolean isFullscreen) {}getWidth()
public int getWidth() { return width; }getHeight()
public int getHeight() { return height; }getTitle()
public String getTitle() { return title; }getWindow()
public long getWindow() { return window; }Last updated on