Documentation
¶
Index ¶
- func Run(app env.Application, deferrer <-chan func())
- type OpenGl
- func (native *OpenGl) ActiveTexture(texture uint32)
- func (native *OpenGl) AttachShader(program uint32, shader uint32)
- func (native *OpenGl) BindAttribLocation(program uint32, index uint32, name string)
- func (native *OpenGl) BindBuffer(target uint32, buffer uint32)
- func (native *OpenGl) BindTexture(target uint32, texture uint32)
- func (native *OpenGl) BindVertexArray(array uint32)
- func (native *OpenGl) BlendFunc(sfactor uint32, dfactor uint32)
- func (native *OpenGl) BufferData(target uint32, size int, data interface{}, usage uint32)
- func (native *OpenGl) Clear(mask uint32)
- func (native *OpenGl) ClearColor(red float32, green float32, blue float32, alpha float32)
- func (native *OpenGl) CompileShader(shader uint32)
- func (native *OpenGl) CreateProgram() uint32
- func (native *OpenGl) CreateShader(shaderType uint32) uint32
- func (native *OpenGl) DeleteBuffers(buffers []uint32)
- func (native *OpenGl) DeleteProgram(program uint32)
- func (native *OpenGl) DeleteShader(shader uint32)
- func (native *OpenGl) DeleteTextures(textures []uint32)
- func (native *OpenGl) DeleteVertexArrays(arrays []uint32)
- func (native *OpenGl) Disable(cap uint32)
- func (native *OpenGl) DrawArrays(mode uint32, first int32, count int32)
- func (native *OpenGl) Enable(cap uint32)
- func (native *OpenGl) EnableVertexAttribArray(index uint32)
- func (native *OpenGl) GenBuffers(n int32) []uint32
- func (native *OpenGl) GenTextures(n int32) []uint32
- func (native *OpenGl) GenVertexArrays(n int32) []uint32
- func (native *OpenGl) GenerateMipmap(target uint32)
- func (native *OpenGl) GetAttribLocation(program uint32, name string) int32
- func (native *OpenGl) GetError() uint32
- func (native *OpenGl) GetProgramInfoLog(program uint32) string
- func (native *OpenGl) GetProgramParameter(program uint32, param uint32) int32
- func (native *OpenGl) GetShaderInfoLog(shader uint32) string
- func (native *OpenGl) GetShaderParameter(shader uint32, param uint32) int32
- func (native *OpenGl) GetUniformLocation(program uint32, name string) int32
- func (native *OpenGl) LinkProgram(program uint32)
- func (native *OpenGl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, pixelType uint32, ...)
- func (native *OpenGl) ShaderSource(shader uint32, source string)
- func (native *OpenGl) TexImage2D(target uint32, level int32, internalFormat uint32, width int32, height int32, ...)
- func (native *OpenGl) TexParameteri(target uint32, pname uint32, param int32)
- func (native *OpenGl) Uniform1i(location int32, value int32)
- func (native *OpenGl) Uniform4fv(location int32, value *[4]float32)
- func (native *OpenGl) UniformMatrix4fv(location int32, transpose bool, value *[16]float32)
- func (native *OpenGl) UseProgram(program uint32)
- func (native *OpenGl) VertexAttribOffset(index uint32, size int32, attribType uint32, normalized bool, stride int32, ...)
- func (native *OpenGl) Viewport(x int32, y int32, width int32, height int32)
- type OpenGlWindow
- func (window *OpenGlWindow) Clipboard() env.Clipboard
- func (window *OpenGlWindow) Close()
- func (window *OpenGlWindow) OpenGl() opengl.OpenGl
- func (window *OpenGlWindow) SetText(value string)
- func (window *OpenGlWindow) ShouldClose() bool
- func (window *OpenGlWindow) Size() (width int, height int)
- func (window *OpenGlWindow) Text() string
- func (window *OpenGlWindow) Update()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(app env.Application, deferrer <-chan func())
Run initializes the environment to run the given application within.
Types ¶
type OpenGl ¶
type OpenGl struct { }
OpenGl wraps the native GL API into a common interface
func NewOpenGl ¶
func NewOpenGl() *OpenGl
NewOpenGl initializes the Gl bindings and returns an OpenGl instance.
func (*OpenGl) ActiveTexture ¶
ActiveTexture implements the opengl.OpenGl interface.
func (*OpenGl) AttachShader ¶
AttachShader implements the opengl.OpenGl interface.
func (*OpenGl) BindAttribLocation ¶
BindAttribLocation implements the opengl.OpenGl interface.
func (*OpenGl) BindBuffer ¶
BindBuffer implements the opengl.OpenGl interface.
func (*OpenGl) BindTexture ¶
BindTexture implements the opengl.OpenGl interface.
func (*OpenGl) BindVertexArray ¶
BindVertexArray implements the opengl.OpenGl interface.
func (*OpenGl) BufferData ¶
BufferData implements the opengl.OpenGl interface.
func (*OpenGl) ClearColor ¶
ClearColor implements the opengl.OpenGl interface.
func (*OpenGl) CompileShader ¶
CompileShader implements the opengl.OpenGl interface.
func (*OpenGl) CreateProgram ¶
CreateProgram implements the opengl.OpenGl interface.
func (*OpenGl) CreateShader ¶
CreateShader implements the opengl.OpenGl interface.
func (*OpenGl) DeleteBuffers ¶
DeleteBuffers implements the opengl.OpenGl interface.
func (*OpenGl) DeleteProgram ¶
DeleteProgram implements the opengl.OpenGl interface.
func (*OpenGl) DeleteShader ¶
DeleteShader implements the opengl.OpenGl interface.
func (*OpenGl) DeleteTextures ¶
DeleteTextures implements the opengl.OpenGl interface.
func (*OpenGl) DeleteVertexArrays ¶
DeleteVertexArrays implements the opengl.OpenGl interface.
func (*OpenGl) DrawArrays ¶
DrawArrays implements the opengl.OpenGl interface.
func (*OpenGl) EnableVertexAttribArray ¶
EnableVertexAttribArray implements the opengl.OpenGl interface.
func (*OpenGl) GenBuffers ¶
GenBuffers implements the opengl.OpenGl interface.
func (*OpenGl) GenTextures ¶
GenTextures implements the opengl.OpenGl interface.
func (*OpenGl) GenVertexArrays ¶
GenVertexArrays implements the opengl.OpenGl interface.
func (*OpenGl) GenerateMipmap ¶
GenerateMipmap implements the opengl.OpenGl interface.
func (*OpenGl) GetAttribLocation ¶
GetAttribLocation implements the opengl.OpenGl interface.
func (*OpenGl) GetProgramInfoLog ¶
GetProgramInfoLog implements the opengl.OpenGl interface.
func (*OpenGl) GetProgramParameter ¶
GetProgramParameter implements the opengl.OpenGl interface.
func (*OpenGl) GetShaderInfoLog ¶
GetShaderInfoLog implements the opengl.OpenGl interface.
func (*OpenGl) GetShaderParameter ¶
GetShaderParameter implements the opengl.OpenGl interface.
func (*OpenGl) GetUniformLocation ¶
GetUniformLocation implements the opengl.OpenGl interface.
func (*OpenGl) LinkProgram ¶
LinkProgram implements the opengl.OpenGl interface.
func (*OpenGl) ReadPixels ¶
func (native *OpenGl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, pixelType uint32, pixels interface{})
ReadPixels implements the opengl.OpenGl interface.
func (*OpenGl) ShaderSource ¶
ShaderSource implements the opengl.OpenGl interface.
func (*OpenGl) TexImage2D ¶
func (native *OpenGl) TexImage2D(target uint32, level int32, internalFormat uint32, width int32, height int32, border int32, format uint32, xtype uint32, pixels interface{})
TexImage2D implements the opengl.OpenGl interface.
func (*OpenGl) TexParameteri ¶
TexParameteri implements the opengl.OpenGl interface.
func (*OpenGl) Uniform4fv ¶
Uniform4fv implements the opengl.OpenGl interface.
func (*OpenGl) UniformMatrix4fv ¶
UniformMatrix4fv implements the opengl.OpenGl interface.
func (*OpenGl) UseProgram ¶
UseProgram implements the opengl.OpenGl interface.
type OpenGlWindow ¶
type OpenGlWindow struct { env.AbstractOpenGlWindow // contains filtered or unexported fields }
OpenGlWindow represents a native OpenGL surface.
func NewOpenGlWindow ¶
func NewOpenGlWindow() (window *OpenGlWindow, err error)
NewOpenGlWindow tries to initialize the OpenGL environment and returns a new window instance.
func (*OpenGlWindow) Clipboard ¶
func (window *OpenGlWindow) Clipboard() env.Clipboard
Clipboard implements the env.OpenGlWindow interface.
func (*OpenGlWindow) Close ¶
func (window *OpenGlWindow) Close()
Close closes the window and releases its resources.
func (*OpenGlWindow) OpenGl ¶
func (window *OpenGlWindow) OpenGl() opengl.OpenGl
OpenGl implements the env.OpenGlWindow interface.
func (*OpenGlWindow) SetText ¶
func (window *OpenGlWindow) SetText(value string)
SetText implements the env.Clipboard interface.
func (*OpenGlWindow) ShouldClose ¶
func (window *OpenGlWindow) ShouldClose() bool
ShouldClose returns true if the user requested the window to close.
func (*OpenGlWindow) Size ¶
func (window *OpenGlWindow) Size() (width int, height int)
Size implements the env.OpenGlWindow interface.
func (*OpenGlWindow) Text ¶
func (window *OpenGlWindow) Text() string
Text implements the env.Clipboard interface.
func (*OpenGlWindow) Update ¶
func (window *OpenGlWindow) Update()
Update must be called from within the main thread as often as possible.