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

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.