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

Add SDL2 + OpenGL 3 backend #8

Merged
merged 3 commits into from
Jan 3, 2025
Merged

Conversation

mjakeman
Copy link
Contributor

@mjakeman mjakeman commented Dec 20, 2024

Hello!

This adds an SDL2 backend based on the upstream IMGUI one, with the relevant zgui specific changes.

See also: zig-gamedev/zsdl#7 (adds necessary header files to zsdl)

Zig Impl changes:

  • Adds new backend_sdl2 and backend_sdl2_opengl implementations modelled after the GLFW ones

IMGUI Backend:

  • Taken from this commit from August: ocornut/imgui@2d99052
  • Not using the most recent version as it has some API changes which this repo's IMGUI build doesn't have
  • Minor changes to extern in line with the GLFW build, commented with // FIX(zig-gamedev) to match

Build changes:

  • Migrates from lib.defineCMacro to lib.root_module.addCMacro as that's been removed in master

To Do:

@mjakeman
Copy link
Contributor Author

Somewhat addresses #5

build.zig.zon Outdated Show resolved Hide resolved
Copy link
Member

@hazeycode hazeycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks !

@hazeycode hazeycode merged commit c16629e into zig-gamedev:main Jan 3, 2025
3 checks passed
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.

2 participants