mirror of
https://github.com/IllusionMan1212/libui-ng-odin.git
synced 2026-10-24 02:12:37 +00:00
30 lines
522 B
Odin
30 lines
522 B
Odin
package libui_window
|
|||
|
|
|
||
|
|
import "core:fmt"
|
||
|
|
|
||
|
|
import "../../"
|
||
|
|
|
||
|
|
onClosing :: proc "c" (w: ^libui.Window, data: rawptr) -> b32 {
|
||
|
|
libui.Quit()
|
||
|
|
return true
|
||
|
|
}
|
||
|
|
|
||
|
|
main :: proc() {
|
||
|
|
o: libui.InitOptions
|
||
|
|
|
||
|
|
err := libui.Init(&o)
|
||
|
|
if err != nil {
|
||
|
|
fmt.eprintln("Error initializing libui-ng: %s", err)
|
||
|
|
libui.FreeInitError(err)
|
||
|
|
return
|
||
|
|
}
|
||
|
|
|
||
|
|
// Create a new window
|
||
|
|
w := libui.NewWindow("Window Title", 300, 30, false)
|
||
|
|
|
||
|
|
libui.WindowOnClosing(w, onClosing, nil)
|
||
|
|
libui.ControlShow(cast(^libui.Control)w)
|
||
|
|
libui.Main()
|
||
|
|
libui.Uninit()
|
||
|
|
}
|