github.com/rajveermalviya/gamen@v0.1.2-0.20220930195403-9be15877c1aa/display/display_windows.go (about) 1 //go:build windows 2 3 package display 4 5 import "github.com/rajveermalviya/gamen/internal/win32" 6 7 // NewDisplay initializes the event loop and returns 8 // a handle to manage it. 9 // 10 // Must only be called from main goroutine. 11 func NewDisplay() (Display, error) { 12 return win32.NewDisplay() 13 } 14 15 // NewWindow creates a new window for the provided 16 // display event loop. 17 // 18 // To receive events you must set individual callbacks 19 // via Set[event]Callback methods. 20 // 21 // Must only be called from main goroutine. 22 func NewWindow(d Display) (Window, error) { 23 return win32.NewWindow(d.(*win32.Display)) 24 } 25 26 type Win32Window interface { 27 Win32Hinstance() uintptr 28 Win32Hwnd() uintptr 29 }