-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Using OpenGL 3 bindings to display in an OpenGL 2.1 context ? #1513
Comments
A few things to try:
I don't really understand what you are asking. You have access to all the code in opengl2 and opengl3 folders with code for both styles, just use/copy what works for you. It's however quite suspicious that the opengl3 doesn't work and it would be judicious to understand the reason. |
(ADMIN: Restored accidental edit to original post) Thanks for your quick answer Omar, I really appreciate :)
I modified the version, with no visible behaviour change unfortunately ...
My ultimate goal would be to be able to choose between legacy or modern opengl at runtime, depending on the graphics card capability, in order to have my program working on a wide range of machines ... I guess I will have to stick to OpenGL 2 bindings and to forget about modern OpenGL migration for now then ... |
Looks like you edited my post instead of answering it :p
I actually tested this route, without being successful :D
I second that ... I guess I'll have to dig further :) |
(My apologies! It is the second time this happens here.. I restored your post according to the e-mail notification now. It's quite unusual and dangerous that github even gives me this button.)
Not sure what you mean here. Unless you referring to the second paragraph, that you don't know what to test for? Otherwise having both code paths in the same exe should work. |
I tried to factorize the code, keeping only one main codepath and calling specific OpenGL variants depending on the version used, but it didn't work. BTW, thanks for your work, not only on Dear Imgui, but also on everything else (gaming wise, emulation wise and all ...) 🥇 |
First of all, happy new year everyone ! :D Next, I've been doing some more research about the initial problem I'm having at the beginning of the thread (ie the garbled display in the first post). So what's new you might (rightfully) ask ? I don't know enough of Dear Imgui inner working to see if it's interesting, but I thought it might ring a bell to someone ... |
Hello Runik, and happy new year! |
I changed the glsl version to 150 with no visible improvement, unfortunately ... |
@rtoumazet Sorry for the bump (better late than never!). I have made some changes to the imgui_impl_opengl3.cpp bindings to support lower GLSL versions. However it is tricky to fully test locally as modern drivers have different properties emulating old contexts and I don't think there is a way pre-GL 3.0 to disable backward compatibility. I would be interested if you could confirm how the examples currently fare with your laptop? Thank you for your help. |
Don't worry Omar, I know how it is ;) No driver change on the laptop (Toshiba isn't interested in updating a 2012 proprietary graphic driver :p) |
Thanks for your test and feedback! With your help I would really like to solve this.
Currently:
Try to changing to:
or
Note that the example now display shader compilation/link error in stdout (which should appear in the console under Windows) so worth checking there. Thank you. |
Ok, so here we go :)
|
Hi,
I'm getting into a strange problem while trying to add imgui to one of my projects : this project was started in 2002 and uses what's now called legacy OpenGL.
I wanted to take advantage of the switch to move to modern OpenGL (3.3+).
Unfortunately there are some caveats : when compiling the basic example on my desktop computer (with a fairly recent graphics card), everything works fine and the windows are correctly displayed.
On the other hand, when compiling the OpenGL 3 example on a laptop (with an integrated Intel HD4000 graphics card), I get a 0xC0000005 exception before any rendering is done, and if I remove glfwWindowHint calls to get a compatibility context, the display is garbled, and the inputs are erratic at best :
The graphics card is supposed to have a 3.3 context capability, but it looks like the drivers aren't up to the task. And as it's a branded laptop, the drivers are proprietary, old, and can't be replaced by vanilla Intel drivers ...
I've tried compiling the OpenGL 2 version on the laptop, and it works fine.
So my question is : using OpenGL 3 bindings, is it possible to force OpenGL to display imgui through an OpenGL 2 context ?
Thanks for reading :)
The text was updated successfully, but these errors were encountered: