Version: v0.0.0-...-8b49de5 Latest Latest

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

Go to latest
Published: Jan 11, 2019 License: MIT Imports: 10 Imported by: 0




This section is empty.


This section is empty.


func BindTexture

func BindTexture(id TextureID)

func BindVertexArray

func BindVertexArray(vaoID BufferID)

func BufferDataFloat

func BufferDataFloat(target uint32, data []float32, usage uint32)

func BufferDataInt

func BufferDataInt(target uint32, data []uint32, usage uint32)

func GetVersion

func GetVersion() string

func MglTest

func MglTest()

func TriangleNormal

func TriangleNormal(p1, p2, p3 mgl32.Vec3) mgl32.Vec3

func UnbindVertexArray

func UnbindVertexArray()

func UseProgram

func UseProgram(programID ProgramID)


type BufferID

type BufferID uint32

func GenBindBuffer

func GenBindBuffer(target uint32) BufferID

func GenBindVertexArray

func GenBindVertexArray() BufferID

type Camera

type Camera struct {
	Position mgl32.Vec3
	Front    mgl32.Vec3
	Up       mgl32.Vec3
	Right    mgl32.Vec3

	WorldUp mgl32.Vec3

	Yaw           float32
	Pitch         float32
	MovementSpeed float32
	MouseSens     float32
	Zoom          float32

func NewCamera

func NewCamera(position mgl32.Vec3, worldUp mgl32.Vec3, yaw, pitch, speed, sens float32) *Camera

func (*Camera) GetViewMatrix

func (camera *Camera) GetViewMatrix() mgl32.Mat4

func (*Camera) UpdateCamera

func (camera *Camera) UpdateCamera(direction Direction, deltaT, xoffset, yoffset float32)

type Direction

type Direction int
const (
	Forward Direction = iota

type ProgramID

type ProgramID uint32

func CreateProgram

func CreateProgram(vertPath string, fragPath string) (ProgramID, error)

type Shader

type Shader struct {
	// contains filtered or unexported fields

func NewShader

func NewShader(vertexPath string, fragmentPath string) (*Shader, error)

func (*Shader) CheckShaderForChanges

func (shader *Shader) CheckShaderForChanges() error

func (*Shader) SetFloat

func (shader *Shader) SetFloat(name string, f float32)

func (*Shader) SetMat4

func (shader *Shader) SetMat4(name string, mat mgl32.Mat4)

func (*Shader) SetVec3

func (shader *Shader) SetVec3(name string, v mgl32.Vec3)

func (*Shader) Use

func (shader *Shader) Use()

type ShaderID

type ShaderID uint32

func CreateShader

func CreateShader(shaderSource string, shaderType uint32) (ShaderID, error)

func LoadShader

func LoadShader(path string, shaderType uint32) (ShaderID, error)

type TextureID

type TextureID uint32

func GenBindTexture

func GenBindTexture() TextureID

func LoadTextureAlpha

func LoadTextureAlpha(filename string) TextureID

Todo: SDL2_image stb_image Sean Barret

Jump to

Keyboard shortcuts

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