Go wrapper library for "Dear ImGui"
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_examples/opengl3_example #5 fixing shader code for Alpha8 texture Oct 5, 2018
_licenses initial commit May 21, 2018
.gitignore initial commit May 21, 2018
AllocatedGlyphRanges.go linter issues Oct 5, 2018
AllocatedGlyphRanges_test.go Rearranged AllocatedGlyphRanges type Oct 4, 2018
Assert.go go fmt over complete project Jul 27, 2018
CONTRIBUTING.md switching to golangci-lint Jul 5, 2018
ComboFlags.go go fmt over complete project Jul 27, 2018
Conditions.go update on window properties Jun 2, 2018
Context.go go fmt over complete project Jul 27, 2018
Context_test.go switching to golangci-lint Jul 5, 2018
DrawCommand.go initial commit May 21, 2018
DrawCommandWrapper.cpp initial commit May 21, 2018
DrawCommandWrapper.h initial commit May 21, 2018
DrawData.go initial commit May 21, 2018
DrawDataWrapper.cpp initial commit May 21, 2018
DrawDataWrapper.h initial commit May 21, 2018
DrawData_test.go initial commit May 21, 2018
DrawList.go initial commit May 21, 2018
DrawListWrapper.cpp initial commit May 21, 2018
DrawListWrapper.h initial commit May 21, 2018
Font.go extended FontAtlas to load fonts from files. Jun 27, 2018
FontAtlas.go linter issues Oct 5, 2018
FontAtlasWrapper.cpp added FontAtlas.SetTexDesiredWidth() Oct 4, 2018
FontAtlasWrapper.h added FontAtlas.SetTexDesiredWidth() Oct 4, 2018
FontConfig.go #6 added GlyphRanges and options to use them Sep 20, 2018
GlyphRanges.go linter issues Oct 5, 2018
HoveredFlags.go added IsItemHovered and tooltip support Jul 14, 2018
IO.go Removed memory leak and UTF8 in function name Jul 10, 2018
IOWrapper.cpp processed pull request comments Jul 10, 2018
IOWrapper.h processed pull request comments Jul 10, 2018
LICENSE update Jul 25, 2018
README.md added go report card Jul 27, 2018
Style.go added getter for Style.ItemInnerSpacing Aug 4, 2018
StyleWrapper.cpp added getter for Style.ItemInnerSpacing Aug 4, 2018
StyleWrapper.h added getter for Style.ItemInnerSpacing Aug 4, 2018
TextureID.go added Image() and more documentation on TextureID Jul 5, 2018
TreeNodeFlags.go go fmt over complete project Jul 27, 2018
Vectors.go initial commit May 21, 2018
WindowFlags.go added WindowFlags constants May 23, 2018
WrapperConverter.cpp initial commit May 21, 2018
WrapperConverter.go added SliderInt Jun 13, 2018
WrapperConverter.h added support for PushStyleColor Jun 3, 2018
doc.go started with package documentation May 23, 2018
imconfig.h added assertion handler to go Jun 29, 2018
imgui.cpp initial commit May 21, 2018
imgui.go #8 adding compiler flag to specify C++11 std Oct 14, 2018
imgui.h initial commit May 21, 2018
imguiWrappedHeader.h initial commit May 21, 2018
imguiWrapper.cpp added BeginPopupContextItem Jul 21, 2018
imguiWrapper.h added BeginPopupContextItem Jul 21, 2018
imguiWrapperTypes.h #6 added GlyphRanges and options to use them Sep 20, 2018
imgui_demo.cpp initial commit May 21, 2018
imgui_draw.cpp initial commit May 21, 2018
imgui_internal.h initial commit May 21, 2018
imgui_test.go initial commit May 21, 2018
stb_rect_pack.h initial commit May 21, 2018
stb_textedit.h initial commit May 21, 2018
stb_truetype.h initial commit May 21, 2018

README.md

Dear ImGui for Go

Go Report Card

This library is a Go wrapper for Dear ImGui.

At the moment, this wrapper is a special-purpose wrapper for use within InkyBlackness. However, it is self-contained and can be used for other purposes as well.

This wrapper is

  • hand-crafted, for Go
  • documented
  • versioned
  • with a ported example using GLFW3 and OpenGL3.

Screenshot from example

API naming

Names of types and functions follow closely those of Dear ImGui.

For functions that have optional parameters, the following schema is applied:

  • There is the "verbose" variant, followed by the letter V, such as ButtonV(id string, size Vec2) bool
  • Next to it there is the "idiomatic" variant, without any optional parameter, such as Button(id string) bool.
  • The idiomatic variant calls the verbose variant with the default values for the optional parameters. Functions that don't have optional parameters don't come in a verbose variant.

The Dear ImGui functions IO() and Style() have been renamed to be CurrentIO() and CurrentStyle(). This was done because their returned types have the same name, causing a name clash. With the Current prefix, they also better describe what they return.

API philosophy

This library does not intend to export all the functions of the wrapped ImGui. The following filter applies as a rule of thumb:

  • Functions marked as "obsolete" are not available. (The corresponding C code isn't even compiled - disabled by define)
  • "Shortcut" Functions, which combine language features and/or other ImGui functions, are not available. Prime example are the Text*() functions for instance: Text formatting should be done with fmt.Sprintf(), and style formatting with the corresponding Push/Pop functions.
  • Functions that are not needed by InkyBlackness are ignored. This doesn't mean that they can't be in the wrapper, they are simply not a priority. Feel free to propose an implementation or make a pull request, respecting the previous points :)

Version philosophy

This library does not mirror the versions of the wrapped ImGui. The semantic versioning of this wrapper is defined as:

  • Major changes: (Breaking) changes in API or behaviour. Typically done through changes in ImGui.
  • Minor changes: Extensions in API. Typically done through small version increments of ImGui and/or exposing further features in a compatible way.
  • Patch changes: Bug fixes - either in the wrapper or the wrapped ImGui, given that the API & behaviour remains the same.

At the moment, this library uses version 1.61 of ImGui.

Alternatives

Before this project was created, the following alternatives were considered - and ignored:

  • kdrag0n/go-imgui. Reasons for dismissal:
    • Auto-generated bloat, which doesn't help
    • Old API (1.5x)
    • Does not compile (Issues 1 and 3)
    • Project appears to be abandoned
  • Extrawurst/cimgui. Reasons for dismissal:
    • Old API (1.5x), 1.6x attempted, in-progress, could not be used
    • Appears to still semi-expose the C++ API, especially through the structures
    • Adding this adds another dependency

License

The project is available under the terms of the New BSD License (see LICENSE file). The licenses of included sources are stored in the _licenses folder.