govox

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

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

README

govox

golang voxel renderer

screenshot

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlocksBuffer [][][]Block
View Source
var ShowTimings = false

Functions

func CompileShader

func CompileShader(s string, t uint32) (uint32, error)

func DrawText

func DrawText(size int, rv *RenderVars, window *glfw.Window, monstersRemaining int)

func FinishRender

func FinishRender(window *glfw.Window)

func GlRenderer

func GlRenderer(size int, rv *RenderVars, window *glfw.Window)

func MakeBlocks

func MakeBlocks(size int) [][][]Block

func MakeRandomBlocks

func MakeRandomBlocks(size int) [][][]Block

func NewProgram

func NewProgram(vSource, fSource string) (uint32, error)

func RenderBlocks

func RenderBlocks(rv *RenderVars, blocks [][][]Block, rotx, roty float32, size int, wait bool)

func RenderPrepWorker

func RenderPrepWorker(size int, cycleCh, readyCh chan *RenderData)

func RunGL

func RunGL(f func())

func Screenshot

func Screenshot(filename string, width, height int)

func ScreenshotBuff

func ScreenshotBuff(width, height int) []byte

func SetCam

func SetCam(size int, p uint32)

func ShutdownGraphics

func ShutdownGraphics()

func StartRender

func StartRender()

Types

type Block

type Block struct {
	Active bool
	Color  mgl32.Vec4
}

type RenderData

type RenderData struct {
	Points        []float32
	Colours       []float32
	ColoursLength int
	PointsLength  int
	Blocks        [][][]Block
	// contains filtered or unexported fields
}

type RenderVars

type RenderVars struct {
	Col         mgl32.Vec4
	ColUni      int32
	ModelUni    int32
	Vao         uint32
	Vbo         uint32
	VertAttrib  uint32
	Vaoc        uint32
	Vboc        uint32
	VertAttribc uint32
	Program     uint32
}

func InitGraphics

func InitGraphics(size int, width, height int) (*glfw.Window, RenderVars)

Directories

Path Synopsis
abstractRogue
abstractRogue

Jump to

Keyboard shortcuts

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