kiwano

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

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 6 Imported by: 0

README

KiwanoGo

KiwanoGo is a simple 2D game engine for Golang

Documentation

Index

Constants

View Source
const (
	Version     = "0.1"
	VersionCode = 1
)

Environment variables

Variables

View Source
var (
	MainWindow   *Window
	CurrentScene Scene
)

Global variables

Functions

func Destroy

func Destroy()

Destroy clean up engine resources

func EnterScene

func EnterScene(scene Scene)

EnterScene exits current scene and enters a new scene

func Exit

func Exit()

Exit stop the main loop

func Init

func Init(option *Option) error

Init will initialize kiwano engine

func MainLoop

func MainLoop()

MainLoop ...

func Setup

func Setup(option *Option, setup func()) error

Setup starts to play

Types

type Color

type Color struct {
	R, G, B float32
	Alpha   float32
}

func ColorRGB

func ColorRGB(r, g, b float32) Color

func ColorRGBA

func ColorRGBA(r, g, b, a float32) Color

func (*Color) ToVec4

func (c *Color) ToVec4() (float32, float32, float32, float32)

type Option

type Option struct {
	Width, Height int
	Title         string
	ClearColor    Color
	NoTitleBar    bool
	Fullscreen    bool
	Resizable     bool
	Vsync         bool
}

type Scene

type Scene interface {
	OnEnter()
	OnExit()
	OnUpdate(time.Duration)
}

type Window

type Window struct {
	Option
	glfw.Window
}

func NewWindow

func NewWindow(option *Option) (*Window, error)

Directories

Path Synopsis
external
gl

Jump to

Keyboard shortcuts

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