yagogla

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

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 9 Imported by: 0

README

Yet Another GO-Gl Abstraction

about

yagogla is a tiny library that provides low level abtraction for go-gl and glfw binds and some primitives

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileShader

func CompileShader(src string, sType uint32) (uint32, error)

CompileShader is the function that compiles a shader

func CreateProgram

func CreateProgram(shaders []uint32) (uint32, error)

CreateProgram Creates and returns a program with saders

func CreateVAO

func CreateVAO(vertices []Vertex3) uint32
  • Creates the Vertex Array Object.
  • indices is leftover from earlier samples and not used here.

CreateVAO ...

func InitGl

func InitGl()

InitGl initialize opengl context

func InitGlfw

func InitGlfw(width int, height int, title string) *glfw.Window

InitGlfw ...

func NewFrame

func NewFrame(window *glfw.Window, color mgl32.Vec4)

NewFrame ...

Types

type Action

type Action int

Action ...

const (
	PLAYERFORWARD  Action = iota
	PLAYERBACKWARD Action = iota
	PLAYERLEFT     Action = iota
	PLAYERRIGHT    Action = iota
	PROGRAMQUIT    Action = iota
	PLAYERCOLOR    Action = iota
)

Constants

type InputManager

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

InputManager ...

func NewInputManager

func NewInputManager() *InputManager

NewInputManager is the Function that creates an input manager

func (*InputManager) CheckpointCursorChange

func (im *InputManager) CheckpointCursorChange()

CheckpointCursorChange updates the publicly available Cursor() and CursorChange() methods to return the current Cursor and change since last time this method was called.

func (*InputManager) Cursor

func (im *InputManager) Cursor() mgl64.Vec2

Cursor returns the value of the cursor at the last time that CheckpointCursorChange() was called.

func (*InputManager) CursorChange

func (im *InputManager) CursorChange() mgl64.Vec2

CursorChange returns the amount of change in the underlying cursor since the last time CheckpointCursorChange was called

func (*InputManager) IsActive

func (im *InputManager) IsActive(a Action) bool

IsActive returns whether the given Action is currently active

type Vertex2

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

Vertex2 ...

type Vertex3

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

Vertex3 ...

func GetCircleVertices3

func GetCircleVertices3(r float32, vertices int) []Vertex3

GetCircleVertices3 ...

func GetCubicHexahedronVertices3

func GetCubicHexahedronVertices3(x, y, z float32) []Vertex3

GetCubicHexahedronVertices3 ...

func GetCylinderVertices3

func GetCylinderVertices3(h float32, rBottom float32, rTop float32, vertices int) (side, top, bottom []Vertex3)

GetCylinderVertices3 ...

func GetPipeVertices3

func GetPipeVertices3(h float32, rIn float32, rOut float32, vertices int) (sideIn, sideOut, top, bottom []Vertex3)

GetPipeVertices3 ...

func GetPlaneVertices3

func GetPlaneVertices3(h int, w int, l int) []Vertex3

GetPlaneVertices3 ...

func GetRingVerticies3

func GetRingVerticies3(rIn float32, rOut float32, vertices int) []Vertex3

GetRingVerticies3 ...

func GetSemiSphereVertices3

func GetSemiSphereVertices3(r float32, vertices int) (side, top, bottom []Vertex3)

GetSemiSphereVertices3 ...

func GetSphereVertices3

func GetSphereVertices3(r float32, numVertex int) (sphere, top, bottom []Vertex3)

GetSphereVertices3 ...

func (Vertex3) Add3

func (v Vertex3) Add3(v2 Vertex3) Vertex3

Add3 defines addition of 2 vert3

func (Vertex3) Mul3

func (v Vertex3) Mul3(v2 Vertex3) Vertex3

Mul3 defines multiplications of 2 vert3

type Vertex5

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

Vertex5 ...

Jump to

Keyboard shortcuts

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