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

GLFW demo #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

GLFW demo #66

wants to merge 2 commits into from

Conversation

akmubi
Copy link

@akmubi akmubi commented Oct 17, 2023

Added this as an example.

I stumbled upon the GDI demo PR recently and wondered, "Why don't we have a GLFW implementation?" So, I wrote a basic implementation.

It's pretty raw right now - I hashed it out in about an hour while flipping through the GLFW docs. I mostly omitted error handling, and moved input processing to glfw callbacks. There are some tweaks in the function signatures (like r_init, r_present), mainly because certain GLFW functions needed the GLFWwindow parameter.

I tested this in MinGW64 (MSYS2). To compile you need to install glfw and pkg-config packages (or replace pkg-config --libs glfw3 with -L<path-to-libglfw> -lglfw3 in build.sh). To install these packages (in MSYS2) run:

pacman -S mingw-w64-x86_64-glfw
pacman -S mingw-w64-x86_64-pkg-config

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

Successfully merging this pull request may close these issues.

1 participant