forked from inkyblackness/imgui-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.go
32 lines (26 loc) · 970 Bytes
/
Main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package imgui
// #include "wrapper/Main.h"
import "C"
// Version returns a version string e.g. "1.23".
func Version() string {
return C.GoString(C.iggGetVersion())
}
// Time returns global imgui time. Incremented by io.DeltaTime every frame.
func Time() float64 {
return float64(C.iggGetTime())
}
// NewFrame starts a new ImGui frame, you can submit any command from this point until Render()/EndFrame().
func NewFrame() {
C.iggNewFrame()
}
// Render ends the ImGui frame, finalize the draw data.
// After this method, call RenderedDrawData to retrieve the draw commands and execute them.
func Render() {
C.iggRender()
}
// EndFrame ends the ImGui frame. Automatically called by Render(), so most likely don't need to ever
// call that yourself directly. If you don't need to render you may call EndFrame() but you'll have
// wasted CPU already. If you don't need to render, better to not create any imgui windows instead!
func EndFrame() {
C.iggEndFrame()
}