Documentation ¶
Index ¶
- func Run(initializer func(opengl.Window) error, title string, framesPerSecond float64) error
- 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) BindFramebuffer(target uint32, buffer uint32)
- func (native *OpenGL) BindRenderbuffer(target uint32, buffer uint32)
- func (native *OpenGL) BindSampler(unit uint32, sampler uint32)
- func (native *OpenGL) BindTexture(target uint32, texture uint32)
- func (native *OpenGL) BindVertexArray(array uint32)
- func (native *OpenGL) BlendEquation(mode uint32)
- func (native *OpenGL) BlendEquationSeparate(modeRGB uint32, modeAlpha uint32)
- func (native *OpenGL) BlendFunc(sfactor uint32, dfactor uint32)
- func (native *OpenGL) BlendFuncSeparate(srcRGB uint32, dstRGB uint32, srcAlpha uint32, dstAlpha uint32)
- func (native *OpenGL) BufferData(target uint32, size int, data interface{}, usage uint32)
- func (native *OpenGL) CheckFramebufferStatus(target uint32) 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) DeleteFramebuffers(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(capability uint32)
- func (native *OpenGL) DrawArrays(mode uint32, first int32, count int32)
- func (native *OpenGL) DrawBuffers(buffers []uint32)
- func (native *OpenGL) DrawElements(mode uint32, count int32, elementType uint32, indices uintptr)
- func (native *OpenGL) Enable(capability uint32)
- func (native *OpenGL) EnableVertexAttribArray(index uint32)
- func (native *OpenGL) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, ...)
- func (native *OpenGL) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32)
- func (native *OpenGL) GenBuffers(n int32) []uint32
- func (native *OpenGL) GenFramebuffers(n int32) []uint32
- func (native *OpenGL) GenRenderbuffers(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) GetIntegerv(name uint32, data *int32)
- 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) IsEnabled(capability uint32) bool
- func (native *OpenGL) LinkProgram(program uint32)
- func (native *OpenGL) PixelStorei(name uint32, param int32)
- func (native *OpenGL) PolygonMode(face uint32, mode uint32)
- func (native *OpenGL) ReadPixels(x int32, y int32, width int32, height int32, format uint32, pixelType uint32, ...)
- func (native *OpenGL) RenderbufferStorage(target uint32, internalFormat uint32, width int32, height int32)
- func (native *OpenGL) Scissor(x, y int32, width, height int32)
- 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) ClipboardString() (string, error)
- func (window *OpenGLWindow) Close()
- func (window *OpenGLWindow) OpenGL() opengl.OpenGL
- func (window OpenGLWindow) RestoreState(state opengl.WindowState)
- func (window OpenGLWindow) SetClipboardString(value string)
- func (window *OpenGLWindow) SetCloseRequest(shouldClose bool)
- func (window *OpenGLWindow) SetCursorVisible(visible bool)
- func (window *OpenGLWindow) SetFullScreen(on bool)
- func (window *OpenGLWindow) SetProjectModified(modified bool)
- func (window *OpenGLWindow) SetTitleSuffix(value string)
- func (window *OpenGLWindow) ShouldClose() bool
- func (window *OpenGLWindow) Size() (width int, height int)
- func (window OpenGLWindow) StateSnapshot() opengl.WindowState
- func (window *OpenGLWindow) Update()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) BindFramebuffer ¶ added in v1.8.0
BindFramebuffer implements the opengl.OpenGL interface.
func (*OpenGL) BindRenderbuffer ¶ added in v1.8.0
BindRenderbuffer implements the opengl.OpenGL interface.
func (*OpenGL) BindSampler ¶
BindSampler 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) BlendEquation ¶
BlendEquation implements the opengl.OpenGL interface.
func (*OpenGL) BlendEquationSeparate ¶
BlendEquationSeparate implements the opengl.OpenGL interface.
func (*OpenGL) BlendFuncSeparate ¶
func (native *OpenGL) BlendFuncSeparate(srcRGB uint32, dstRGB uint32, srcAlpha uint32, dstAlpha uint32)
BlendFuncSeparate implements the opengl.OpenGL interface.
func (*OpenGL) BufferData ¶
BufferData implements the opengl.OpenGL interface.
func (*OpenGL) CheckFramebufferStatus ¶ added in v1.8.0
CheckFramebufferStatus 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) DeleteFramebuffers ¶ added in v1.8.0
DeleteFramebuffers 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) DrawBuffers ¶ added in v1.8.0
DrawBuffers implements the opengl.OpenGL interface.
func (*OpenGL) DrawElements ¶
DrawElements implements the opengl.OpenGL interface.
func (*OpenGL) EnableVertexAttribArray ¶
EnableVertexAttribArray implements the opengl.OpenGL interface.
func (*OpenGL) FramebufferRenderbuffer ¶ added in v1.8.0
func (native *OpenGL) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32)
FramebufferRenderbuffer implements the opengl.OpenGL interface.
func (*OpenGL) FramebufferTexture ¶ added in v1.8.0
func (native *OpenGL) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32)
FramebufferTexture implements the opengl.OpenGL interface.
func (*OpenGL) GenBuffers ¶
GenBuffers implements the opengl.OpenGL interface.
func (*OpenGL) GenFramebuffers ¶ added in v1.8.0
GenFramebuffers implements the opengl.OpenGL interface.
func (*OpenGL) GenRenderbuffers ¶ added in v1.8.0
GenRenderbuffers 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) GetIntegerv ¶
GetIntegerv 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) PixelStorei ¶
PixelStorei implements the OpenGL interface.
func (*OpenGL) PolygonMode ¶
PolygonMode 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) RenderbufferStorage ¶ added in v1.8.0
func (native *OpenGL) RenderbufferStorage(target uint32, internalFormat uint32, width int32, height int32)
RenderbufferStorage 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 { opengl.WindowEventDispatcher // contains filtered or unexported fields }
OpenGLWindow represents a native OpenGL surface.
func NewOpenGLWindow ¶
func NewOpenGLWindow(title string, framesPerSecond float64) (*OpenGLWindow, error)
NewOpenGLWindow tries to initialize the OpenGL environment and returns a new window instance.
func (OpenGLWindow) ClipboardString ¶ added in v0.2.0
func (window OpenGLWindow) ClipboardString() (string, error)
ClipboardString returns the current value of the clipboard, if it is compatible with UTF-8.
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 returns the OpenGL API.
func (OpenGLWindow) RestoreState ¶ added in v1.6.0
func (window OpenGLWindow) RestoreState(state opengl.WindowState)
RestoreState puts the window into the same state when StateSnapshot() was called.
func (OpenGLWindow) SetClipboardString ¶ added in v0.2.0
func (window OpenGLWindow) SetClipboardString(value string)
SetClipboardString sets the current value of the clipboard as UTF-8 string.
func (*OpenGLWindow) SetCloseRequest ¶
func (window *OpenGLWindow) SetCloseRequest(shouldClose bool)
SetCloseRequest sets the should-close property of the window.
func (*OpenGLWindow) SetCursorVisible ¶
func (window *OpenGLWindow) SetCursorVisible(visible bool)
SetCursorVisible toggles the visibility of the cursor.
func (*OpenGLWindow) SetFullScreen ¶
func (window *OpenGLWindow) SetFullScreen(on bool)
SetFullScreen toggles the windowed mode.
func (*OpenGLWindow) SetProjectModified ¶ added in v1.6.0
func (window *OpenGLWindow) SetProjectModified(modified bool)
SetProjectModified sets an indicator in the window frame that the project has not been saved.
func (*OpenGLWindow) SetTitleSuffix ¶ added in v1.7.0
func (window *OpenGLWindow) SetTitleSuffix(value string)
SetTitleSuffix appends a text to the current window title.
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 returns the dimension of the frame buffer of this window.
func (OpenGLWindow) StateSnapshot ¶ added in v1.6.0
func (window OpenGLWindow) StateSnapshot() opengl.WindowState
StateSnapshot returns the current state of the window.
func (*OpenGLWindow) Update ¶
func (window *OpenGLWindow) Update()
Update must be called from within the main thread as often as possible.