Skip to content
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

Help / About Dear ImGui / Config/Build information throws an error #123

Closed
scls19fr opened this issue Jun 19, 2024 · 1 comment · Fixed by #122
Closed

Help / About Dear ImGui / Config/Build information throws an error #123

scls19fr opened this issue Jun 19, 2024 · 1 comment · Fixed by #122

Comments

@scls19fr
Copy link

scls19fr commented Jun 19, 2024

Hello,

demo.jl example
Help / About Dear ImGui / Config/Build information throws an error

julia> using CImGui

julia> include(joinpath(pathof(CImGui), "..", "..", "examples", "demo.jl"))
┌ Error: Error in renderloop!
│   exception = TypeError: non-boolean (Ptr{Int8}) used in boolean context
└ @ Main C:\Users\Admin\.julia\packages\CImGui\heNEs\examples\demo.jl:123

Stacktrace:
  [1] ShowAboutWindow(p_open::Base.RefValue{Bool})
    @ Main C:\Users\Admin\.julia\packages\CImGui\heNEs\examples\demo_helper.jl:66
  [2] ShowJuliaDemoWindow(p_open::Base.RefValue{Bool})
    @ Main C:\Users\Admin\.julia\packages\CImGui\heNEs\examples\demo_window.jl:78
  [3] top-level scope
    @ C:\Users\Admin\.julia\packages\CImGui\heNEs\examples\demo.jl:89
  [4] include(fname::String)
    @ Base.MainInclude .\client.jl:489
  [5] top-level scope
    @ REPL[2]:1
  [6] eval
    @ .\boot.jl:385 [inlined]
  [7] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
    @ REPL C:\Users\Admin\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:150
  [8] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
    @ REPL C:\Users\Admin\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:246
  [9] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL C:\Users\Admin\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:231
 [10] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
    @ REPL C:\Users\Admin\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:389
 [11] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL C:\Users\Admin\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:375
 [12] (::Base.var"#1013#1015"{Bool, Bool, Bool})(REPL::Module)
    @ Base .\client.jl:432
 [13] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
 [14] invokelatest
    @ .\essentials.jl:889 [inlined]
 [15] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
    @ Base .\client.jl:416
 [16] exec_options(opts::Base.JLOptions)
    @ Base .\client.jl:333
 [17] _start()
    @ Base .\client.jl:552

It works correctly with

julia> include(joinpath(pathof(CImGui), "..", "..", "demo", "demo.jl"))

Tools / About Dear ImGui / Config/Build information

Thanks @Gnimuc @JamesWrigley and others for the great work on this lib.

Kind regards

@JamesWrigley
Copy link
Collaborator

Thanks for the report, I believe the issue is that on line 66 (and 67) we're trying to check the truthiness of a pointer: https://github.com/Gnimuc/CImGui.jl/blob/master/examples/demo_helper.jl#L66

What those ternaries should be checking is probably unsafe_load(io.BackendPlatformName) == C_NULL. I'm a bit busy with the update to 1.90.8 and the test engine wrapper so I probably won't be able to get to this for a week or so (but feel free to take a stab at it if you like :) ).

@scls19fr scls19fr changed the title Help / About Dear ImGui / Config/Build information throw an error Help / About Dear ImGui / Config/Build information throws an error Jun 19, 2024
@JamesWrigley JamesWrigley linked a pull request Jun 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants