SVI ae98ccd7df d01 Обновление вендоринга hace 2 años
..
.gitignore ae98ccd7df d01 Обновление вендоринга hace 2 años
.go.mod.swp ae98ccd7df d01 Обновление вендоринга hace 2 años
Assert.go ae98ccd7df d01 Обновление вендоринга hace 2 años
BackendFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
CONTRIBUTING.md ae98ccd7df d01 Обновление вендоринга hace 2 años
ColorEditFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
ColorPickerFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
ComboFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Conditions.go ae98ccd7df d01 Обновление вендоринга hace 2 años
ConfigFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Context.go ae98ccd7df d01 Обновление вендоринга hace 2 años
DragDrop.go ae98ccd7df d01 Обновление вендоринга hace 2 años
DragDropWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
DragDropWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawCommand.go ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawCommandWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawCommandWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawData.go ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawDataWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawDataWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawList.go ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawListWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
DrawListWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
FocusFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Font.go ae98ccd7df d01 Обновление вендоринга hace 2 años
FontAtlas.go ae98ccd7df d01 Обновление вендоринга hace 2 años
FontAtlasWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
FontAtlasWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
FontConfig.go ae98ccd7df d01 Обновление вендоринга hace 2 años
FontConfigWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
FontConfigWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
FontGlyphRangesBuilderWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
FontGlyphRangesBuilderWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
FontGlyphRnagesBuilder.go ae98ccd7df d01 Обновление вендоринга hace 2 años
FontWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
FontWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
GlyphRanges.go ae98ccd7df d01 Обновление вендоринга hace 2 años
HoveredFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
IO.go ae98ccd7df d01 Обновление вендоринга hace 2 años
IOWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
IOWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
InputText.go ae98ccd7df d01 Обновление вендоринга hace 2 años
InputTextCallbackDataWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
InputTextCallbackDataWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
Keys.go ae98ccd7df d01 Обновление вендоринга hace 2 años
LICENSE.txt ae98ccd7df d01 Обновление вендоринга hace 2 años
ListClipper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
ListClipper.go ae98ccd7df d01 Обновление вендоринга hace 2 años
ListClipper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
MouseCursorFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
PlatformGlfw.go ae98ccd7df d01 Обновление вендоринга hace 2 años
PlatformInterface.go ae98ccd7df d01 Обновление вендоринга hace 2 años
README.md ae98ccd7df d01 Обновление вендоринга hace 2 años
RendererInterface.go ae98ccd7df d01 Обновление вендоринга hace 2 años
RendererOpenGL3.go ae98ccd7df d01 Обновление вендоринга hace 2 años
SelectableFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Style.go ae98ccd7df d01 Обновление вендоринга hace 2 años
StyleWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
StyleWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
TabBarFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
TabItemFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Table.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
Table.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Table.h ae98ccd7df d01 Обновление вендоринга hace 2 años
TextEditor.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
TextEditor.go ae98ccd7df d01 Обновление вендоринга hace 2 años
TextEditor.h ae98ccd7df d01 Обновление вендоринга hace 2 años
TextEditorWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
TextEditorWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
TextureID.go ae98ccd7df d01 Обновление вендоринга hace 2 años
TreeNodeFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
Vectors.go ae98ccd7df d01 Обновление вендоринга hace 2 años
WindowFlags.go ae98ccd7df d01 Обновление вендоринга hace 2 años
WrapperConverter.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
WrapperConverter.go ae98ccd7df d01 Обновление вендоринга hace 2 años
WrapperConverter.h ae98ccd7df d01 Обновление вендоринга hace 2 años
doc.go ae98ccd7df d01 Обновление вендоринга hace 2 años
imconfig.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui.go ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imguiWrappedHeader.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imguiWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imguiWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imguiWrapperTypes.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_demo.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_draw.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_internal.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_markdown.go ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_markdown.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_markdown_wrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_markdown_wrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_memory_editor.go ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_memory_editor.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_memory_editor_wrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_memory_editor_wrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_tables.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imgui_widgets.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imnodes.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imnodes.go ae98ccd7df d01 Обновление вендоринга hace 2 años
imnodes.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imnodesWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imnodesWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imnodes_internal.h ae98ccd7df d01 Обновление вендоринга hace 2 años
implot.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
implot.go ae98ccd7df d01 Обновление вендоринга hace 2 años
implot.h ae98ccd7df d01 Обновление вендоринга hace 2 años
implotWrapper.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
implotWrapper.h ae98ccd7df d01 Обновление вендоринга hace 2 años
implotWrapperTypes.h ae98ccd7df d01 Обновление вендоринга hace 2 años
implot_demo.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
implot_internal.h ae98ccd7df d01 Обновление вендоринга hace 2 años
implot_items.cpp ae98ccd7df d01 Обновление вендоринга hace 2 años
imstb_rectpack.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imstb_textedit.h ae98ccd7df d01 Обновление вендоринга hace 2 años
imstb_truetype.h ae98ccd7df d01 Обновление вендоринга hace 2 años

README.md

Dear ImGui for Go

Go Doc Go Report Card GolangCI

This library is a Go wrapper for Dear ImGui.

This wrapper started as 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 ported examples in a separate repository (see below)

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 Dear 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 Dear 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 Dear ImGui. The semantic versioning of this wrapper is defined as:

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

At the moment, this library uses version 1.79 of Dear ImGui.

Examples

A separate repository was created to host ported examples and reference implementations. See repository inkyblackness/imgui-go-examples.

It contains reference implementations for libraries such as GLFW3 and SDL2, using OpenGL.

The screenshot above was created with such an example.

Extras

FreeType font rendering

If the FreeType library is available for your platform, you can enable using it with the build tag imguifreetype - as in

go build -tags="imguifreetype"

This extra is based on the reference implementation from Dear ImGui.

This allows you to use the function FontAtlas.BuildWithFreeType(). If the build tag is not set, this function will always return an error.

If you set the build tag, yet the corresponding support has not been added to the library, you will receive a build error. Contributions to support more build environments are happily accepted. See files FreeTypeEnabled*.go.

Alternatives

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

  • kdrag0n/go-imgui (no longer available). Reasons for dismissal at time of decision:
    • Auto-generated bloat, which doesn't help
    • Was using old API (1.5x)
    • Did not compile
    • Project appeared to be abandoned
  • Extrawurst/cimgui. Reasons for dismissal at time of decision:
    • Was using old API (1.5x), 1.6x was attempted
    • Apparently semi-exposed 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.