wandi

package module
v0.0.0-...-a0a146a Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Unlicense Imports: 2 Imported by: 3

README

wandi

go.dev reference

The wandi project specifies common interfaces used for window creation, event handling and image drawing. It is heavily inspired by go.wde.

Implementations

The current implementations of wandi.Drawable are listed below:

The current implementations of wandi.Image are listed below:

The current implementations of wandi.Window are listed below:

  • SDL backend
  • SFML backend
    • window.Window: graphical window capable of handling draw operations and window events.

Documentation

Overview

Package wandi specifies common interfaces used for window creation, event handling and image drawing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Drawable

type Drawable interface {
	// Draw draws the entire src image onto the dst image starting at the
	// destination point dp.
	Draw(dp image.Point, src Image) (err error)
	// DrawRect draws a subset of the src image, as defined by the source
	// rectangle sr, onto the dst image starting at the destination point dp.
	DrawRect(dp image.Point, src Image, sr image.Rectangle) (err error)
}

A Drawable is a mutable collection of pixels.

type Image

type Image interface {
	// Width returns the width of the image.
	Width() int
	// Height returns the height of the image.
	Height() int
}

An Image is a rectangular collection of pixels.

type Window

type Window interface {
	// Close closes the window.
	Close()
	// SetTitle sets the title of the window.
	SetTitle(title string)
	// Width returns the width of the window.
	Width() int
	// Height returns the height of the window.
	Height() int
	// The Drawable interface is implemented by the window.
	Drawable
	// Display displays what has been rendered so far to the window.
	Display()
	// PollEvent returns a pending event from the event queue or nil if the queue
	// was empty. Note that more than one event may be present in the event
	// queue.
	PollEvent() (event we.Event)
}

A Window represents a graphical window capable of handling draw operations and window events.

Directories

Path Synopsis
Package wandiutil provides utility interfaces which facilitates the composition of wandi interfaces.
Package wandiutil provides utility interfaces which facilitates the composition of wandi interfaces.

Jump to

Keyboard shortcuts

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