ds

package module
v0.0.0-...-909098d Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 8 Imported by: 4

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 DemoCube

type DemoCube struct {
	Alpha, Betta float64
}

func (*DemoCube) Draw

func (o *DemoCube) Draw(x, y, w, h int32)

func (*DemoCube) SetCharCallback

func (o *DemoCube) SetCharCallback(r rune)

func (*DemoCube) SetCursorPosCallback

func (o *DemoCube) SetCursorPosCallback(xpos float64, ypos float64)

func (*DemoCube) SetKeyCallback

func (o *DemoCube) SetKeyCallback(key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)

func (*DemoCube) SetMouseButtonCallback

func (o *DemoCube) SetMouseButtonCallback(
	button glfw.MouseButton,
	action glfw.Action,
	mods glfw.ModifierKey,
	x, y float64,
)

func (*DemoCube) SetScrollCallback

func (o *DemoCube) SetScrollCallback(xcursor, ycursor float64, xoffset, yoffset float64)

type DemoSpiral

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

func (*DemoSpiral) Draw

func (o *DemoSpiral) Draw(x, y, w, h int32)

func (*DemoSpiral) SetCharCallback

func (o *DemoSpiral) SetCharCallback(r rune)

func (*DemoSpiral) SetCursorPosCallback

func (o *DemoSpiral) SetCursorPosCallback(xpos float64, ypos float64)

func (*DemoSpiral) SetKeyCallback

func (o *DemoSpiral) SetKeyCallback(key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)

func (*DemoSpiral) SetMouseButtonCallback

func (o *DemoSpiral) SetMouseButtonCallback(button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey, x, y float64)

func (*DemoSpiral) SetScrollCallback

func (o *DemoSpiral) SetScrollCallback(xcursor, ycursor float64, xoffset, yoffset float64)

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(ratio float64)

func (*Screen) Run

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

func (*Screen) Screenshot

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

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