Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion ImGuiColorTextEdit/cflags.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ImGuiColorTextEdit

// #cgo CPPFLAGS: -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS
// #cgo CPPFLAGS: -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS -DIMGUI_USE_WCHAR32
// #cgo CXXFLAGS: --std=c++11
// #cgo amd64,linux LDFLAGS: ${SRCDIR}/../lib/linux/x64/cimgui.a
// #cgo linux CXXFLAGS: -Wno-changes-meaning -Wno-invalid-conversion -fpermissive
Expand Down
9 changes: 0 additions & 9 deletions ImGuiColorTextEdit/funcs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,18 @@ update: setup
rm -rf cwrappers/*
$(call update,cimgui,https://github.com/cimgui/cimgui,imgui,docking, --cflags "glfw opengl3 opengl2 sdl2 -DIMGUI_USE_WCHAR32")
cat templates/assert.h >> cwrappers/imgui/imconfig.h
$(call cimgui)
$(call imgui)
$(call update,cimplot,https://github.com/cimgui/cimplot,implot,master)
$(call cimplot)
$(call implot)
$(call update,cimnodes,https://github.com/cimgui/cimnodes,imnodes,master)
$(call cimnodes)
$(call imnodes)
$(call update,cimmarkdown,https://github.com/gucio321/cimmarkdown,imgui_markdown,main)
$(call cimmarkdown)
$(call immarkdown)
$(call update,cimguizmo,https://github.com/cimgui/cimguizmo,ImGuizmo,master)
$(call cimguizmo)
$(call imguizmo)
$(call update,cimCTE,https://github.com/cimgui/cimcte,ImGuiColorTextEdit,master)
$(call cimcte)
$(call imcte)
$(call vendor-eliminate)
$(call dummy)

# dummy creates dummy.go files to baypass GO vendor policy that excludes everything that has no .go files (including our C source).
Expand All @@ -143,6 +144,12 @@ define dummy
echo ")" >> dummy.go
endef

define vendor-eliminate
for i in `find . -name vendor -type d`; do \
mv $$i $${i}1; \
done
endef

.PHONY: dummy
dummy:
$(call dummy)
2 changes: 1 addition & 1 deletion backend/ebiten-backend/ebiten_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (e *EbitenBackend) onfinalize() {
}

runtime.SetFinalizer(e, nil)
e.ctx.Destroy()
imgui.DestroyContext()
}

func (e *EbitenBackend) controlCursorShapeFn() {
Expand Down
6 changes: 3 additions & 3 deletions backend/glfwbackend/glfw_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GLFWwindow *igCreateGLFWWindow(const char *title, int width, int height,
afterCreateContext();
}

ImGuiIO *io = igGetIO();
ImGuiIO *io = igGetIO_Nil();
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
// io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad
// Controls
Expand Down Expand Up @@ -145,7 +145,7 @@ void glfw_render(GLFWwindow *window, VoidCallback renderLoop) {
igRender();
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());

ImGuiIO *io = igGetIO();
ImGuiIO *io = igGetIO_Nil();

// Update and Render additional Platform Windows
// (Platform functions may change the current OpenGL context, so we
Expand All @@ -165,7 +165,7 @@ void glfw_render(GLFWwindow *window, VoidCallback renderLoop) {
void igGLFWRunLoop(GLFWwindow *window, VoidCallback loop, VoidCallback beforeRender, VoidCallback afterRender,
VoidCallback beforeDestroyContext) {
glfwMakeContextCurrent(window);
ImGuiIO *io = igGetIO();
ImGuiIO *io = igGetIO_Nil();

// Load Fonts
// - If no fonts are loaded, dear imgui will use the default font. You can
Expand Down
4 changes: 2 additions & 2 deletions backend/sdlbackend/sdl_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ SDL_Window* igCreateSDLWindow(const char* title, int width, int height,VoidCallb
afterCreateContext();
}

ImGuiIO* io = igGetIO();
ImGuiIO* io = igGetIO_Nil();
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
Expand Down Expand Up @@ -149,7 +149,7 @@ void igRefresh() {

void igSDLRunLoop(SDL_Window *window, VoidCallback loop, VoidCallback beforeRender, VoidCallback afterRender,
VoidCallback beforeDestroyContext) {
ImGuiIO* io = igGetIO();
ImGuiIO* io = igGetIO_Nil();
// Main loop
bool done = false;
#ifdef __EMSCRIPTEN__
Expand Down
4 changes: 3 additions & 1 deletion cmd/codegen/cimgui-go-preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"ImGuiInputTextCallback": true
},
"SkipFiles": [
"imgui_freetype"
],
"TypedefsPoolSize": 32,
"TypedefsCustomPoolSizes": {
Expand All @@ -58,7 +59,8 @@
"igGetDrawData": "CurrentDrawData",
"igGetDrawListSharedData": "CurrentDrawListSharedData",
"igGetFont": "CurrentFont",
"igGetIO": "CurrentIO",
"igGetIO_Nil": "CurrentIO",
"igGetPlatformIO_Nil": "CurrentPlatformIO",
"igGetPlatformIO": "CurrentPlatformIO",
"igGetStyle": "CurrentStyle",
"igGetMouseCursor": "CurrentMouseCursor",
Expand Down
3 changes: 2 additions & 1 deletion cmd/codegen/gencpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ extern "C" {
}

// check if func name is valid
if len(f.FuncName) == 0 {
if len(f.FuncName) == 0 ||
MapContainsAny(f.Location, ctx.preset.SkipFiles) {
shouldSkip = true
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/codegen/gengo_callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (g *callbacksGenerator) writeCallback(typedefName CIdentifier, def string)
// - returnType <funcName>(args1 arg1Name, args2 arg2Name, args3 arg3Name);
// NOTE: the second is uesed mainly in immarkdown
// NOTE: in the 1st, spaces does not matter so we'll trim them
expr1, err := regexp.Compile("([a-zA-Z0-9_]+\\*?)\\(\\*.*\\)\\((.*)\\);")
expr1, err := regexp.Compile("(typedef )?([a-zA-Z0-9_]+\\*?) *\\(\\*.*\\)\\((.*)\\);")
if err != nil {
panic(fmt.Sprintf("Cannot compile regex expr1!: %v", err))
}
Expand All @@ -102,6 +102,7 @@ func (g *callbacksGenerator) writeCallback(typedefName CIdentifier, def string)
// now split by "("
// it should be something like this:
// ["returnType", "*<optional func name)", "args1 arg1Name, args2 arg2Name, args3 arg3Name);"]
def = TrimPrefix(def, "typedef ")
parts := Split(def, "(")
if len(parts) != 3 {
panic("Cannot split by (, check implementation in cmd/codegen!")
Expand Down
7 changes: 6 additions & 1 deletion cwrappers/ImGuiColorTextEdit/ImGuiDebugPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ void TextEditor::ImGuiDebugPanel(const std::string& panelName)
ImGui::DragInt("Cursor count", &mState.mCurrentCursor);
for (int i = 0; i <= mState.mCurrentCursor; i++)
{
static Coordinates sanitizedStart, sanitizedEnd;
sanitizedStart = SanitizeCoordinates(mState.mCursors[i].mInteractiveStart);
sanitizedEnd = SanitizeCoordinates(mState.mCursors[i].mInteractiveStart);
ImGui::DragInt2("Interactive start", &mState.mCursors[i].mInteractiveStart.mLine);
ImGui::DragInt2("Interactive end", &mState.mCursors[i].mInteractiveEnd.mLine);
ImGui::Text("Sanitized start: %d, %d", sanitizedStart.mLine, sanitizedStart.mColumn);
ImGui::Text("Sanitized end: %d, %d", sanitizedEnd.mLine, sanitizedEnd.mColumn);
}
}
if (ImGui::CollapsingHeader("Lines"))
{
for (int i = 0; i < mLines.size(); i++)
{
ImGui::Text("%d", mLines[i].size());
ImGui::Text("%zu", mLines[i].size());
}
}
if (ImGui::CollapsingHeader("Undo"))
Expand Down
Loading
Loading