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

opengl_3d_example #606

Closed
wants to merge 2 commits into from
Closed

opengl_3d_example #606

wants to merge 2 commits into from

Conversation

johnfercher
Copy link

@johnfercher johnfercher commented Apr 24, 2016

Dear Omar,

I'm using the ImGui in some projects where I created a 3D World and I realized, there aren't a simple example of how to do that. So I made this pull request with an adaptation of opengl_example with this, to do that I used Glew and added some libs on Makefile, I only was able to test the Makefile with Ubuntu 14.04.

Example:
3d

Sincerely,
Johnathan Fercher

@ocornut
Copy link
Owner

ocornut commented Apr 24, 2016

Hello Johnathan,
I'm not sure to see the added value of this example - the added code have nothing to do with ImGui afaik?

@johnfercher
Copy link
Author

johnfercher commented Apr 24, 2016

Exists some simulators that needs a virtual 3d/2d world and to simplify the interaction is added some GUI, like: https://github.com/SIRLab/VSS-Vision and https://github.com/roboime/ssl-sim, both working with robot soccer.
I choose ImGui cause it's simple to use, but I had some problems to connect the ideas. So I made this example, if you think this example doesn't add value to this repository it's ok.

@ocornut
Copy link
Owner

ocornut commented Apr 24, 2016

Oh I totally get why you want to use ImGui in a 3d application, this is what I do all the time :)
But as an example application to include in the ImGui repository (and that I have to maintain forever) I don't understand what this example is adding that relate to the ImGui itself. The examples are not mean to be OpenGL 3d tutorial.

but I had some problems to connect the ideas

I'm interested in your feedback about this. How else do you think the code/documentation/example could be improved that would have helped you?

Thanks!

@johnfercher
Copy link
Author

I started trying to use freeglut3, but bugs happen when I defined the world in parameters of glut and ImGui, bugs like:

  • An object rotating sometimes staying totally white
  • ImGui::MainMenuBar() sometimes staying totally black

@ocornut
Copy link
Owner

ocornut commented Apr 24, 2016

Perhaps a case of selecting/not-selecting current shader. If you used the GL2 code it doesn't know about shader, so you may need to call glUseProgram(0) on your side before calling render. I will a add more explicit comment about that. Have you noticed this comment in README.txt:

opengl_example/
    OpenGL example, using GLFW + fixed pipeline.
    This is simple and should work for all OpenGL enabled applications.
    Prefer following this example to learn how ImGui works!
    (You can use this code in a GL3/GL4 context but make sure you disable the programmable pipeline
    by calling "glUseProgram(0)" before ImGui::Render.)

I will add it to the opengl_example/ code as well.

@johnfercher
Copy link
Author

I Understand, I will test this.

ocornut added a commit that referenced this pull request Apr 24, 2016
@johnfercher
Copy link
Author

It works =)

@valera-rozuvan
Copy link

@johnfercher You contribution lives on! = ) Check out https://github.com/valera-rozuvan/opengl-sample-with-imgui .

@johnfercher
Copy link
Author

Nice @valera-rozuvan, Thx =).

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.

None yet

3 participants