Documentation ¶
Index ¶
- func ConvertGoSliceToJsTypedArray(a interface{}) js.Value
- func GetRGBAFromString(s string) [4]float32
- func ParseHexColor(s string) [4]float32
- func ShowArrayInfo(desc string, iv interface{})
- type Constants
- type Geometry
- type Material
- func (self *Material) GetAlaphabetCharacterIndex(c rune) int
- func (self *Material) GetAlaphabetCharacterWH(scale float32) [2]float32
- func (self *Material) GetAlaphabetLength() int
- func (self *Material) GetAlaphabetPosesForLabel(label_text string) *SceneObjectPoses
- func (self *Material) GetDrawModeColor(draw_mode int) [4]float32
- func (self *Material) GetTexture() js.Value
- func (self *Material) GetTextureWH() [2]int
- func (self *Material) IsTextureLoading() bool
- func (self *Material) IsTextureReady() bool
- func (self *Material) LoadTexture(path string) *Material
- func (self *Material) SetColorForDrawMode(draw_mode int, color string) *Material
- func (self *Material) SetDrawModeColor(draw_mode int, color [4]float32) *Material
- func (self *Material) ShowInfo()
- type SceneObjectPoses
- type Shader
- func (self *Shader) CheckBindings()
- func (self *Shader) GetAttributeBindings() map[string]map[string]interface{}
- func (self *Shader) GetShaderProgram() js.Value
- func (self *Shader) GetUniformBindings() map[string]map[string]interface{}
- func (self *Shader) SetBindingForAttribute(name string, dtype string, autobinding string)
- func (self *Shader) SetBindingForUniform(name string, dtype string, option interface{})
- func (self *Shader) ShowInfo()
- type WebGLContext
- func (self *WebGLContext) GetCanvas() js.Value
- func (self *WebGLContext) GetConstants() *Constants
- func (self *WebGLContext) GetContext() js.Value
- func (self *WebGLContext) GetExtension(extname string) js.Value
- func (self *WebGLContext) GetWH() [2]int
- func (self *WebGLContext) IsExtensionReady(extname string) bool
- func (self *WebGLContext) RegisterEventHandlerForClick(handler func(canvasxy [2]int, keystat [4]bool))
- func (self *WebGLContext) RegisterEventHandlerForDoubleClick(handler func(canvasxy [2]int, keystat [4]bool))
- func (self *WebGLContext) RegisterEventHandlerForMouseDrag(handler func(canvasxy [2]int, dxy [2]int, keystat [4]bool))
- func (self *WebGLContext) RegisterEventHandlerForMouseOver(handler func(canvasxy [2]int, keystat [4]bool))
- func (self *WebGLContext) RegisterEventHandlerForMouseWheel(handler func(canvasxy [2]int, scale float32, keystat [4]bool))
- func (self *WebGLContext) RegisterEventHandlerForWindowResize(handler func(w int, h int))
- func (self *WebGLContext) SetupAnimationFrame(draw_handler func(canvas js.Value))
- func (self *WebGLContext) SetupEventHandlers()
- func (self *WebGLContext) SetupExtension(extname string)
- func (self *WebGLContext) ShowInfo()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRGBAFromString ¶
func ParseHexColor ¶
func ShowArrayInfo ¶
func ShowArrayInfo(desc string, iv interface{})
Types ¶
type Constants ¶
type Constants struct { ARRAY_BUFFER js.Value // BLEND js.Value // for gl.enable(gl.BLEND) BYTE js.Value // CLAMP_TO_EDGE js.Value // for gl.texParameteri() COLOR_BUFFER_BIT js.Value // COMPILE_STATUS js.Value // DEPTH_BUFFER_BIT js.Value // DEPTH_TEST js.Value // ELEMENT_ARRAY_BUFFER js.Value // FLOAT js.Value // FRAGMENT_SHADER js.Value // LEQUAL js.Value // LINEAR js.Value // for gl.texParameteri() LINES js.Value // LINK_STATUS js.Value // NEAREST js.Value // for gl.texParameteri() ONE js.Value // for gl.blendFunc() ONE_MINUS_SRC_ALPHA js.Value // for gl.blendFunc() POINTS js.Value // RGBA js.Value // SRC_ALPHA js.Value // for gl.blendFunc() STATIC_DRAW js.Value // TEXTURE_2D js.Value // for gl.texParameteri() TEXTURE0 js.Value // TEXTURE1 js.Value // TEXTURE_MIN_FILTER js.Value // for gl.texParameteri() TEXTURE_WRAP_S js.Value // for gl.texParameteri() TEXTURE_WRAP_T js.Value // for gl.texParameteri() TRIANGLES js.Value // UNSIGNED_BYTE js.Value // UNSIGNED_INT js.Value // UNSIGNED_SHORT js.Value // VERTEX_SHADER js.Value // }
func (*Constants) LoadFromContext ¶
type Material ¶
type Material struct {
// contains filtered or unexported fields
}
func NewMaterial ¶
func NewMaterial(wctx *WebGLContext, source string) *Material
func NewMaterial_AlphabetTexture ¶
func NewMaterial_AlphabetTexture(wctx *WebGLContext, fontsize int, color string, outlined bool) *Material
func NewMaterial_GlowTexture ¶
func NewMaterial_GlowTexture(wctx *WebGLContext, color string) *Material
func (*Material) GetAlaphabetCharacterIndex ¶
func (*Material) GetAlaphabetCharacterWH ¶
func (*Material) GetAlaphabetLength ¶
func (*Material) GetAlaphabetPosesForLabel ¶
func (self *Material) GetAlaphabetPosesForLabel(label_text string) *SceneObjectPoses
func (*Material) GetDrawModeColor ¶
func (*Material) GetTexture ¶
func (*Material) GetTextureWH ¶
func (*Material) IsTextureLoading ¶
func (*Material) IsTextureReady ¶
func (*Material) LoadTexture ¶
func (*Material) SetColorForDrawMode ¶
func (*Material) SetDrawModeColor ¶
type SceneObjectPoses ¶
type SceneObjectPoses struct { Size int // Count int // DataBuffer []float32 // WebGLBuffer js.Value // }
func NewSceneObjectPoses ¶
func NewSceneObjectPoses(size int, count int, data []float32) *SceneObjectPoses
func (*SceneObjectPoses) BuildWebGLBuffer ¶
func (self *SceneObjectPoses) BuildWebGLBuffer(wctx *WebGLContext)
func (*SceneObjectPoses) IsWebGLBufferReady ¶
func (self *SceneObjectPoses) IsWebGLBufferReady() bool
func (*SceneObjectPoses) SetPose ¶
func (self *SceneObjectPoses) SetPose(index int, offset int, values ...float32) bool
func (*SceneObjectPoses) ShowInfo ¶
func (self *SceneObjectPoses) ShowInfo()
type Shader ¶
type Shader struct {
// contains filtered or unexported fields
}
func NewShader ¶
func NewShader(wctx *WebGLContext, vertex_shader string, fragment_shader string) (*Shader, error)
func (*Shader) CheckBindings ¶
func (self *Shader) CheckBindings()
func (*Shader) GetAttributeBindings ¶
func (*Shader) GetShaderProgram ¶
func (*Shader) GetUniformBindings ¶
func (*Shader) SetBindingForAttribute ¶
func (*Shader) SetBindingForUniform ¶
type WebGLContext ¶
type WebGLContext struct {
// contains filtered or unexported fields
}
func NewWebGLContext ¶
func NewWebGLContext(canvas_id string) (*WebGLContext, error)
func (*WebGLContext) GetCanvas ¶
func (self *WebGLContext) GetCanvas() js.Value
func (*WebGLContext) GetConstants ¶
func (self *WebGLContext) GetConstants() *Constants
func (*WebGLContext) GetContext ¶
func (self *WebGLContext) GetContext() js.Value
func (*WebGLContext) GetExtension ¶
func (self *WebGLContext) GetExtension(extname string) js.Value
func (*WebGLContext) GetWH ¶
func (self *WebGLContext) GetWH() [2]int
func (*WebGLContext) IsExtensionReady ¶
func (self *WebGLContext) IsExtensionReady(extname string) bool
func (*WebGLContext) RegisterEventHandlerForClick ¶
func (self *WebGLContext) RegisterEventHandlerForClick(handler func(canvasxy [2]int, keystat [4]bool))
func (*WebGLContext) RegisterEventHandlerForDoubleClick ¶
func (self *WebGLContext) RegisterEventHandlerForDoubleClick(handler func(canvasxy [2]int, keystat [4]bool))
func (*WebGLContext) RegisterEventHandlerForMouseDrag ¶
func (self *WebGLContext) RegisterEventHandlerForMouseDrag(handler func(canvasxy [2]int, dxy [2]int, keystat [4]bool))
func (*WebGLContext) RegisterEventHandlerForMouseOver ¶
func (self *WebGLContext) RegisterEventHandlerForMouseOver(handler func(canvasxy [2]int, keystat [4]bool))
func (*WebGLContext) RegisterEventHandlerForMouseWheel ¶
func (self *WebGLContext) RegisterEventHandlerForMouseWheel(handler func(canvasxy [2]int, scale float32, keystat [4]bool))
func (*WebGLContext) RegisterEventHandlerForWindowResize ¶
func (self *WebGLContext) RegisterEventHandlerForWindowResize(handler func(w int, h int))
func (*WebGLContext) SetupAnimationFrame ¶
func (self *WebGLContext) SetupAnimationFrame(draw_handler func(canvas js.Value))
func (*WebGLContext) SetupEventHandlers ¶
func (self *WebGLContext) SetupEventHandlers()
func (*WebGLContext) SetupExtension ¶
func (self *WebGLContext) SetupExtension(extname string)
func (*WebGLContext) ShowInfo ¶
func (self *WebGLContext) ShowInfo()
Click to show internal directories.
Click to hide internal directories.