Documentation ¶
Index ¶
- Variables
- func LoadShaders() (map[string]string, error)
- type Camera
- func (camera *Camera) LookAtCursor(x float32, y float32)
- func (camera *Camera) SetSpeed(speed float32)
- func (camera *Camera) StepFOV(fov float32)
- func (camera *Camera) TranslateBackward(dt float32)
- func (camera *Camera) TranslateDown(dt float32)
- func (camera *Camera) TranslateForward(dt float32)
- func (camera *Camera) TranslateLeft(dt float32)
- func (camera *Camera) TranslateRight(dt float32)
- func (camera *Camera) TranslateUp(dt float32)
- func (camera *Camera) Update(shader *Shader)
- func (camera *Camera) UpdateFOV(fov float32)
- type IndexBuffer
- type Renderer
- type Shader
- func (shader *Shader) Bind()
- func (shader *Shader) CompileShader(source string, shaderType uint32) uint32
- func (shader *Shader) CreateShader(vertexShader string, fragmentShader string)
- func (shader *Shader) CreateShaderG(vertexShader string, fragmentShader string, geometryShader string)
- func (shader *Shader) GetUniformLocation(name string) int32
- func (shader *Shader) ParseShader(shaderPath string) string
- func (shader *Shader) SetUniform1f(name string, value float32)
- func (shader *Shader) SetUniform1i(name string, value int32)
- func (shader *Shader) SetUniform2f(name string, value float32, value2 float32)
- func (shader *Shader) SetUniform3f(name string, v0 float32, v1 float32, v2 float32)
- func (shader *Shader) SetUniform4f(name string, v0 float32, v1 float32, v2 float32, v3 float32)
- func (shader *Shader) SetUniformBoolean(name string, value bool)
- func (shader *Shader) SetUniformMat4f(name string, matrix mgl32.Mat4)
- func (shader *Shader) Unbind()
- type Texture
- func (texture *Texture) Bind(slot uint32)
- func (texture *Texture) GetData() []uint8
- func (texture *Texture) GetHeight() int32
- func (texture *Texture) GetID() uint32
- func (texture *Texture) GetPath() string
- func (texture *Texture) GetWidth() int32
- func (texture *Texture) Unbind()
- func (texture *Texture) UpdateSubImage(x, y, width, height int)
- type VertexArray
- type VertexBuffer
- type VertexBufferElement
- type VertexBufferLayout
Constants ¶
This section is empty.
Variables ¶
View Source
var ShaderCache map[string]string
View Source
var ShaderNames []string
Functions ¶
Types ¶
type Camera ¶
func (*Camera) LookAtCursor ¶
func (*Camera) TranslateBackward ¶
func (*Camera) TranslateDown ¶
func (*Camera) TranslateForward ¶
func (*Camera) TranslateLeft ¶
func (*Camera) TranslateRight ¶
func (*Camera) TranslateUp ¶
type IndexBuffer ¶
type IndexBuffer struct {
// contains filtered or unexported fields
}
func NewIndexBuffer ¶
func NewIndexBuffer(data []uint32) *IndexBuffer
func (*IndexBuffer) Bind ¶
func (ib *IndexBuffer) Bind()
func (*IndexBuffer) GetCount ¶
func (ib *IndexBuffer) GetCount() int
func (*IndexBuffer) SetData ¶
func (ib *IndexBuffer) SetData(data []uint32)
func (*IndexBuffer) Unbind ¶
func (ib *IndexBuffer) Unbind()
type Renderer ¶
type Renderer struct { }
func NewRenderer ¶
func NewRenderer() *Renderer
func (*Renderer) Draw ¶
func (renderer *Renderer) Draw(va VertexArray, shader Shader)
type Shader ¶
type Shader struct {
// contains filtered or unexported fields
}
func NewShaderG ¶
func (*Shader) CompileShader ¶
func (*Shader) CreateShader ¶
func (*Shader) CreateShaderG ¶
func (*Shader) GetUniformLocation ¶
func (*Shader) ParseShader ¶
func (*Shader) SetUniform1f ¶
func (*Shader) SetUniform1i ¶
func (*Shader) SetUniform2f ¶
func (*Shader) SetUniform3f ¶
func (*Shader) SetUniform4f ¶
func (*Shader) SetUniformBoolean ¶
TODO: write a util function that converts booleans to integer
func (*Shader) SetUniformMat4f ¶
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
func NewTexture ¶
func NewTextureFromData ¶
func (*Texture) UpdateSubImage ¶
type VertexArray ¶
type VertexArray struct {
// contains filtered or unexported fields
}
func NewVertexArray ¶
func NewVertexArray() *VertexArray
func (*VertexArray) AddBuffer ¶
func (vao *VertexArray) AddBuffer(vb VertexBuffer, layout VertexBufferLayout)
func (*VertexArray) Bind ¶
func (vao *VertexArray) Bind()
func (*VertexArray) Unbind ¶
func (vao *VertexArray) Unbind()
type VertexBuffer ¶
type VertexBuffer struct {
// contains filtered or unexported fields
}
func NewVertexBuffer ¶
func NewVertexBuffer(data []float32) *VertexBuffer
func (*VertexBuffer) Bind ¶
func (vb *VertexBuffer) Bind()
func (*VertexBuffer) SetData ¶
func (vb *VertexBuffer) SetData(data []float32)
func (*VertexBuffer) Unbind ¶
func (vb *VertexBuffer) Unbind()
type VertexBufferElement ¶
type VertexBufferElement struct {
// contains filtered or unexported fields
}
func NewVertexBufferElement ¶
func NewVertexBufferElement(typ int, count int, normalized bool) *VertexBufferElement
func (*VertexBufferElement) GetTypeSize ¶
func (vbl *VertexBufferElement) GetTypeSize() int
type VertexBufferLayout ¶
type VertexBufferLayout struct {
// contains filtered or unexported fields
}
func NewVertexBufferLayout ¶
func NewVertexBufferLayout() *VertexBufferLayout
func (*VertexBufferLayout) GetElements ¶
func (vbl *VertexBufferLayout) GetElements() []VertexBufferElement
func (*VertexBufferLayout) GetStride ¶
func (vbl *VertexBufferLayout) GetStride() int
func (*VertexBufferLayout) Pushc ¶
func (vbl *VertexBufferLayout) Pushc(count int)
func (*VertexBufferLayout) Pushf ¶
func (vbl *VertexBufferLayout) Pushf(count int)
func (*VertexBufferLayout) Pushi ¶
func (vbl *VertexBufferLayout) Pushi(count int)
Click to show internal directories.
Click to hide internal directories.