Documentation ¶
Index ¶
- func LoadPNG(path string) (img image.Image, err error)
- func WritePNG(path string, img image.Image) (err error)
- type ArrayBuffer
- type Buffer
- type Camera
- type Context
- func (c *Context) Camera(worldCenter, worldSize mgl32.Vec3) (*Camera, error)
- func (c *Context) Clear()
- func (c *Context) CreateWindow(w, h int, name string) (err error)
- func (c *Context) Delete()
- func (c *Context) SetCursor(val bool)
- func (c *Context) SetFullscreen(val bool) error
- func (c *Context) SetResizable(val bool)
- func (c *Context) SetSwapInterval(val int)
- func (c *Context) ShouldClose() bool
- func (c *Context) SwapBuffers()
- type Events
- type GLBuffer
- type Program
- func (p *Program) Attrib(name string, stride uintptr) *VertexAttribute
- func (p *Program) Bind()
- func (p *Program) Delete()
- func (p *Program) ID() uint32
- func (p *Program) Load(vertex, fragment string) (err error)
- func (p *Program) Unbind()
- func (p *Program) Uniform(name string) *Uniform
- func (p *Program) UniformBlock(name string, binding uint32) *UniformBlock
- type Texture
- type TextureSmoothing
- type Uniform
- type UniformBlock
- type UniformBuffer
- type VertexAttribute
- func (a *VertexAttribute) Float(offset uintptr, divisor uint32)
- func (a *VertexAttribute) Mat4(offset uintptr, divisor uint32)
- func (a *VertexAttribute) Vec2(offset uintptr, divisor uint32)
- func (a *VertexAttribute) Vec3(offset uintptr, divisor uint32)
- func (a *VertexAttribute) Vec4(offset uintptr, divisor uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayBuffer ¶
type ArrayBuffer struct {
*GLBuffer
}
func NewArrayBuffer ¶
func NewArrayBuffer() (b *ArrayBuffer)
type Camera ¶
type Camera struct { WorldCenter mgl32.Vec3 WorldSize mgl32.Vec3 ScreenSize mgl32.Vec2 PxPerUnit mgl32.Vec2 Projection mgl32.Mat4 View mgl32.Mat4 Inverse mgl32.Mat4 }
func (*Camera) ScreenToWorldCoords ¶
func (*Camera) SetScreenSize ¶
func (*Camera) SetWorldBounds ¶
type Context ¶
type Context struct { OpenGLVersion string ShaderVersion string Events *Events // contains filtered or unexported fields }
func NewContext ¶
func (*Context) SetFullscreen ¶
func (*Context) SetResizable ¶
func (*Context) SetSwapInterval ¶
func (*Context) ShouldClose ¶
func (*Context) SwapBuffers ¶
func (c *Context) SwapBuffers()
type GLBuffer ¶
type GLBuffer struct {
// contains filtered or unexported fields
}
func NewGLBuffer ¶
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func NewProgram ¶
func NewProgram() *Program
func (*Program) UniformBlock ¶
func (p *Program) UniformBlock(name string, binding uint32) *UniformBlock
type Texture ¶
type Texture struct { Size mgl32.Vec2 OriginalSize mgl32.Vec2 // contains filtered or unexported fields }
func GetTexture ¶
func GetTexture(img image.Image, smoothing TextureSmoothing) (texture *Texture, err error)
func LoadTexture ¶
func LoadTexture(path string, smoothing TextureSmoothing) (texture *Texture, err error)
type TextureSmoothing ¶
type TextureSmoothing int
const ( SmoothingNearest TextureSmoothing = gl.NEAREST SmoothingLinear TextureSmoothing = gl.LINEAR )
type UniformBlock ¶
type UniformBlock struct {
// contains filtered or unexported fields
}
func (*UniformBlock) Bind ¶
func (b *UniformBlock) Bind(bufferID uint32, size int)
type UniformBuffer ¶
type UniformBuffer struct {
*GLBuffer
}
func NewUniformBuffer ¶
func NewUniformBuffer() (b *UniformBuffer)
type VertexAttribute ¶
type VertexAttribute struct {
// contains filtered or unexported fields
}
func (*VertexAttribute) Float ¶
func (a *VertexAttribute) Float(offset uintptr, divisor uint32)
func (*VertexAttribute) Mat4 ¶
func (a *VertexAttribute) Mat4(offset uintptr, divisor uint32)
func (*VertexAttribute) Vec2 ¶
func (a *VertexAttribute) Vec2(offset uintptr, divisor uint32)
func (*VertexAttribute) Vec3 ¶
func (a *VertexAttribute) Vec3(offset uintptr, divisor uint32)
func (*VertexAttribute) Vec4 ¶
func (a *VertexAttribute) Vec4(offset uintptr, divisor uint32)
Click to show internal directories.
Click to hide internal directories.