Documentation ¶
Index ¶
- Constants
- func ConfirmBox(w *Window, msg, title string) bool
- func Exit(err error)
- func FactoryRegister()
- func MessageBox(w *Window, msg, title string)
- func OSVersion() (s string)
- func Run(onStart func() error, onExit func(err error))
- func ScreenSize() (width, height int)
- type IWindow
- type Window
- func (p *Window) Class() string
- func (w *Window) Create(width, height int) error
- func (w *Window) Destroy()
- func (w *Window) Expose(x, y, width, height float32)
- func (w *Window) Init()
- func (w *Window) IsFullScreen() bool
- func (w *Window) IsVisible() bool
- func (w *Window) MakeCurrent() bool
- func (w *Window) OnCreate()
- func (w *Window) OnDestroy()
- func (w *Window) OnExpose(x, y, width, height float32)
- func (w *Window) OnMouseEnter(x, y float32)
- func (w *Window) OnMouseLeave(x, y float32)
- func (w *Window) OnMouseMove(x, y float32)
- func (w *Window) OnMousePress(btn int, x, y float32)
- func (w *Window) OnMouseRelease(btn int, x, y float32)
- func (w *Window) OnMouseWheel(vert bool, dz float32)
- func (w *Window) OnResize(width, height float32)
- func (w *Window) Present()
- func (w *Window) SetHints(hints hints)
- func (w *Window) SetTitle(title string)
- func (w *Window) Show()
- func (w *Window) Size() (width, height float32)
- func (w *Window) ToggleFullScreen()
Constants ¶
View Source
const ( // HintResizable is hint for window has resize box HintResizable hints = C.WINL_HINT_RESIZABLE // HintVideo is hint for drawing animated (FPS video) content HintVideo hints = C.WINL_HINT_ANIMATE // HintPainter is hint for 2D drawing using painter algorithm HintPainter hints = C.WINL_HINT_PAINTER // Hint3D is hint for 3D drawing Hint3D hints = C.WINL_HINT_3D )
Variables ¶
This section is empty.
Functions ¶
func ConfirmBox ¶
ConfirmBox show a simple box ask user to confirm.
func FactoryRegister ¶
func FactoryRegister()
FactoryRegister register creator in factory for package winl
func MessageBox ¶
MessageBox show a simple message box
Types ¶
type IWindow ¶
type IWindow interface { // Class name for factory Class() string // Create the window, width and height can be zero. Create(width, height int) error // Destroy the window Destroy() // Expose triggle expose event Expose(x, y, width, height float32) // Init the object Init() // IsFullScreen determine if window is full screen IsFullScreen() bool // IsVisible determine if window is visible IsVisible() bool // MakeCurrent set current OpenGL to this window MakeCurrent() bool // OnCreate event handler OnCreate() // OnDestroy event handler OnDestroy() // OnExpose event handler OnExpose(x, y, width, height float32) // OnMouseEnter event handler OnMouseEnter(x, y float32) // OnMouseLeave event handler OnMouseLeave(x, y float32) // OnMouseMove event handler OnMouseMove(x, y float32) // OnMousePress event handler OnMousePress(btn int, x, y float32) // OnMouseRelease event handler OnMouseRelease(btn int, x, y float32) // OnMouseWheel event handler OnMouseWheel(vert bool, dz float32) // OnResize event handler OnResize(width, height float32) // Present copy OpenGL content from back buffer to front buffer, make it visible Present() // SetHints set hints for window style SetHints(hints hints) // SetTitle set the window title SetTitle(title string) // Show the window Show() // Size reports size of window's client area Size() (width, height float32) // ToggleFullScreen switch between full screen mode and normal mode ToggleFullScreen() }
IWindow is interface of class Window
type Window ¶
type Window struct { Self IWindow // contains filtered or unexported fields }
Window class wrap operating systems's window object.
func (*Window) IsFullScreen ¶
IsFullScreen determine if window is full screen
func (*Window) MakeCurrent ¶
MakeCurrent set current OpenGL to this window
func (*Window) OnMouseEnter ¶
OnMouseEnter event handler
func (*Window) OnMouseLeave ¶
OnMouseLeave event handler
func (*Window) OnMousePress ¶
OnMousePress event handler
func (*Window) OnMouseRelease ¶
OnMouseRelease event handler
func (*Window) OnMouseWheel ¶
OnMouseWheel event handler
func (*Window) Present ¶
func (w *Window) Present()
Present copy OpenGL content from back buffer to front buffer, make it visible
func (*Window) SetHints ¶
func (w *Window) SetHints(hints hints)
SetHints set hints for window style
func (*Window) ToggleFullScreen ¶
func (w *Window) ToggleFullScreen()
ToggleFullScreen switch between full screen mode and normal mode
Click to show internal directories.
Click to hide internal directories.