mgl

package
v0.0.0-...-da79a23 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT, Zlib Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LButtonUp = 0x1
)
View Source
const (
	NUM_SEG = 16
)
View Source
const (
	TSIZE = 64
)

Variables

This section is empty.

Functions

func Begin

func Begin(prim uint32, size float32)

func DrawCylinder

func DrawCylinder(minx, miny, minz, maxx, maxy, maxz float32, col uint32)

func DuLerpCol

func DuLerpCol(ca, cb, u uint32) uint32

func DuMultCol

func DuMultCol(col, d uint32) uint32

func DuRGBA

func DuRGBA(r, g, b, a uint32) uint32

func End

func End()

func InitSDL

func InitSDL()

func QuitSDL

func QuitSDL()

func Texture

func Texture(state bool)

func Vertex

func Vertex(pos []float32, color uint32, uv [2]float32)

func Vertex2

func Vertex2(x, y, z float32, color uint32)

Types

type GLCheckerTexture

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

func (*GLCheckerTexture) Bind

func (ct *GLCheckerTexture) Bind()

type ISceneExtra

type ISceneExtra interface {
	OnEvent(evt sdl.Event)
	BeforeDraw()
	Draw()
	OnClick(*[3]float64)
}

type Scene

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

func NewScene

func NewScene(title string, width, height int32, meshPath string) (*Scene, error)

func (*Scene) BeforeDraw

func (s *Scene) BeforeDraw()

func (*Scene) Destroy

func (s *Scene) Destroy()

func (*Scene) Draw

func (s *Scene) Draw()

func (*Scene) DrawMesh

func (s *Scene) DrawMesh()

func (*Scene) OnKeyboardDown

func (s *Scene) OnKeyboardDown(evt *sdl.KeyboardEvent)

func (*Scene) OnMouseButton

func (s *Scene) OnMouseButton(evt *sdl.MouseButtonEvent)

func (*Scene) OnMouseMotion

func (s *Scene) OnMouseMotion(evt *sdl.MouseMotionEvent)

func (*Scene) OnMouseWheel

func (s *Scene) OnMouseWheel(evt *sdl.MouseWheelEvent)

func (*Scene) Run

func (s *Scene) Run(ctx context.Context)

func (*Scene) SetCamera

func (s *Scene) SetCamera()

func (*Scene) SetExtraInterface

func (s *Scene) SetExtraInterface(i ISceneExtra)

Jump to

Keyboard shortcuts

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