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 example / cannot run using glfw #23

Open
HuskyNator opened this issue Dec 2, 2022 · 5 comments
Open

Glfw example / cannot run using glfw #23

HuskyNator opened this issue Dec 2, 2022 · 5 comments

Comments

@HuskyNator
Copy link

I tried modifying the provided example to run with GLFW instead of SDL, this required both locally changing the dependencies and import path of the imgui package. (bindbc-glfw is not a stated dependency & line 6399 of imgui.d imports sdl instead of the required glfw, causing multiple undefined identifier GLFWWindow compile errors).

After managing to get the example to compile & run, my code is now throwing an access violation exception upon calling ImGui_ImplGlfw_InitForOpenGL. I'm not aware why this happens, especially since no glfw example is provided.
Note I am aware glfw & opengl are properly initializing (I can render properly after glfw initialization).

The modified app.d used is as follows:
app.txt

Again, compiling this required adding the line:
"bindbc-glfw": "~>1.0.1" to my locally stored bindbc-imgui's dub.json, and modifying imgui.d to import bindbc.glfw after version(USE_GLFW) flags.

@LunaTheFoxgirl
Copy link
Member

Currently we don't support GLFW in the version we compile from source.

@playmer
Copy link
Collaborator

playmer commented Dec 2, 2022

I can look at this when I update the Imgui version we use in the coming week or two. I'll have to see if I can easily decide what to build based on features, otherwise Luna will be quite irritated with what I come up with.

@playmer
Copy link
Collaborator

playmer commented Dec 22, 2022

Sorry I've been a little busier than I expected. But i think I came up with a plan for this that I discussed with Luna a couple of weeks ago. Assuming it doesn't turn out awful, I should have something for PR by the end of the month. (Taking next week off, so I'll be able to devote the ~day I'll need to get this working.

@HuskyNator
Copy link
Author

Im not sure how to ask, this might be a dumb question,
But if i were to attempt to look at this myself in a fork, what would i need to do first?
Im not entirely familiar how bindings like this work yet.

@playmer
Copy link
Collaborator

playmer commented Feb 24, 2023

Sorry for the delay, time is hard to find!

This branch has most of what's needed playmer/UpdateAndCleanup

But there's still some work needed to bring it home. I was working on something to prevent us needing to touch up the imgui sources on different platforms. In theory that's not really immediately needed. I think just the first commit on that branch could be used.

The main thing is I didn't get around to testing it with all the platforms, and I didn't write a GLFW example to test it.

Offhand it probably won't work when linking statically currently (and it would be a bad experience anyway due to not being able to detect features in the sdl file. You'd need to link SDL and GLFW). The dub.sdl would need to be touched up for that. I think it should work dynamically. But like I said, I need a glfw example to finish testing on all the platforms and ensuring we can dynamically link to glfw.

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