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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址