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

Imgui does not draw under MacOS #314

Open
rezzeted opened this issue Feb 1, 2025 · 14 comments
Open

Imgui does not draw under MacOS #314

rezzeted opened this issue Feb 1, 2025 · 14 comments

Comments

@rezzeted
Copy link

rezzeted commented Feb 1, 2025

Initially I encountered this in version 2.6 simply using imgui-sfml from the vcpkg package manager. Then I tried to take the 3.0 version of sfml-imgui, made a local fork of vcpkg and updated sfml in it to version 3.0.0. This did not change anything, in the minimal example I see a green circle that is drawn using sfml, but I do not see any windows from imgui, nothing at all.
Is there any possibility that should be taken into account for MacOS(M1 version)?

@ChrisThrasher
Copy link
Member

ChrisThrasher commented Feb 2, 2025

macOS support (both ARM and Intel) exists. I personally use ImGui-SFML on macOS. Can you share a minimum reproducible example for me to test? Also please share screenshots. I can't picture what you're describing. The more details the better or else there's not much I can do.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

Sure. I took the imgui-sfml repository as a starting point, then connected my fork of vcpkg as a submodule and updated sfml to version 3 in it, maybe a little crookedly and I didn't take into account some build options (static or dynamic), but my goal was to get the final result as quickly as possible. Everything is fine on Windows. It builds on Mac, but as you can see in the screenshot there is nothing except the basic sfml shape (green circle).
https://github.com/icecampus/imgui-sfml

Image

Instructions.

  1. clone the repository
  2. Update the submodule (submodule init, submodule update, etc)
  3. Go to the vcpkg folder and run the bootstrap-vcpkg.sh script
  4. Run build.sh (probably a bad name for a script that will create xcodeproject, but what it is)
  5. Open the project in the _intermediate_64 folder and run the minimal example

You might be confused that I am using another account's repository. I created a second account for a channel with programming tutorials.

@ChrisThrasher
Copy link
Member

Can you share your C++ code? I'll try building and running it.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

Can you share your C++ code? I'll try building and running it.

Yes. It is in repo with all dependency https://github.com/icecampus/imgui-sfml

I use the version of sflm from their repository tagged 3.0.0

@ChrisThrasher
Copy link
Member

https://github.com/SFML/imgui-sfml/blob/master/examples/minimal/main.cpp

Is it this file? Sending me a link to the entire repo is a bit imprecise. I'm not sure exactly what file you have in mind.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

Yes, it is, but I didn't make any changes on it.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

I'm not sure exactly what file you have in mind.

Sorry, this is my first time participating in a discussion on GitHub.

@ChrisThrasher
Copy link
Member

Image

I just built the example and ran it on macOS. Everything looks fine to me. Perhaps the issue lies in the way you're using Vcpkg or otherwise building the project. I'm not really sure.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

Perhaps the issue lies in the way you're using Vcpkg or otherwise building the project. I'm not really sure.

I suspect several possible problems:

  1. incompatibility with the SFML version (very low probability, because I used tested versions of packages from the master branch of the VCPK, even though there was a 2.6 branch)
  2. Some subtlety with setting up the build specifically for MacOS, it is necessary to specify specific permissions in the project or use special keys.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

Maybe you have a repository with sfml and cmake build scripts? I would try it on your version and then analyze the difference in the project setup.

@ChrisThrasher
Copy link
Member

I'm just using all the normal released code. I'm using an unmodified version of ImGui-SFML and an unmodified version of SFML. It's as simple as that. I just built ImGui-SFML and ran the minimal example. I don't have a repo of special scripts. All the differences can be attributed to the changes you made.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

How did you install SFML?

@ChrisThrasher
Copy link
Member

ChrisThrasher commented Feb 2, 2025

I built SFML 3.0.0's install target. If you want to talk more about your build issues, I encourage you to join the SFML Discord server.

@rezzeted
Copy link
Author

rezzeted commented Feb 2, 2025

Thank you for your answers, I will try your option and write about the results a little later.

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

2 participants