pancake

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

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

Go to latest
Published: Oct 6, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Canvases map[string]Canvas

Collections

View Source
var CurrentCanvas string

Graphical variables

View Source
var CurrentColor color
View Source
var Event events
View Source
var Images map[string]Image
View Source
var KeyState []uint8
View Source
var LuaState *lua.State
View Source
var Music map[string]*mix.Music
View Source
var Renderer *sdl.Renderer
View Source
var Running bool

Loop

View Source
var ScaleX float32
View Source
var ScaleY float32
View Source
var Shaders map[string]Shader
View Source
var SinceStart int
View Source
var Sounds map[string]*mix.Chunk
View Source
var StartUpTime int
View Source
var State state
View Source
var TranslateX int
View Source
var TranslateY int
View Source
var Window *sdl.Window

Variables

Functions

func AddMusic

func AddMusic(name, dir string) *mix.Music

Music

func AddSound

func AddSound(name, dir string) *mix.Chunk

--------Audio---------- Sounds

func BindTexture

func BindTexture(t Texture)

func CheckShaderUpdate

func CheckShaderUpdate()

func Clear

func Clear(r, g, b, a float32)

func ClearCanvas

func ClearCanvas()

func DegreesToRadians

func DegreesToRadians(a float32) float32

Utils

func DrawCircle

func DrawCircle(x, y, r float64)

func DrawImage

func DrawImage(name string, x, y int, rotation float32, sx, sy float32)

func DrawLine

func DrawLine(x1, y1, x2, y2 float64)

func DrawQuad

func DrawQuad(x, y, w, h, ox, oy int, rotation, corners float32)

func DrawRectangle

func DrawRectangle(x, y, w, h float64)

func DrawRoundedQuad

func DrawRoundedQuad(x, y, w, h, ox, oy int, rotation, corners float32)

func DrawRoundedRectangle

func DrawRoundedRectangle(x, y, w, h, ox, oy int, rotation, corners float32)

func Float32If

func Float32If(statement bool, t, f float32) float32

func GL_Clear

func GL_Clear(r, g, b, a float32)

func GetMouseX

func GetMouseX() int

func GetMouseY

func GetMouseY() int

func GetPathType

func GetPathType(p string) string

func IntIf

func IntIf(statement bool, t, f int) int

func IsKeyDown

func IsKeyDown(key string) bool

func IsMouseDown

func IsMouseDown(button string) bool

func LuaDraw

func LuaDraw()

func LuaKeyPressed

func LuaKeyPressed(key string)

func LuaKeyReleased

func LuaKeyReleased(key string)

func LuaMousePressed

func LuaMousePressed(x, y int, button string, clicks int)

func LuaMouseReleased

func LuaMouseReleased(x, y int, button string, clicks int)

func LuaStart

func LuaStart()

--------Start----------

func LuaUpdate

func LuaUpdate(dt float32)

func MouseButtonString

func MouseButtonString(button uint8) string

func NewCanvas

func NewCanvas(name string, w, h int) string

func NewShader

func NewShader(vertexPath, fragmentPath string) (string, error)

func NewState

func NewState(w, h int, name string) state

func Origin

func Origin()

func PlayMusic

func PlayMusic(name string, loops int)

func PlaySound

func PlaySound(name string, repetitions int) int

func SDL_INIT_GL

func SDL_INIT_GL(window *sdl.Window, major, minor int)

func SendBaseUniforms

func SendBaseUniforms()

func SetCanvas

func SetCanvas(c string)

func SetColor

func SetColor(r, g, b, a int)

func SetRotation

func SetRotation(r float32)

func Sigma

func Sigma(x int) int

func Start

func Start(w, h int, name string)

func StringIf

func StringIf(statement bool, t, f string) string

Utils

func TimeSinceStart

func TimeSinceStart() int

Time

func UnbindTexture

func UnbindTexture()

func UniformFloat

func UniformFloat(name string, x float32)

func UniformVec4

func UniformVec4(name string, x, y, z, w float32)

func UseShader

func UseShader(name string)

Types

type Canvas

type Canvas *pgl.Canvas

type DrawFunc

type DrawFunc func() // <--- Nothing needs to be passed, yey!

type Image

type Image struct {
	Texture Texture
	Width   int
	Height  int
}

func AddImage

func AddImage(name, path string) (Image, int, int)

type KeyPressed

type KeyPressed func(string) // <---- Key

type KeyReleased

type KeyReleased func(string) // <---- Key

type MousePressed

type MousePressed func(int, int, string, int) // <---- X, Y, mouse button, clicks (single click, double click etc.)

type MouseReleased

type MouseReleased func(int, int, string, int) // <---- X, Y, mouse button, clicks (single click, double click etc.)

type Object

type Object struct {
	Name        string
	X, Y, Scale float32
	Image       string
}

func AddObject

func AddObject(o Object) *Object

type Shader

type Shader pgl.Shader

Pancake GL macros

var DefaultShader Shader

PGL variables

type StartFunc

type StartFunc func() // <--- Thos happens after pancake have been started!

Declaring event function types, setting default functions and putting them in pancake.Event.EventName fashion...

type Texture

type Texture pgl.TextureID

func LoadTexture

func LoadTexture(path string) (Texture, int, int)

type UpdateFunc

type UpdateFunc func(float32) // <----- dt (Time)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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