github.com/rajveermalviya/gamen@v0.1.2-0.20220930195403-9be15877c1aa/display/display_android.go (about)

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