graphic

package
v0.0.0-...-3eebe10 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Origin    = mgl32.Vec3{0, 0, 0}
	Up        = mgl32.Vec3{0, 1, 0}
	Forward   = mgl32.Vec3{0, 0, 1}
	Backwards = mgl32.Vec3{0, 0, -1}
)

Functions

This section is empty.

Types

type Geometry

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

func NewGeometry

func NewGeometry() *Geometry

func (*Geometry) AddVBO

func (g *Geometry) AddVBO(vbo *opengl.VBO) *Geometry

func (*Geometry) Indices

func (g *Geometry) Indices() []uint32

func (*Geometry) SetIndices

func (g *Geometry) SetIndices(indices ...uint32)

func (*Geometry) VBOs

func (g *Geometry) VBOs() []*opengl.VBO

type Graphic

type Graphic struct {
	*Transform
	// contains filtered or unexported fields
}

func NewGraphic

func NewGraphic(geom *Geometry, renderMode uint32) *Graphic

func (*Graphic) Render

func (g *Graphic) Render(gls *opengl.State)

type RenderInfo

type RenderInfo interface {
	ViewMatrix() mgl32.Mat4
	ProjectionMatrix() mgl32.Mat4
}

type Texture

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

func NewTextureFromRGBA

func NewTextureFromRGBA(rgba *UniqueRGBA) (tex *Texture, err error)

func (*Texture) Bind

func (t *Texture) Bind(unit uint32)

func (*Texture) Unbind

func (t *Texture) Unbind(unit uint32)

type TextureProvider

type TextureProvider interface {
	NewTextureFromRGBA(rgba *UniqueRGBA) (tex *Texture, err error)
}

type Transform

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

func NewTransform

func NewTransform(position mgl32.Vec3) *Transform

func (*Transform) Model

func (t *Transform) Model() mgl32.Mat4

func (*Transform) Position

func (t *Transform) Position() mgl32.Vec3

func (*Transform) Rotation

func (t *Transform) Rotation() mgl32.Quat

func (*Transform) Scale

func (t *Transform) Scale() mgl32.Vec3

func (*Transform) SetPosition

func (t *Transform) SetPosition(position mgl32.Vec3)

func (*Transform) SetRotation

func (t *Transform) SetRotation(rotation mgl32.Quat)

func (*Transform) SetScale

func (t *Transform) SetScale(scale mgl32.Vec3)

type UniqueRGBA

type UniqueRGBA struct {
	ID uuid.UUID
	*image.RGBA
}

func NewUniqueRGBA

func NewUniqueRGBA(r image.Rectangle) *UniqueRGBA

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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