mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-04 10:07:58 +00:00
example_glfw_opengl3 doesn't display imgui content on OpenGL3.0 #1938
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#1938
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?
Version/Branch of Dear ImGui:
1.62 release
Back-end file/Renderer/OS:
Trying to use GLFW with OpenGL3 on Linaro Linux release 16.02. Dragonboard 410c came with that OS. Supported OpenGL by the driver is "OpenGL version string: 3.0 Mesa 18.0.3" (output from glxinfo).
My Issue/Question:
In short I don't see any imgui content (no window it's just simple blue color) when I run the example_glfw_opengl3 sample. Note that I modified the main.cpp. I changed the minor version to 0 (since my driver supports OpenGL3.0) and removed the glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE) line since OpenGL3.0 doesn't support profiles.
OpenGL2 examples and it's integration with my own code works fine. I'm just not having any luck with OpenGL3.0 (can't try OpenGL3.2). I read the documentation and searched through the issues and googled this issue but didn't find anything helpful. If this is a duplicate question I'll see to removing it.
Standalone, minimal, complete and verifiable example:
I marked the changes within main.cpp with 3 excalamation marks (!!!). Everything else is vanilla.
Could you try changing the GLSL version to #130 and/or querying the shader compilation steps for errors?
I will/should add more error handling to this example, will try to do so now..
Hello,
@linaran : can you please comment the #if APPLE ... #endif in main.cpp ? Looks like you need the line
FYI, I got Linux (x86_64, Intel) here too. My new machine is OpenGL 4.5 capable, but I got the same issue when using 3.0. And commenting the lines above (#ifdef / #endif) makes it work as expected.
HTH
I have pushed a change to report shader compile and link error (I wonder how it is reported in this situation).
We ought to fix those recurring problem, perhaps lock the version GL/GLSL version on Mac and use lower one on other platforms?
Also linking to #1900, #1513, #1466, #1116 etc.
@ocornut
I'm sort of still learning OpenGL but I was under the impression that OpenGL3.0 came with GLSL1.30 by default (didn't know you can change GLSL versions)? I'll build the example with your changes and report errors.
@ebachard
I tried commenting out those lines and nothing changed.
You can call `ImGui_ImplOpenGL3_Init("#version 130") to build with a different version.
Try updating to latest/master so you'll also benefit from the error reporting code I have just pushed.
@linaran
Let's start with at the begining. Can you post the full output of :
-B option gives a summary of the most important information returned by your graphic card driver.
This will tell us what exactly you can expect with your machine.
Okay I just cloned the latest commit from master.
@ebachard
Since I'm working on 2 computers and the linux one has a limited number of usb ports direct copy paste from the terminal is cumbersome (doing it over SD card).
@ocornut
I pulled the latest commit from master, implemented the changes to OpenGL3.0 and these are the errros I got.
The same goes for the fragment shader and the linker failed as expected. I will be changing the version to GLSL1.30 per your instructions.
@ocornut
Changing the GLSL to 1.30 did the trick 👍
Thanks :)
Thanks for the confirmation @linaran.
I noticed that the shader works with 130 140 150 with the same context here,
If I change the
Texture()call toTexture2D()is also work with 100 (with warnings) and 120.I'll put a few changes soon.
What's unclear to me is how good GL drivers are honoring compatibility with older GLSL versions than the one desired by the context..
I have pushed changes to the Examples+Bindings now. @linaran if you have a chance could you confirm that the unmodified repository now works with your configuration? Thanks!
@ocornut I'm confirming that the unmodified repository works. Cheers!
Excellent, closing this issue then!