mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-04 10:07:58 +00:00
Backend renderer naming/filename mismatch GL versions #1900
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#1900
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think there's some confusion in the OpenGL example renderers. OpenGL 2.0 is where the programmable pipeline was added. The GL 3.2 renderer actually only requires GL 2.0, if you change the shader to version 1.10 (and thus, to use
attribute,varyingandgl_FragColor), and the GL 2 renderer doesn't use any GL 2 features. The way it is, the 3.2 requirement is completely unnecessary.You may be right here.
#150shader version.I'd be tempted to just rename the opengl2.* files to opengl1.*
I realized the title doesn't actually reflect what I mean, so I changed it. But yes, there is a use. Not all computers have GL 3.2. I can't just require it in my application if it's not necessary, I'll be leaving a lot of users behind and pissing off a lot of people. I can't just assume everyone has it. A good example is Godot, it started requiring 3.3 and it was a disaster (they're adding 2.0 support back).
But it's true that the GLSL support is a mess. I found that GL 4.5 only requires GLSL 1.40 and later to be supported, although 1.10 is often supported anyway. But it also requires GLSL 1.00, so an option would be to lower the GL 3.2 example to 3.1, and create another version for GL ES 2.0, which isn't going away anytime soon. Optionally, there could be another version for desktop GL 2.0.
But the existing "OpenGL 2" example already full-fill that criteria.
Also, I presume an engine like Godot would have its own renderer, so it'll be easy to rewrite a renderer for their API.
I wouldn't want a renderer with consequences like those.
And Godot's new 2.0 renderer has been in development since the beginning of this year, and it's still not ready, so it's clearly not easy.
Regardless, if you implemented dear imgui in Godot you would want to use Godot's renderer API and not really a raw OpenGL api?
I'm not using Godot. And this is about the GL versions of the examples, nothing to do with Godot.
Maintaining those examples is already a crazy amount of work. I can’t be creating new ones for hypothetical situations.
It’s easier for anyone to create the render loop they need in their own project than for me or anyone to create one function that save and restore every possible GL state for a given GL version.
I don't follow. I was saying the GL 3 example only actually required GL 2 features, so there could be an identical one with a a #version 110 shader named GL 2, and the current GL 2 example could be renamed to GL 1. No need to fix the current legacy GL example.
I may rename the GL2 to GL1.
The mere changing of the GLSL version to
#version 110+ shader is something we haven't tested properly it is bound to break something. See #1466, #1513, #1667 and dozens of other issues to get an impression how tricky/messy the whole multi-platform driver situation is. While I'm not against it, there's no point is risking to break something if there's no actual user for it.@jv110 I have now pushed some changes to the GL3 code Examples+Bindings to support more version of GLSL. Unfortunately it is tricky to test widely because each drivers appears to have different support for backward compatibility, and before GL 3.0 we can't reliably request a Forward Compatible context.
I think it should work now with GLSL
#version 110(see commit above) but it's not impossible that my driver is being kinder than required. Perhaps it'll work with GL ES now.Interested in your feedback if you have any way to test some of this.
Do you think as it stand the code would run on a pure GL 2.0 era machine?
(I am still considering doing some renaming renaming after we sorted this out carefully)
Hello @jv110,
Would you be able to help testing and/or patch the code in imgui_impl_opengl3.cpp to correctly support GL 2.0/2.1 and GLSL 1.10 ?
Right now we default to GLSL 1.30 what do you think of that in term of compatibility?
imgui_impl_opengl3.cpp has been recently improved for WebGL 1/2. I will rename
imgui_impl_opengl3.cpptoimgui_impl_opengl.cpp, andimgui_impl_opengl2.cpptoimgui_impl_opengl_legacy.cppeventually, maybe the 1.70 milestone is a good target for that.Thank you.
I'm sorry, it had been so long, I had forgotten about all this. But sure, I can try to help. I'll try this out tomorrow.
1.30 is pretty good, and I think a lot of applications do require that, although the choice is important. My computer only supports GL 3.1 (GLSL 1.40), if that's relevant.