Documentation

Overview

    Package window implements platform specific windows and GPU contexts.

    Index

    Constants

    This section is empty.

    Variables

    View Source
    var ErrDeviceLost = errors.New("GPU device lost")

      ErrDeviceLost is returned from Context.Present when the underlying GPU device is gone and should be recreated.

      Functions

      func Main

      func Main()

      func NewWindow

      func NewWindow(window Callbacks, opts *Options) error

      Types

      type Callbacks

      type Callbacks interface {
      	SetDriver(d Driver)
      	Event(e event.Event)
      }

      type Context

      type Context interface {
      	Backend() (backend.Device, error)
      	Present() error
      	MakeCurrent() error
      	Release()
      	Lock()
      	Unlock()
      }

      type Driver

      type Driver interface {
      	// SetAnimating sets the animation flag. When the window is animating,
      	// FrameEvents are delivered as fast as the display can handle them.
      	SetAnimating(anim bool)
      	// ShowTextInput updates the virtual keyboard state.
      	ShowTextInput(show bool)
      	NewContext() (Context, error)
      
      	// ReadClipboard requests the clipboard content.
      	ReadClipboard()
      	// WriteClipboard requests a clipboard write.
      	WriteClipboard(s string)
      
      	// SetCursor updates the current cursor to name.
      	SetCursor(name pointer.CursorName)
      
      	// Close the window.
      	Close()
      }

        Driver is the interface for the platform implementation of a window.

        type FrameEvent

        type FrameEvent struct {
        	system.FrameEvent
        
        	Sync bool
        }

        type Options

        type Options struct {
        	Width, Height       unit.Value
        	MinWidth, MinHeight unit.Value
        	MaxWidth, MaxHeight unit.Value
        	Title               string
        }