Documentation ¶
Index ¶
- Variables
- func ArrayPtr(data interface{}) (gl.Pointer, gl.Sizeiptr)
- func AttachTexture(location gl.UniformLocation, textureEnum gl.Enum, target gl.Enum, ...)
- func Bind(bindings interface{})
- func BindArrayData(buffer gl.Buffer, data interface{})
- func BindProgramLocations(program gl.Program, bindings interface{})
- func Cross3D(a, b glm.Vec4d) glm.Vec3d
- func Cross3Dv(a, b glm.Vec4d) glm.Vec4d
- func DrawGeometry(geo *Geometry, vertexAttribute gl.AttributeLocation, vao gl.VertexArrayObject)
- func DrawModel(mv glm.Mat4d, model *Model, modelview gl.UniformLocation, ...)
- func ImageData(img image.Image) (gl.Sizei, gl.Sizei, gl.Enum, gl.Enum, gl.Pointer)
- func LoadConfiguration(confFile string, constants interface{}, bindings *ControlBindings, ...) error
- func LoadFragmentShaderSource(shader gl.FragmentShader, filename string) error
- func LoadProgram(program gl.Program, vertexShader gl.VertexShader, ...) error
- func LoadShader(shader gl.Uint, filename string) error
- func LoadTexture(texture gl.Texture, filename string) error
- func LoadVertexShaderSource(shader gl.VertexShader, filename string) error
- func MatArray(d glm.Mat4d) *gl.Float
- func MouseCoord(window *glfw.Window, xpos, ypos float64) glm.Vec2d
- func NearZero(v glm.Vec4d) bool
- func NodeTransform(node *collada.Node) glm.Mat4d
- func PanicOnError()
- func Quaternion(m glm.Mat3d) glm.Quatd
- func Rotation(angle float64, axis glm.Vec4d) glm.Mat4d
- func RotationBetweenNormals(n1, n2 glm.Vec4d) glm.Mat4d
- func RotationComponent(m glm.Mat4d) glm.Mat3d
- func ToHomogVec4D(v glm.Vec3d) glm.Vec4d
- func ToVec3D(v glm.Vec4d) glm.Vec3d
- func Translate(v glm.Vec4d) glm.Mat4d
- func V3(v glm.Vec4d) glm.Vec3d
- type Action
- type Color
- type ColorPallet
- type ControlBindings
- func (c *ControlBindings) Apply(receiver interface{}, bindings map[string]string)
- func (c *ControlBindings) BindKeyPress(key glfw.Key, press Action, release Action)
- func (c *ControlBindings) BindMouseClick(button glfw.MouseButton, press Action, release Action)
- func (c *ControlBindings) BindMouseMovement(action MouseMoveAction)
- func (c *ControlBindings) BindScroll(action ScrollAction)
- func (c *ControlBindings) DoKeyAction(key glfw.Key, keyAction glfw.Action)
- func (c *ControlBindings) DoMouseButtonAction(button glfw.MouseButton, mouseAction glfw.Action)
- func (c *ControlBindings) DoMouseMoveAction(window *glfw.Window, xpos, ypos float64)
- func (c *ControlBindings) DoScrollAction(xoff, yoff float64)
- func (c *ControlBindings) FindClickAction(button glfw.MouseButton, buttonAction glfw.Action) (Action, bool)
- func (c *ControlBindings) FindKeyAction(key glfw.Key, keyAction glfw.Action) (Action, bool)
- func (c *ControlBindings) FindMouseMovementAction() (MouseMoveAction, bool)
- func (c *ControlBindings) FindScrollAction() (ScrollAction, bool)
- func (c *ControlBindings) ResetBindings()
- func (c *ControlBindings) UnbindKeyPress(key glfw.Key)
- func (c *ControlBindings) UnbindMouseClick(button glfw.MouseButton)
- func (c *ControlBindings) UnbindMouseMovement()
- func (c *ControlBindings) UnbindScroll()
- type DrawElements
- type Geometry
- type Index
- type IndexPair
- type Mesh
- type Model
- func EmptyModel(name string) *Model
- func LoadModel(index *Index, node *collada.Node, geometryTemplates map[collada.Id][]*Geometry) (*Model, bool)
- func LoadSceneAsModel(filename string) (*Model, error)
- func NewModel(name string, children []*Model, geometry []*Geometry, transform glm.Mat4d) *Model
- func NewSingleModel(name string, verticies, normals []float64, elements []int16, drawType gl.Enum, ...) *Model
- type MouseMoveAction
- type Polylist
- type ScrollAction
- type ShaderLibrary
- func (lib *ShaderLibrary) BindProgramLocations(tag string, obj interface{})
- func (lib *ShaderLibrary) GetProgram(tag string) (gl.Program, bool)
- func (lib *ShaderLibrary) LoadFragmentShader(tag, filename string)
- func (lib *ShaderLibrary) LoadProgram(tag, vsfilename, fsfilename string)
- func (lib *ShaderLibrary) LoadVertexShader(tag, filename string)
- func (lib *ShaderLibrary) UseProgram(tag string)
- type StencilOp
- func (s *StencilOp) Decrement() *StencilOp
- func (s *StencilOp) Depth() *StencilOp
- func (s *StencilOp) DepthAlways() *StencilOp
- func (s *StencilOp) DepthLE() *StencilOp
- func (s *StencilOp) DepthLT() *StencilOp
- func (s *StencilOp) DepthMask() *StencilOp
- func (s *StencilOp) Disable() *StencilOp
- func (s *StencilOp) Draw() *StencilOp
- func (s *StencilOp) Enable() *StencilOp
- func (s *StencilOp) Increment() *StencilOp
- func (s *StencilOp) Keep() *StencilOp
- func (s *StencilOp) Mask(level int) *StencilOp
- func (s *StencilOp) NoDepth() *StencilOp
- func (s *StencilOp) NoDepthMask() *StencilOp
- func (s *StencilOp) NoDraw() *StencilOp
- func (s *StencilOp) Replace() *StencilOp
- func (s *StencilOp) Unmask(level int) *StencilOp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Red = Color{1, 0, 0, 1} Green = Color{0, 1, 0, 1} Blue = Color{0, 0, 1, 1} Black = Color{0, 0, 0, 1} White = Color{1, 1, 1, 1} Orange = Color{1, 0.5, 0, 1} Pink = Color{1, 0, 0.5, 1} Lime = Color{0.5, 1, 0, 1} Aqua = Color{0, 1, 0.5, 1} Purple = Color{0.5, 0, 1, 1} SkyBlue = Color{0, 0.5, 1, 1} Yellow = Color{1, 1, 0, 1} Cyan = Color{0, 1, 1, 1} Magenta = Color{1, 0, 1, 1} SoftRed = Color{0.8, 0.2, 0.2, 1} SoftGreen = Color{0.2, 0.8, 0.2, 1} SoftBlue = Color{0.2, 0.2, 0.8, 1} SoftWhite = Color{0.8, 0.8, 0.8, 1} SoftBlack = Color{0.2, 0.2, 0.2, 1} DebugPallet = ColorPallet{ SoftRed, SoftGreen, SoftBlue, Orange, Pink, Lime, Aqua, Purple, Yellow, Cyan, Magenta, } )
Functions ¶
func AttachTexture ¶
func BindArrayData ¶
func BindProgramLocations ¶
func DrawGeometry ¶
func DrawGeometry(geo *Geometry, vertexAttribute gl.AttributeLocation, vao gl.VertexArrayObject)
func DrawModel ¶
func DrawModel(mv glm.Mat4d, model *Model, modelview gl.UniformLocation, vertexAttribute gl.AttributeLocation, vao gl.VertexArrayObject)
func LoadConfiguration ¶
func LoadConfiguration(confFile string, constants interface{}, bindings *ControlBindings, receiver interface{}) error
func LoadFragmentShaderSource ¶
func LoadFragmentShaderSource(shader gl.FragmentShader, filename string) error
func LoadProgram ¶
func LoadProgram(program gl.Program, vertexShader gl.VertexShader, fragmentShader gl.FragmentShader) error
func LoadVertexShaderSource ¶
func LoadVertexShaderSource(shader gl.VertexShader, filename string) error
func PanicOnError ¶
func PanicOnError()
Types ¶
type ColorPallet ¶
type ColorPallet []Color
func (ColorPallet) Pick ¶
func (pallet ColorPallet) Pick(n int) *Color
type ControlBindings ¶
type ControlBindings struct {
// contains filtered or unexported fields
}
func (*ControlBindings) Apply ¶
func (c *ControlBindings) Apply(receiver interface{}, bindings map[string]string)
func (*ControlBindings) BindKeyPress ¶
func (c *ControlBindings) BindKeyPress(key glfw.Key, press Action, release Action)
func (*ControlBindings) BindMouseClick ¶
func (c *ControlBindings) BindMouseClick(button glfw.MouseButton, press Action, release Action)
func (*ControlBindings) BindMouseMovement ¶
func (c *ControlBindings) BindMouseMovement(action MouseMoveAction)
func (*ControlBindings) BindScroll ¶
func (c *ControlBindings) BindScroll(action ScrollAction)
func (*ControlBindings) DoKeyAction ¶
func (c *ControlBindings) DoKeyAction(key glfw.Key, keyAction glfw.Action)
func (*ControlBindings) DoMouseButtonAction ¶
func (c *ControlBindings) DoMouseButtonAction(button glfw.MouseButton, mouseAction glfw.Action)
func (*ControlBindings) DoMouseMoveAction ¶
func (c *ControlBindings) DoMouseMoveAction(window *glfw.Window, xpos, ypos float64)
func (*ControlBindings) DoScrollAction ¶
func (c *ControlBindings) DoScrollAction(xoff, yoff float64)
func (*ControlBindings) FindClickAction ¶
func (c *ControlBindings) FindClickAction(button glfw.MouseButton, buttonAction glfw.Action) (Action, bool)
func (*ControlBindings) FindKeyAction ¶
func (*ControlBindings) FindMouseMovementAction ¶
func (c *ControlBindings) FindMouseMovementAction() (MouseMoveAction, bool)
func (*ControlBindings) FindScrollAction ¶
func (c *ControlBindings) FindScrollAction() (ScrollAction, bool)
func (*ControlBindings) ResetBindings ¶
func (c *ControlBindings) ResetBindings()
func (*ControlBindings) UnbindKeyPress ¶
func (c *ControlBindings) UnbindKeyPress(key glfw.Key)
func (*ControlBindings) UnbindMouseClick ¶
func (c *ControlBindings) UnbindMouseClick(button glfw.MouseButton)
func (*ControlBindings) UnbindMouseMovement ¶
func (c *ControlBindings) UnbindMouseMovement()
func (*ControlBindings) UnbindScroll ¶
func (c *ControlBindings) UnbindScroll()
type DrawElements ¶
func MakeElements ¶
func MakeElements(elementMap map[gl.Enum][]int16) []*DrawElements
func NewDrawElements ¶
func NewDrawElements(elements []int16, drawType gl.Enum) *DrawElements
type Geometry ¶
type Geometry struct { Name string VertexBuffer gl.Buffer NormalBuffer gl.Buffer Elements []*DrawElements }
func NewGeometry ¶
func NewGeometry(name string, verticies, normals []float64, elements []*DrawElements) *Geometry
func (*Geometry) AddDrawElements ¶
func (geometry *Geometry) AddDrawElements(drawElements *DrawElements)
type Index ¶
type Model ¶
type Model struct { Name string Transform glm.Mat4d BaseTransform glm.Mat4d Geometry []*Geometry Children []*Model Parent *Model }
func EmptyModel ¶
func LoadSceneAsModel ¶
func NewSingleModel ¶
func (*Model) AddGeometry ¶
func (*Model) WorldTransform ¶
type MouseMoveAction ¶
func FindMouseMoveActionMethod ¶
func FindMouseMoveActionMethod(v reflect.Value, name string) MouseMoveAction
type ScrollAction ¶
type ScrollAction func(xoff, yoff float64)
type ShaderLibrary ¶
type ShaderLibrary struct { FragmentShaders map[string]gl.FragmentShader VertexShaders map[string]gl.VertexShader Programs map[string]gl.Program }
func NewShaderLibrary ¶
func NewShaderLibrary() ShaderLibrary
func (*ShaderLibrary) BindProgramLocations ¶
func (lib *ShaderLibrary) BindProgramLocations(tag string, obj interface{})
func (*ShaderLibrary) GetProgram ¶
func (lib *ShaderLibrary) GetProgram(tag string) (gl.Program, bool)
func (*ShaderLibrary) LoadFragmentShader ¶
func (lib *ShaderLibrary) LoadFragmentShader(tag, filename string)
func (*ShaderLibrary) LoadProgram ¶
func (lib *ShaderLibrary) LoadProgram(tag, vsfilename, fsfilename string)
func (*ShaderLibrary) LoadVertexShader ¶
func (lib *ShaderLibrary) LoadVertexShader(tag, filename string)
func (*ShaderLibrary) UseProgram ¶
func (lib *ShaderLibrary) UseProgram(tag string)
type StencilOp ¶
type StencilOp struct { }
var Stencil StencilOp
func (*StencilOp) DepthAlways ¶
func (*StencilOp) NoDepthMask ¶
Click to show internal directories.
Click to hide internal directories.