Skip to content

A bridge between glfw and imgui-go that lets you have full control over both. Written in Go.

License

Notifications You must be signed in to change notification settings

micahke/glfw_imgui_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glfw + imgui Backend in Go

This package is intended for those using GLFW and imgui with Go. It is meant to bridge the gap between go-gl/glfw and imgui-go. This means you can retain control over your glfw.Window object without handing over control to imgui. I found this file in an old commit from go-gl. Helpful for those building applications with OpenGL in Go.

Usage

For a full example, check out this example in the project directory.

To import:

import "github.com/micahke/glfw_imgui_backend"
// OR
import backend "github.com/glfw_imgui_backend"

ImGUI can now be used in a similar syntax to C++. To link your glfw.Window with imgui, call:

// make Window
window, err := glfw.CreateWindow(960, 540, "Hello, world!", nil, nil)
if err != nil {
  panic("Error creating window")
}
window.MakeContextCurrent()

// Create imgui IO context
context := imgui.CreateContext(nil)
defer context.Destroy()

// Link the GLFW and Imgui
impl := gui.ImguiGlfw3Init(window)
defer impl.Shutdown()

About

A bridge between glfw and imgui-go that lets you have full control over both. Written in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages