Comments (6)
Yeah, imgui requires proper initialization and careful new_frame() / render() functions handling. We should definitely add some guards to protect from crashes like this one. Anyway, such usage will still raise exceptions. Did you try to run examples from doc/examples? You should take a look at them.
from pyimgui.
Yep, examples work fine. I was more reporting this because the error message could perhaps be better.
from pyimgui.
Yeah of course this should be fixed. Your lldb traceback shows already that there is some python assert exception raised from C++ code. This will require updating some function signatures in cython sources.
from pyimgui.
If we update all Cython signatures as following:
diff --git a/imgui/cimgui.pxd b/imgui/cimgui.pxd
index c2877ff..7ced93c 100644
--- a/imgui/cimgui.pxd
+++ b/imgui/cimgui.pxd
@@ -283,7 +283,7 @@ cdef extern from "imgui.h" namespace "ImGui":
# ====
# Window
- bool Begin(const char*, bool*, ImGuiWindowFlags) # ✓
+ bool Begin(const char*, bool*, ImGuiWindowFlags) except + # ✓
# note: following API was deprecated
# bool Begin(const char*, bool*, const ImVec2&, float, ImGuiWindowFlags)
void End() # ✓
Then running functions without Imgui context being properly initialized will result in imgui.core.ImGuiError
exception. For instance, the Python traceback for imgui.begin()
function can be following:
Traceback (most recent call last):
File "issue.py", line 4, in <module>
imgui.new_frame()
File "imgui\core.pyx", line 993, in imgui.core.new_frame (imgui/core.cpp:15179)
cimgui.NewFrame()
imgui.core.ImGuiError: ImGui assertion error (g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f) at imgui-cpp/imgui.cpp:2046
@jeremyherbert is such traceback more helpful?
from pyimgui.
I have the made required changes on fix/full-exception-coverage
branch. I need to test it extensively but it should fix this issue.
from pyimgui.
Fix merged. Now every C++ assert should be treated as imgui exception.
from pyimgui.
Related Issues (20)
- -- deleted --
- Doesn't expose ImGuiStyle::ScaleAllSizes HOT 1
- Showing input text without a label HOT 1
- Documentation left side nav not scrollable
- Can't use it and i don't know why.
- "Game Insert"
- type stubs for pyimgui HOT 4
- None of the custom renderers change mouse cursor HOT 4
- default theme font HOT 4
- Loading SVGs as viewport/texture HOT 2
- [Bug}: When using pyimgui some users of my program have `GLError`s HOT 8
- Imgui port to pygame do not suport colaboration with programable opengl pipline
- Windows: Failed building wheel for imgui (from VsDevShell) HOT 5
- Example not working HOT 1
- pyimgui equivalent of ImGuiKey_NamedKey_END HOT 1
- Overflow error when using opengl, doublebuf and fullscreen HOT 1
- ImGui crashing when using OpenGL context 3.2+ even though GPU and driver support 4.6
- Upgrading dear imgui version beyond 1.82 HOT 6
- Anyone studied if F3D is able to render on pyimgui HOT 4
- I have a problem when i trying to use imgui[glfw] io.fonts.get_glyph_ranges_chinese_full() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyimgui.