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

Prepare for v4 #157

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CImGui"
uuid = "5d785b6c-b76f-510e-a07c-3070796c7e87"
authors = ["Yupei Qi <qiyupei@gmail.com>"]
version = "3.1.1"
version = "4.0.0"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand All @@ -23,7 +23,7 @@ MakieIntegration = ["GLFW", "ModernGL", "GLMakie"]

[compat]
CEnum = "0.4, 0.5"
CImGuiPack_jll = "0.6.0"
CImGuiPack_jll = "0.7.0"
CSyntax = "0.4"
Compat = "4.16.0"
DocStringExtensions = "0.9.3"
Expand Down
18 changes: 18 additions & 0 deletions docs/src/_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ CurrentModule = CImGui
This documents notable changes in CImGui.jl. The format is based on [Keep a
Changelog](https://keepachangelog.com).

## [v4.0.0] - 2024-11-19

### Changed
- **Breaking**: We updated to [Dear ImGui
1.91.6](https://github.com/ocornut/imgui/releases/tag/v1.91.6) ([#157]). All
the changes from 1.91.3 through to 1.91.6 apply to this release. Here's a
non-exhaustive list of changes:
- `ImTextureID` is now an unsigned integer instead of a pointer. You should
replace any calls to e.g. `ig.Image(Ptr{Cvoid}(tex), ...)` with
`ig.Image(ig.ImTextureID(tex), ...)`.
- `ig.ImGuiConfigFlags_NavEnableSetMousePos` and
`ig.ImGuiConfigFlags_NavNoCaptureKeyboard` were replaced with
`ImGuiIO.ConfigNavMoveSetMousePos` and `ImGuiIO.ConfigNavCaptureKeyboard`
respectively.

For Linux/GLFW users, there's also a fix for a long-standing docking bug:
https://github.com/ocornut/imgui/issues/7733

## [v3.1.1] - 2024-11-05

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion examples/demo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function julia_demo(; engine=nothing)
if CImGui.Begin("Image Demo")
image = rand(GL.GLubyte, 4, img_width, img_height)
CImGui.update_image_texture(image_id, image, img_width, img_height)
CImGui.Image(Ptr{Cvoid}(image_id), CImGui.ImVec2(img_width, img_height))
CImGui.Image(image_id, CImGui.ImVec2(img_width, img_height))
CImGui.End()
end
end
Expand Down
4 changes: 2 additions & 2 deletions examples/demo_helper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ function ShowAboutWindow(p_open::Ref{Bool})
CImGui.Text(@sprintf("io.ConfigFlags: 0x%08X", unsafe_load(io.ConfigFlags)))
unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NavEnableKeyboard != 0 && CImGui.Text(" NavEnableKeyboard")
unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NavEnableGamepad != 0 && CImGui.Text(" NavEnableGamepad")
unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NavEnableSetMousePos != 0 && CImGui.Text(" NavEnableSetMousePos")
unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NavNoCaptureKeyboard != 0 && CImGui.Text(" NavNoCaptureKeyboard")
unsafe_load(io.ConfigNavMoveSetMousePos) && CImGui.Text(" ConfigNavMoveSetMousePos")
unsafe_load(io.ConfigNavCaptureKeyboard) && CImGui.Text(" ConfigNavCaptureKeyboard")
unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NoMouse != 0 && CImGui.Text(" NoMouse")
unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NoMouseCursorChange != 0 && CImGui.Text(" NoMouseCursorChange")
unsafe_load(io.MouseDrawCursor) && CImGui.Text("io.MouseDrawCursor")
Expand Down
6 changes: 3 additions & 3 deletions examples/demo_window.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ global function ShowJuliaDemoWindow(p_open::Ref{Bool})
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableGamepad", io.ConfigFlags, CImGui.ImGuiConfigFlags_NavEnableGamepad)
CImGui.SameLine()
CImGui.HelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", io.ConfigFlags, CImGui.ImGuiConfigFlags_NavEnableSetMousePos)
CImGui.SameLine()
CImGui.HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.")
CImGui.CheckboxFlags("io.ConfigFlags: NoMouse", io.ConfigFlags, CImGui.ImGuiConfigFlags_NoMouse)
if unsafe_load(io.ConfigFlags) & CImGui.ImGuiConfigFlags_NoMouse != 0 # create a way to restore this flag otherwise we could be stuck completely!
if mod(CImGui.GetTime(), 0.4) < 0.2
Expand All @@ -168,6 +165,9 @@ global function ShowJuliaDemoWindow(p_open::Ref{Bool})
CImGui.CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", io.ConfigFlags, CImGui.ImGuiConfigFlags_NoMouseCursorChange)
CImGui.SameLine()
CImGui.HelpMarker("Instruct back-end to not alter mouse cursor shape and visibility.")
CImGui.Checkbox("io.ConfigNavMoveSetMousePos", io.ConfigNavMoveSetMousePos)
CImGui.SameLine()
CImGui.HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiIO.ConfigNavMoveSetMousePos")
CImGui.Checkbox("io.ConfigInputTextCursorBlink", io.ConfigInputTextCursorBlink)
CImGui.SameLine()
CImGui.HelpMarker("Set to false to disable blinking cursor, for users who consider it distracting")
Expand Down
2 changes: 1 addition & 1 deletion ext/GlfwOpenGLBackend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ig._create_image_texture(::Val{:GlfwOpenGL3}, image_width, image_height
GL.glPixelStorei(GL.GL_UNPACK_ROW_LENGTH, 0)
GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, format, GL.GLsizei(image_width), GL.GLsizei(image_height), 0, format, type, C_NULL)
g_ImageTexture[id] = id
return Int(id)
return ig.ImTextureID(id)
end

function ig._update_image_texture(::Val{:GlfwOpenGL3}, id, image_data, image_width, image_height; format=GL.GL_RGBA, type=GL.GL_UNSIGNED_BYTE)
Expand Down
2 changes: 1 addition & 1 deletion ext/MakieIntegration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function ig.MakieFigure(title_id::String, f::GLMakie.Figure;
cursor_pos = ig.GetCursorScreenPos()
image_size = size(color_buffer)
ig.AddImage(drawlist,
Ptr{Cvoid}(Int(color_buffer.id)),
ig.ImTextureID(color_buffer.id),
cursor_pos,
(cursor_pos.x + image_size[1], cursor_pos.y + image_size[2]),
(0, 1), (1, 0))
Expand Down
Loading
Loading