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

Backend abstraction layer #932

Merged
merged 4 commits into from
Jan 12, 2025

Conversation

gucio321
Copy link
Collaborator

@gucio321 gucio321 commented Jan 8, 2025

Purpose of this is to add one more abstraction layer for backend in giu.
Initial problem was that generally we want to use same giu code in abstraction from what backend is being used.
This PR adds an abstract GIUBackend type (alias to backend.Backend[MasterWindowFlags])
This PR also adds GLFWBackend type which implements GIUBackend and is the default backend so that everything works as it used to, however now another addition to giu could be made to add more backends and user could chose btween them easily.

Also one side-change: MasterWindow does not store cimgui's Backend pointer anymore. Now the only place where Backend is stored is Context and MasterWindow stores its context's pointer.

allows to use different backend either from cimgui-go or manually ijmplemented.

The idea is to use same giu code (especially MasterWindowFlags)
in abstraction from used backend.
@gucio321 gucio321 merged commit 0f4b762 into AllenDang:master Jan 12, 2025
4 checks passed
@gucio321 gucio321 deleted the backend-abstraction-layer branch January 12, 2025 08:43
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