mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-04 20:32:00 +00:00
Exception thrown when shaders are created #4428
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#4428
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: 1.83
branch: master
imgui_impl_opengl3
imgui_impl_sdl
I just finished getting everything working and compiled and ran my program, but as soon as it starts it stops and I get
The exception is in imgui_impl_opengl3.cpp and is at this chunk of code
Here is the repo if you want to clone it and run it
https://github.com/Lester702/Henly/tree/testing_imgui
Closing as lacking sufficient information and generally not our problem, given the scope of the codebase.
Use a debugger to isolate the exact source code and function call leading to a crash.
Make sure you passed a valid glsl version to ImGuiImplOpenGL3_Init().
Make sure the backend has the GL loader it uses correctly initialized by your application.
All the issues literally come from ImGui
Omar suggested what you can do to find why your project is crashing.
Please investigate it before you jump to conclusions.
I was using the gl3w files that were in the ImGui/examples/libs folder and then switched to https://sourceforge.net/projects/glew/files/glew/2.1.0/
Which fixed my original problem, but now ImGui doesn't render to the window
You can try to compare example_sdl_opengl3/main.cpp with your code and look for the differences. Maybe even debugging side by side to pin out the bug.
An error which occurs while Dear ImGui code is executing does not necessarily indicate an error caused by Dear ImGui.
By your own admission you're still learning C++. C++ is not like Python where inputs are constantly validated and friendly exceptions are thrown when you do something wrong. If you feed garbage into Dear ImGui (or any C++ library), you will get garbage out. (Sometimes you'll get an assert too, but there's only so much validation that can be done, especially in a memory-unsafe language.)
We can't debug your entire app for you, there's a number of reasons this might be happening. @thedmd's suggestion is a good one.
Another thing in particular that stands out to me is this issue is for OpenGL but your repo appears to be using Vulkan but you seem to be using a custom SDL_render-based backend for Dear ImGui? You can't (easily) mix graphics APIs like this, you need to pick one and stick to it. (Also as an aside, I really would not recommend trying to learn Vulkan while you're still learning C++.)
I had just switched it to Vulkan, but realized that Vulkan requires more code than OpenGL to do something such as drawing a triangle