Documentation ¶
Overview ¶
Package glu provides OpenGL utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Black = mgl32.Vec4{0, 0, 0, 1} White = mgl32.Vec4{1, 1, 1, 1} Red = mgl32.Vec4{1, 0, 0, 1} Green = mgl32.Vec4{0, 1, 0, 1} Blue = mgl32.Vec4{0, 0, 1, 1} Yellow = mgl32.Vec4{1, 1, 0, 1} Cyan = mgl32.Vec4{0, 1, 1, 1} Magenta = mgl32.Vec4{1, 0, 1, 1} Grey = mgl32.Vec4{0.5, 0.5, 0.5, 1} )
Predefined colors
var Debug = false
If debug mode is set then check for GL errors after each call
Functions ¶
Types ¶
type Polar ¶
type Polar struct {
R, Theta, Phi float32
}
Polar type represents polar coordinates
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Type to encapsulate opengl shader program.
func NewProgram ¶
func NewProgram(vertexShader, fragmentShader string, attr []Attrib, stride int) (p *Program, err error)
NewProgram compiles and links a shader. Args are vertex shader, fragment shader source
func (*Program) UniformArray ¶
UniformArray adds one or more uniforms arrays of the given type
type Texture2D ¶
type Texture2D struct {
// contains filtered or unexported fields
}
func NewTexture2D ¶
NewTexture2D creates a new 2D opengl texture. If srgba is set then it is converted to linear RGB space. If clamp is set then clamp to edge, else will wrap texture.
func (Texture2D) SetImageFile ¶
SetImageFile loads an image from a file
type Texture3D ¶
type Texture3D struct {
// contains filtered or unexported fields
}
func (Texture3D) SetImageFile ¶
SetImageFile loads an image from a file
type TextureCube ¶
type TextureCube struct {
// contains filtered or unexported fields
}
func NewTextureCube ¶
func NewTextureCube() TextureCube
NewTextureCube creates a new cubemap texture. If srgba is set then it is converted to linear RGB space.
func (TextureCube) SetImage ¶
func (t TextureCube) SetImage(r io.Reader, conv img.ImageConvert, index int) (TextureCube, error)
SetImage loads an image, if srgba is set then it is converted to linear RGB space. The index is the number of the image in the cubemap.
func (TextureCube) SetImageFile ¶
func (t TextureCube) SetImageFile(file string, conv img.ImageConvert, index int) (TextureCube, error)
SetImageFile loads an image from a file. The index is the number of the image in the cubemap.
type VertexArray ¶
type VertexArray struct {
// contains filtered or unexported fields
}
an array of buffer data
func ArrayBuffer ¶
func ArrayBuffer(data []float32, vertexSize int) *VertexArray
ArrayBuffer creates a new empty Vertex array with associated data. Size is the numer of size of each vertex in words.
func ElementArrayBuffer ¶
func ElementArrayBuffer(data []uint32) *VertexArray
ElementArrayBuffer creates a new empty Vertex array with associated data.