Documentation ¶
Index ¶
- func AfterDrawing(window *glfw.Window)
- func BeforeDrawing()
- func BeforeMainLoop(window *glfw.Window, vp *Viewpoint)
- func Init(windowWidth int, windowHeight int, windowTitle string) *glfw.Window
- func InitGlfwAndOpenGL(width int, height int, title string) *glfw.Window
- func MakeProgram(vertexShaderSource, fragmentShaderSource string) uint32
- func NewCube(l float32) *[]float32
- func NewUniTexCube(l float32) *[]float32
- func ReadBinaryStlFile(file string, min float64, max float64) []float32
- func Terminate()
- type BasicNoLightObj
- func (obj *BasicNoLightObj) BindProgramVar(program uint32)
- func (obj *BasicNoLightObj) GetModel() mgl32.Mat4
- func (obj *BasicNoLightObj) GetProgram() uint32
- func (obj *BasicNoLightObj) PrepareProgram(bindProgramVar bool)
- func (obj *BasicNoLightObj) Render()
- func (obj *BasicNoLightObj) SetModel(newModel mgl32.Mat4)
- func (obj *BasicNoLightObj) SetProgram(program uint32)
- func (obj *BasicNoLightObj) SetProgramVar(progVar interface{})
- func (obj *BasicNoLightObj) SetVertices(vertices *[]float32)
- type BasicNoLightObjProgVar
- type BasicObj
- func (obj *BasicObj) BindProgramVar(program uint32)
- func (obj *BasicObj) GetModel() mgl32.Mat4
- func (obj *BasicObj) GetProgram() uint32
- func (obj *BasicObj) PrepareProgram(bindProgramVar bool)
- func (obj *BasicObj) Render()
- func (obj *BasicObj) SetModel(newModel mgl32.Mat4)
- func (obj *BasicObj) SetProgram(program uint32)
- func (obj *BasicObj) SetProgramVar(progVar interface{})
- func (obj *BasicObj) SetVertices(vertices *[]float32)
- type BasicObjProgVar
- type BasicTexObj
- func (obj *BasicTexObj) BindProgramVar(program uint32)
- func (obj *BasicTexObj) GetModel() mgl32.Mat4
- func (obj *BasicTexObj) GetProgram() uint32
- func (obj *BasicTexObj) PrepareProgram(bindProgramVar bool)
- func (obj *BasicTexObj) Render()
- func (obj *BasicTexObj) SetModel(newModel mgl32.Mat4)
- func (obj *BasicTexObj) SetProgram(program uint32)
- func (obj *BasicTexObj) SetProgramVar(progVar interface{})
- func (obj *BasicTexObj) SetVertices(vertices *[]float32)
- type BasicTexObjProgVar
- type Group
- type LightSrc
- type Material
- type Object
- type Viewpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterDrawing ¶
func BeforeDrawing ¶
func BeforeDrawing()
func BeforeMainLoop ¶
func MakeProgram ¶
func NewUniTexCube ¶
NewUniTexCube will return vertices of a cube with side length l. The vertices contains custom data (texture vector)
Types ¶
type BasicNoLightObj ¶
type BasicNoLightObj struct {
// contains filtered or unexported fields
}
func (*BasicNoLightObj) BindProgramVar ¶
func (obj *BasicNoLightObj) BindProgramVar(program uint32)
func (*BasicNoLightObj) GetModel ¶
func (obj *BasicNoLightObj) GetModel() mgl32.Mat4
func (*BasicNoLightObj) GetProgram ¶
func (obj *BasicNoLightObj) GetProgram() uint32
func (*BasicNoLightObj) PrepareProgram ¶
func (obj *BasicNoLightObj) PrepareProgram(bindProgramVar bool)
func (*BasicNoLightObj) Render ¶
func (obj *BasicNoLightObj) Render()
func (*BasicNoLightObj) SetModel ¶
func (obj *BasicNoLightObj) SetModel(newModel mgl32.Mat4)
func (*BasicNoLightObj) SetProgram ¶
func (obj *BasicNoLightObj) SetProgram(program uint32)
func (*BasicNoLightObj) SetProgramVar ¶
func (obj *BasicNoLightObj) SetProgramVar(progVar interface{})
func (*BasicNoLightObj) SetVertices ¶
func (obj *BasicNoLightObj) SetVertices(vertices *[]float32)
type BasicNoLightObjProgVar ¶
type BasicObj ¶
type BasicObj struct {
// contains filtered or unexported fields
}
func (*BasicObj) BindProgramVar ¶
func (*BasicObj) GetProgram ¶
func (*BasicObj) PrepareProgram ¶
func (*BasicObj) SetProgram ¶
func (*BasicObj) SetProgramVar ¶
func (obj *BasicObj) SetProgramVar(progVar interface{})
func (*BasicObj) SetVertices ¶
type BasicObjProgVar ¶
type BasicTexObj ¶
type BasicTexObj struct {
// contains filtered or unexported fields
}
func (*BasicTexObj) BindProgramVar ¶
func (obj *BasicTexObj) BindProgramVar(program uint32)
func (*BasicTexObj) GetModel ¶
func (obj *BasicTexObj) GetModel() mgl32.Mat4
func (*BasicTexObj) GetProgram ¶
func (obj *BasicTexObj) GetProgram() uint32
func (*BasicTexObj) PrepareProgram ¶
func (obj *BasicTexObj) PrepareProgram(bindProgramVar bool)
func (*BasicTexObj) Render ¶
func (obj *BasicTexObj) Render()
func (*BasicTexObj) SetModel ¶
func (obj *BasicTexObj) SetModel(newModel mgl32.Mat4)
func (*BasicTexObj) SetProgram ¶
func (obj *BasicTexObj) SetProgram(program uint32)
func (*BasicTexObj) SetProgramVar ¶
func (obj *BasicTexObj) SetProgramVar(progVar interface{})
func (*BasicTexObj) SetVertices ¶
func (obj *BasicTexObj) SetVertices(vertices *[]float32)
type BasicTexObjProgVar ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) SetGroupModel ¶
type LightSrc ¶
func NewLightSrc ¶
func NewLightSrc() LightSrc
type Material ¶
type Material struct { Ambient mgl32.Vec3 Diffuse mgl32.Vec3 Specular mgl32.Vec3 Shininess float32 }
func NewMaterial ¶
func NewMaterial() Material
type Object ¶
type Object interface { // SetProgramVar sets the program's constant and uniform variables. SetProgramVar(interface{}) // PrepareProgram prepares a shader program. // If the arg is true, bind uniform variables, // otherwise store the program only without binding uniform variables. PrepareProgram(bool) // BindProgramVar bind uniform variables to a shader program. BindProgramVar(uint32) // SetVertices sets vao and vbo. SetVertices(*[]float32) // GetModel gets the model of the object. GetProgram() uint32 // SetModel sets the model of the object. SetProgram(uint32) // GetModel gets the model of the object. GetModel() mgl32.Mat4 // SetModel sets the model of the object. SetModel(mgl32.Mat4) // Render refreshs uniform variables and draw the object. // All references of the variables that would change the // object's states in the main loop (i.e. uniform variables) // should have already been prepared when calling SetProgramVar(), // thus we won't do any extra work here to get the best performance. Render() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.