renderer

package
v0.0.0-...-77289c9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitialConfig

type InitialConfig struct {
	Width              int
	Height             int
	SpeedX             float32
	SpeedY             float32
	SpeedZ             float32
	Colors             []float32
	Vertices           []float32
	Indices            []uint32
	FragmentShaderCode string
	VertexShaderCode   string
}

type Renderer

type Renderer struct {
	PositionMatrix js.Value
	ViewMatrix     js.Value
	ModelMatrix    js.Value
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(gl js.Value, config InitialConfig) (r Renderer, err error)

func (*Renderer) EnableObject

func (r *Renderer) EnableObject()

func (*Renderer) GetSpeed

func (r *Renderer) GetSpeed() (x, y, z float32)

func (*Renderer) Release

func (r *Renderer) Release()

func (*Renderer) Render

func (r *Renderer) Render(this js.Value, args []js.Value) interface{}

func (*Renderer) SetModel

func (r *Renderer) SetModel(Colors []float32, Vertices []float32, Indices []uint32)

func (*Renderer) SetSize

func (r *Renderer) SetSize(height, width int)

func (*Renderer) SetSpeedX

func (r *Renderer) SetSpeedX(x float32)

func (*Renderer) SetSpeedY

func (r *Renderer) SetSpeedY(y float32)

func (*Renderer) SetSpeedZ

func (r *Renderer) SetSpeedZ(z float32)

func (*Renderer) SetZoom

func (r *Renderer) SetZoom(currentZoom float32)

func (*Renderer) UpdateColorBuffer

func (r *Renderer) UpdateColorBuffer(buffer []float32)

func (*Renderer) UpdateFragmentShader

func (r *Renderer) UpdateFragmentShader(shaderCode string)

func (*Renderer) UpdateIndicesBuffer

func (r *Renderer) UpdateIndicesBuffer(buffer []uint32)

func (*Renderer) UpdateVertexShader

func (r *Renderer) UpdateVertexShader(shaderCode string)

func (*Renderer) UpdateVerticesBuffer

func (r *Renderer) UpdateVerticesBuffer(buffer []float32)

Jump to

Keyboard shortcuts

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