rendergroups

package
v0.0.0-...-48f6ed3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RotationEnabled attribute
	RotationEnabled = iota
	// ColorEnabled attribute
	ColorEnabled = iota
	// TexturesEnabled attribute
	TexturesEnabled = iota
)
View Source
const (
	RotationNone RotationMode = iota
	RotationX                 = iota
	RotationY                 = iota
	RotationZ                 = iota
)

enum for rotation axes

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicRenderGroup2D

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

BasicRenderGroup2D is a 2D render group that supports colors, textures and rotation.

func NewBasicRenderGroup2D

func NewBasicRenderGroup2D(id string, glType uint32, expectedSize int32,
	changeRatio float32, texture uint32) (*graphics.RenderGroup, *BasicRenderGroup2D)

NewBasicRenderGroup2D creates a new basic 2d render group

func (*BasicRenderGroup2D) AddObject

func (g *BasicRenderGroup2D) AddObject(obj *GenericObject2D) int

AddObject adds an object and returns an id for it.

func (*BasicRenderGroup2D) Deinit

func (g *BasicRenderGroup2D) Deinit()

Deinit does nothing

func (*BasicRenderGroup2D) InitShader

func (g *BasicRenderGroup2D) InitShader()

InitShader is run once per program

func (*BasicRenderGroup2D) NotifyObjectChanged

func (g *BasicRenderGroup2D) NotifyObjectChanged()

NotifyObjectChanged tells the rendergroup that an object has changed

func (*BasicRenderGroup2D) RemoveObject

func (g *BasicRenderGroup2D) RemoveObject(id int)

RemoveObject removes an object by id

func (*BasicRenderGroup2D) Render

func (g *BasicRenderGroup2D) Render()

Render implements the rendering

func (*BasicRenderGroup2D) SetAttribute

func (g *BasicRenderGroup2D) SetAttribute(attribute BasicRenderGroup2DAttribute, value bool)

SetAttribute sets an attribute, see *Enabled constants

func (*BasicRenderGroup2D) SetRotationModes

func (g *BasicRenderGroup2D) SetRotationModes(r1, r2 RotationMode)

SetRotationModes sets which axis the first and second rotation should be around. Also enables rotation if it isn't already enabled.

type BasicRenderGroup2DAttribute

type BasicRenderGroup2DAttribute int

BasicRenderGroup2DAttribute represents different kinds of functionality

type GenericObject2D

type GenericObject2D struct {
	Coords        []mgl32.Vec3
	Color         mgl32.Vec4
	Angles        [2]float32
	CenterPoint   mgl32.Vec3
	TextureCoords []mgl32.Vec2
}

GenericObject2D struct containing rendering details

type RotationMode

type RotationMode int32

RotationMode is an enum type for rotation aces

Jump to

Keyboard shortcuts

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