window

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Window

type Window struct {
	// contains filtered or unexported fields
}

func New

func New(title string, width, height int, debugContext bool) (*Window, error)

New creates a window and initializes an opengl context for it Im order to use context just call GL function of window You must call the Show function to show the window

func (*Window) Center

func (window *Window) Center()

func (*Window) DPI

func (window *Window) DPI() float64

func (*Window) Destroy

func (window *Window) Destroy()

func (*Window) Dimensions

func (window *Window) Dimensions() common.Rectangle[int]

func (*Window) GL

func (window *Window) GL() *opengl.Context

func (*Window) HideMouseCursor

func (window *Window) HideMouseCursor()

func (*Window) IsFullscreen

func (window *Window) IsFullscreen() bool

func (*Window) IsMaximized

func (window *Window) IsMaximized() bool

func (*Window) IsMinimized

func (window *Window) IsMinimized() bool

func (*Window) IsVisible

func (window *Window) IsVisible() bool

func (*Window) KeepAlive

func (window *Window) KeepAlive()

You can use this if window closed by user but you don't want to close Immediately call after WindowEventClose received

func (*Window) Maximize

func (window *Window) Maximize()

func (*Window) Minimize

func (window *Window) Minimize()

func (*Window) Move

func (window *Window) Move(pos common.Vector2[int])

func (*Window) PollEvents

func (window *Window) PollEvents()

func (*Window) Raise

func (window *Window) Raise()

Not working on win11

func (*Window) Resize

func (window *Window) Resize(size common.Vector2[int])

func (*Window) SetEventHandler

func (window *Window) SetEventHandler(eventHandler func(event WindowEvent))

func (*Window) SetIcon

func (window *Window) SetIcon(icons [3]image.Image)

func (*Window) SetMinSize

func (window *Window) SetMinSize(minSize common.Vector2[int])

func (*Window) SetTitle

func (window *Window) SetTitle(title string)

func (*Window) Show

func (window *Window) Show()

func (*Window) ShowMouseCursor

func (window *Window) ShowMouseCursor()

func (*Window) Size

func (window *Window) Size() common.Vector2[int]

func (*Window) ToggleFullscreen

func (window *Window) ToggleFullscreen()

func (*Window) Viewport

func (window *Window) Viewport() common.Rectangle[int]

type WindowEvent

type WindowEvent struct {
	Type   WindowEventType
	Params []any
}

type WindowEventStack

type WindowEventStack []WindowEvent

func (*WindowEventStack) Push

func (stack *WindowEventStack) Push(eventType WindowEventType, params ...any)

type WindowEventType

type WindowEventType uint32
const (
	WindowEventRefresh WindowEventType = iota
	WindowEventResize
	WindowEventKeyInput
	WindowEventCharInput
	WindowEventMouseInput
	WindowEventMouseMove
	WindowEventScroll
	WindowEventDrop
	WindowEventScaleChanged
	WindowEventClose
)

func (WindowEventType) String

func (Type WindowEventType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL