ds

package module
v0.0.0-...-2823ea6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 7 Imported by: 3

README

ds

dual opengl screens on one windows

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action = func() (forceUpdateScreen bool)

type Screen

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

func New

func New(
	name string,
	ds [2]Window,
	actions *chan Action,
) (
	sc *Screen,
	err error,
)

New return windows. Minimal `actions = make(chan func(), 1000)`.

func (*Screen) ChangeRatio

func (sc *Screen) ChangeRatio(newRatio float64)

func (*Screen) Run

func (sc *Screen) Run(quit *chan struct{})

func (*Screen) Screenshot

func (sc *Screen) Screenshot(afterSave func(img image.Image))

func (*Screen) UpdateWindow

func (sc *Screen) UpdateWindow(pos int, w Window)

type Window

type Window interface {
	SetMouseButtonCallback(
		button glfw.MouseButton,
		action glfw.Action,
		mods glfw.ModifierKey,
		xcursor, ycursor float64,
	)
	SetCharCallback(r rune)
	SetScrollCallback(
		xcursor, ycursor float64,
		xoffset, yoffset float64,
	)
	SetKeyCallback(
		key glfw.Key,
		scancode int,
		action glfw.Action,
		mods glfw.ModifierKey,
	)
	SetCursorPosCallback(
		xpos float64,
		ypos float64,
	)
	Draw(x, y, w, h int32)
}

Jump to

Keyboard shortcuts

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