Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game does not scale to window shape #17

Closed
TheArcaneBrony opened this issue Feb 14, 2021 · 3 comments
Closed

Game does not scale to window shape #17

TheArcaneBrony opened this issue Feb 14, 2021 · 3 comments

Comments

@TheArcaneBrony
Copy link

Game does not account for different window shapes, causing everyting (especially the UI) to be squished on other aspect ratios, such as 4:3.
image

@bayi
Copy link

bayi commented Feb 21, 2021

Add this to src/gfx/window.c:

Somewhere near the top insert theese lines:

static void _refresh_callback(GLFWwindow* window) {
    printf("Window refresh\n");
    glfwSwapBuffers(window);
}

Then after line 104 add this:

    glfwSetWindowRefreshCallback(window.handle, _refresh_callback);

This solves the resize event handling in glfw

Ill attach an exmaple if you dont want to mees with the code ;) Unzip it and overwrite the current window.c in the src/gfx folder, then recompile.
window.c.zip

@bayi
Copy link

bayi commented Feb 21, 2021

Nevermind this only fixes the blank window issue with compositing window managers, the ui scaling issue still applies ...

@jdah
Copy link
Owner

jdah commented Feb 21, 2021

Fixed with 01efb83.

@jdah jdah closed this as completed Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants