removed unnecessary blank identifier

This commit is contained in:
Thomas Friedel 2018-09-18 15:02:06 +02:00
parent 3d82ce6998
commit c30fb5f4d3
3 changed files with 177 additions and 177 deletions

View file

@ -16,7 +16,7 @@ type GLImpl struct{}
var _ canvas.GL = GLImpl{}
func (_ GLImpl) Ptr(data interface{}) unsafe.Pointer {
func (GLImpl) Ptr(data interface{}) unsafe.Pointer {
if data == nil {
return unsafe.Pointer(nil)
}
@ -43,40 +43,40 @@ func (_ GLImpl) Ptr(data interface{}) unsafe.Pointer {
}
return addr
}
func (_ GLImpl) ActiveTexture(texture uint32) {
func (GLImpl) ActiveTexture(texture uint32) {
C.glActiveTexture(C.uint(texture))
}
func (_ GLImpl) AttachShader(program uint32, shader uint32) {
func (GLImpl) AttachShader(program uint32, shader uint32) {
C.glAttachShader(C.uint(program), C.uint(shader))
}
func (_ GLImpl) BindBuffer(target uint32, buffer uint32) {
func (GLImpl) BindBuffer(target uint32, buffer uint32) {
C.glBindBuffer(C.uint(target), C.uint(buffer))
}
func (_ GLImpl) BindFramebuffer(target uint32, framebuffer uint32) {
func (GLImpl) BindFramebuffer(target uint32, framebuffer uint32) {
C.glBindFramebuffer(C.uint(target), C.uint(framebuffer))
}
func (_ GLImpl) BindRenderbuffer(target uint32, renderbuffer uint32) {
func (GLImpl) BindRenderbuffer(target uint32, renderbuffer uint32) {
C.glBindRenderbuffer(C.uint(target), C.uint(renderbuffer))
}
func (_ GLImpl) BindTexture(target uint32, texture uint32) {
func (GLImpl) BindTexture(target uint32, texture uint32) {
C.glBindTexture(C.uint(target), C.uint(texture))
}
func (_ GLImpl) BlendFunc(sfactor uint32, dfactor uint32) {
func (GLImpl) BlendFunc(sfactor uint32, dfactor uint32) {
C.glBlendFunc(C.uint(sfactor), C.uint(dfactor))
}
func (_ GLImpl) BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
func (GLImpl) BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
C.glBufferData(C.uint(target), C.long(size), data, C.uint(usage))
}
func (_ GLImpl) CheckFramebufferStatus(target uint32) uint32 {
func (GLImpl) CheckFramebufferStatus(target uint32) uint32 {
return uint32(C.glCheckFramebufferStatus(C.uint(target)))
}
func (_ GLImpl) Clear(mask uint32) {
func (GLImpl) Clear(mask uint32) {
C.glClear(C.uint(mask))
}
func (_ GLImpl) ClearColor(red float32, green float32, blue float32, alpha float32) {
func (GLImpl) ClearColor(red float32, green float32, blue float32, alpha float32) {
C.glClearColor(C.float(red), C.float(green), C.float(blue), C.float(alpha))
}
func (_ GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
func (GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
var r, g, b, a C.uchar
if red {
r = 1
@ -92,72 +92,72 @@ func (_ GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
}
C.glColorMask(r, g, b, a)
}
func (_ GLImpl) CompileShader(shader uint32) {
func (GLImpl) CompileShader(shader uint32) {
C.glCompileShader(C.uint(shader))
}
func (_ GLImpl) CreateProgram() uint32 {
func (GLImpl) CreateProgram() uint32 {
return uint32(C.glCreateProgram())
}
func (_ GLImpl) CreateShader(xtype uint32) uint32 {
func (GLImpl) CreateShader(xtype uint32) uint32 {
return uint32(C.glCreateShader(C.uint(xtype)))
}
func (_ GLImpl) DeleteShader(shader uint32) {
func (GLImpl) DeleteShader(shader uint32) {
C.glDeleteShader(C.uint(shader))
}
func (_ GLImpl) DeleteFramebuffers(n int32, framebuffers *uint32) {
func (GLImpl) DeleteFramebuffers(n int32, framebuffers *uint32) {
C.glDeleteFramebuffers(C.int(n), (*C.uint)(framebuffers))
}
func (_ GLImpl) DeleteRenderbuffers(n int32, renderbuffers *uint32) {
func (GLImpl) DeleteRenderbuffers(n int32, renderbuffers *uint32) {
C.glDeleteRenderbuffers(C.int(n), (*C.uint)(renderbuffers))
}
func (_ GLImpl) DeleteTextures(n int32, textures *uint32) {
func (GLImpl) DeleteTextures(n int32, textures *uint32) {
C.glDeleteTextures(C.int(n), (*C.uint)(textures))
}
func (_ GLImpl) Disable(cap uint32) {
func (GLImpl) Disable(cap uint32) {
C.glDisable(C.uint(cap))
}
func (_ GLImpl) DisableVertexAttribArray(index uint32) {
func (GLImpl) DisableVertexAttribArray(index uint32) {
C.glDisableVertexAttribArray(C.uint(index))
}
func (_ GLImpl) DrawArrays(mode uint32, first int32, count int32) {
func (GLImpl) DrawArrays(mode uint32, first int32, count int32) {
C.glDrawArrays(C.uint(mode), C.int(first), C.int(count))
}
func (_ GLImpl) Enable(cap uint32) {
func (GLImpl) Enable(cap uint32) {
C.glEnable(C.uint(cap))
}
func (_ GLImpl) EnableVertexAttribArray(index uint32) {
func (GLImpl) EnableVertexAttribArray(index uint32) {
C.glEnableVertexAttribArray(C.uint(index))
}
func (_ GLImpl) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
func (GLImpl) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
C.glFramebufferRenderbuffer(C.uint(target), C.uint(attachment), C.uint(renderbuffertarget), C.uint(renderbuffer))
}
func (_ GLImpl) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
func (GLImpl) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
C.glFramebufferTexture2D(C.uint(target), C.uint(attachment), C.GL_TEXTURE_2D, C.uint(texture), C.int(level))
}
func (_ GLImpl) GenBuffers(n int32, buffers *uint32) {
func (GLImpl) GenBuffers(n int32, buffers *uint32) {
C.glGenBuffers(C.int(n), (*C.uint)(buffers))
}
func (_ GLImpl) GenFramebuffers(n int32, framebuffers *uint32) {
func (GLImpl) GenFramebuffers(n int32, framebuffers *uint32) {
C.glGenFramebuffers(C.int(n), (*C.uint)(framebuffers))
}
func (_ GLImpl) GenRenderbuffers(n int32, renderbuffers *uint32) {
func (GLImpl) GenRenderbuffers(n int32, renderbuffers *uint32) {
C.glGenRenderbuffers(C.int(n), (*C.uint)(renderbuffers))
}
func (_ GLImpl) GenTextures(n int32, textures *uint32) {
func (GLImpl) GenTextures(n int32, textures *uint32) {
C.glGenTextures(C.int(n), (*C.uint)(textures))
}
func (_ GLImpl) GenerateMipmap(target uint32) {
func (GLImpl) GenerateMipmap(target uint32) {
C.glGenerateMipmap(C.uint(target))
}
func (_ GLImpl) GetAttribLocation(program uint32, name string) int32 {
func (GLImpl) GetAttribLocation(program uint32, name string) int32 {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
return int32(C.glGetAttribLocation(C.uint(program), cname))
}
func (_ GLImpl) GetError() uint32 {
func (GLImpl) GetError() uint32 {
return uint32(C.glGetError())
}
func (_ GLImpl) GetProgramInfoLog(program uint32) string {
func (GLImpl) GetProgramInfoLog(program uint32) string {
var length C.int
C.glGetProgramiv(C.uint(program), C.GL_INFO_LOG_LENGTH, &length)
if length == 0 {
@ -168,10 +168,10 @@ func (_ GLImpl) GetProgramInfoLog(program uint32) string {
C.glGetProgramInfoLog(C.uint(program), C.int(length), nil, (*C.char)(clog))
return string(C.GoBytes(clog, length))
}
func (_ GLImpl) GetProgramiv(program uint32, pname uint32, params *int32) {
func (GLImpl) GetProgramiv(program uint32, pname uint32, params *int32) {
C.glGetProgramiv(C.uint(program), C.uint(pname), (*C.int)(params))
}
func (_ GLImpl) GetShaderInfoLog(program uint32) string {
func (GLImpl) GetShaderInfoLog(program uint32) string {
var length C.int
C.glGetShaderiv(C.uint(program), C.GL_INFO_LOG_LENGTH, &length)
if length == 0 {
@ -182,82 +182,82 @@ func (_ GLImpl) GetShaderInfoLog(program uint32) string {
C.glGetShaderInfoLog(C.uint(program), C.int(length), nil, (*C.char)(clog))
return string(C.GoBytes(clog, length))
}
func (_ GLImpl) GetShaderiv(shader uint32, pname uint32, params *int32) {
func (GLImpl) GetShaderiv(shader uint32, pname uint32, params *int32) {
C.glGetShaderiv(C.uint(shader), C.uint(pname), (*C.int)(params))
}
func (_ GLImpl) GetUniformLocation(program uint32, name string) int32 {
func (GLImpl) GetUniformLocation(program uint32, name string) int32 {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
return int32(C.glGetUniformLocation(C.uint(program), cname))
}
func (_ GLImpl) LinkProgram(program uint32) {
func (GLImpl) LinkProgram(program uint32) {
C.glLinkProgram(C.uint(program))
}
func (_ GLImpl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
C.glReadPixels(C.int(x), C.int(y), C.int(width), C.int(height), C.uint(format), C.uint(xtype), pixels)
}
func (_ GLImpl) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
func (GLImpl) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
C.glRenderbufferStorage(C.uint(target), C.uint(internalformat), C.int(width), C.int(height))
}
func (_ GLImpl) Scissor(x int32, y int32, width int32, height int32) {
func (GLImpl) Scissor(x int32, y int32, width int32, height int32) {
C.glScissor(C.int(x), C.int(y), C.int(width), C.int(height))
}
func (_ GLImpl) ShaderSource(shader uint32, source string) {
func (GLImpl) ShaderSource(shader uint32, source string) {
csource := C.CString(source)
defer C.free(unsafe.Pointer(csource))
C.glShaderSource(C.uint(shader), 1, &csource, nil)
}
func (_ GLImpl) StencilFunc(xfunc uint32, ref int32, mask uint32) {
func (GLImpl) StencilFunc(xfunc uint32, ref int32, mask uint32) {
C.glStencilFunc(C.uint(xfunc), C.int(ref), C.uint(mask))
}
func (_ GLImpl) StencilMask(mask uint32) {
func (GLImpl) StencilMask(mask uint32) {
C.glStencilMask(C.uint(mask))
}
func (_ GLImpl) StencilOp(fail uint32, zfail uint32, zpass uint32) {
func (GLImpl) StencilOp(fail uint32, zfail uint32, zpass uint32) {
C.glStencilOp(C.uint(fail), C.uint(zfail), C.uint(zpass))
}
func (_ GLImpl) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
C.glTexImage2D(C.uint(target), C.int(level), C.int(internalformat), C.int(width), C.int(height), C.int(border), C.uint(format), C.uint(xtype), pixels)
}
func (_ GLImpl) TexParameteri(target uint32, pname uint32, param int32) {
func (GLImpl) TexParameteri(target uint32, pname uint32, param int32) {
C.glTexParameteri(C.uint(target), C.uint(pname), C.int(param))
}
func (_ GLImpl) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
C.glTexSubImage2D(C.uint(target), C.int(level), C.int(xoffset), C.int(yoffset), C.int(width), C.int(height), C.uint(format), C.uint(xtype), pixels)
}
func (_ GLImpl) Uniform1f(location int32, v0 float32) {
func (GLImpl) Uniform1f(location int32, v0 float32) {
C.glUniform1f(C.int(location), C.float(v0))
}
func (_ GLImpl) Uniform1fv(location int32, count int32, v *float32) {
func (GLImpl) Uniform1fv(location int32, count int32, v *float32) {
C.glUniform1fv(C.int(location), C.int(count), (*C.float)(v))
}
func (_ GLImpl) Uniform1i(location int32, v0 int32) {
func (GLImpl) Uniform1i(location int32, v0 int32) {
C.glUniform1i(C.int(location), C.int(v0))
}
func (_ GLImpl) Uniform2f(location int32, v0 float32, v1 float32) {
func (GLImpl) Uniform2f(location int32, v0 float32, v1 float32) {
C.glUniform2f(C.int(location), C.float(v0), C.float(v1))
}
func (_ GLImpl) Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
func (GLImpl) Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
C.glUniform4f(C.int(location), C.float(v0), C.float(v1), C.float(v2), C.float(v3))
}
func (_ GLImpl) UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
func (GLImpl) UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
var t C.uchar
if transpose {
t = 1
}
C.glUniformMatrix3fv(C.int(location), C.int(count), t, (*C.float)(value))
}
func (_ GLImpl) UseProgram(program uint32) {
func (GLImpl) UseProgram(program uint32) {
C.glUseProgram(C.uint(program))
}
func (_ GLImpl) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {
func (GLImpl) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {
var n C.uchar
if normalized {
n = 1
}
C.glVertexAttribPointer(C.uint(index), C.int(size), C.uint(xtype), n, C.int(stride), unsafe.Pointer(uintptr(offset)))
}
func (_ GLImpl) Viewport(x int32, y int32, width int32, height int32) {
func (GLImpl) Viewport(x int32, y int32, width int32, height int32) {
C.glViewport(C.int(x), C.int(y), C.int(width), C.int(height))
}

View file

@ -12,109 +12,109 @@ type GLImpl struct{}
var _ canvas.GL = GLImpl{}
func (_ GLImpl) Ptr(data interface{}) unsafe.Pointer {
func (GLImpl) Ptr(data interface{}) unsafe.Pointer {
return gl.Ptr(data)
}
func (_ GLImpl) ActiveTexture(texture uint32) {
func (GLImpl) ActiveTexture(texture uint32) {
gl.ActiveTexture(texture)
}
func (_ GLImpl) AttachShader(program uint32, shader uint32) {
func (GLImpl) AttachShader(program uint32, shader uint32) {
gl.AttachShader(program, shader)
}
func (_ GLImpl) BindBuffer(target uint32, buffer uint32) {
func (GLImpl) BindBuffer(target uint32, buffer uint32) {
gl.BindBuffer(target, buffer)
}
func (_ GLImpl) BindFramebuffer(target uint32, framebuffer uint32) {
func (GLImpl) BindFramebuffer(target uint32, framebuffer uint32) {
gl.BindFramebuffer(target, framebuffer)
}
func (_ GLImpl) BindRenderbuffer(target uint32, renderbuffer uint32) {
func (GLImpl) BindRenderbuffer(target uint32, renderbuffer uint32) {
gl.BindRenderbuffer(target, renderbuffer)
}
func (_ GLImpl) BindTexture(target uint32, texture uint32) {
func (GLImpl) BindTexture(target uint32, texture uint32) {
gl.BindTexture(target, texture)
}
func (_ GLImpl) BlendFunc(sfactor uint32, dfactor uint32) {
func (GLImpl) BlendFunc(sfactor uint32, dfactor uint32) {
gl.BlendFunc(sfactor, dfactor)
}
func (_ GLImpl) BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
func (GLImpl) BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
gl.BufferData(target, size, data, usage)
}
func (_ GLImpl) CheckFramebufferStatus(target uint32) uint32 {
func (GLImpl) CheckFramebufferStatus(target uint32) uint32 {
return gl.CheckFramebufferStatus(target)
}
func (_ GLImpl) Clear(mask uint32) {
func (GLImpl) Clear(mask uint32) {
gl.Clear(mask)
}
func (_ GLImpl) ClearColor(red float32, green float32, blue float32, alpha float32) {
func (GLImpl) ClearColor(red float32, green float32, blue float32, alpha float32) {
gl.ClearColor(red, green, blue, alpha)
}
func (_ GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
func (GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
gl.ColorMask(red, green, blue, alpha)
}
func (_ GLImpl) CompileShader(shader uint32) {
func (GLImpl) CompileShader(shader uint32) {
gl.CompileShader(shader)
}
func (_ GLImpl) CreateProgram() uint32 {
func (GLImpl) CreateProgram() uint32 {
return gl.CreateProgram()
}
func (_ GLImpl) CreateShader(xtype uint32) uint32 {
func (GLImpl) CreateShader(xtype uint32) uint32 {
return gl.CreateShader(xtype)
}
func (_ GLImpl) DeleteShader(shader uint32) {
func (GLImpl) DeleteShader(shader uint32) {
gl.DeleteShader(shader)
}
func (_ GLImpl) DeleteFramebuffers(n int32, framebuffers *uint32) {
func (GLImpl) DeleteFramebuffers(n int32, framebuffers *uint32) {
gl.DeleteFramebuffers(n, framebuffers)
}
func (_ GLImpl) DeleteRenderbuffers(n int32, renderbuffers *uint32) {
func (GLImpl) DeleteRenderbuffers(n int32, renderbuffers *uint32) {
gl.DeleteRenderbuffers(n, renderbuffers)
}
func (_ GLImpl) DeleteTextures(n int32, textures *uint32) {
func (GLImpl) DeleteTextures(n int32, textures *uint32) {
gl.DeleteTextures(n, textures)
}
func (_ GLImpl) Disable(cap uint32) {
func (GLImpl) Disable(cap uint32) {
gl.Disable(cap)
}
func (_ GLImpl) DisableVertexAttribArray(index uint32) {
func (GLImpl) DisableVertexAttribArray(index uint32) {
gl.DisableVertexAttribArray(index)
}
func (_ GLImpl) DrawArrays(mode uint32, first int32, count int32) {
func (GLImpl) DrawArrays(mode uint32, first int32, count int32) {
gl.DrawArrays(mode, first, count)
}
func (_ GLImpl) Enable(cap uint32) {
func (GLImpl) Enable(cap uint32) {
gl.Enable(cap)
}
func (_ GLImpl) EnableVertexAttribArray(index uint32) {
func (GLImpl) EnableVertexAttribArray(index uint32) {
gl.EnableVertexAttribArray(index)
}
func (_ GLImpl) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
func (GLImpl) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
gl.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer)
}
func (_ GLImpl) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
func (GLImpl) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
gl.FramebufferTexture(target, attachment, texture, level)
}
func (_ GLImpl) GenBuffers(n int32, buffers *uint32) {
func (GLImpl) GenBuffers(n int32, buffers *uint32) {
gl.GenBuffers(n, buffers)
}
func (_ GLImpl) GenFramebuffers(n int32, framebuffers *uint32) {
func (GLImpl) GenFramebuffers(n int32, framebuffers *uint32) {
gl.GenFramebuffers(n, framebuffers)
}
func (_ GLImpl) GenRenderbuffers(n int32, renderbuffers *uint32) {
func (GLImpl) GenRenderbuffers(n int32, renderbuffers *uint32) {
gl.GenRenderbuffers(n, renderbuffers)
}
func (_ GLImpl) GenTextures(n int32, textures *uint32) {
func (GLImpl) GenTextures(n int32, textures *uint32) {
gl.GenTextures(n, textures)
}
func (_ GLImpl) GenerateMipmap(target uint32) {
func (GLImpl) GenerateMipmap(target uint32) {
gl.GenerateMipmap(target)
}
func (_ GLImpl) GetAttribLocation(program uint32, name string) int32 {
func (GLImpl) GetAttribLocation(program uint32, name string) int32 {
return gl.GetAttribLocation(program, gl.Str(name+"\x00"))
}
func (_ GLImpl) GetError() uint32 {
func (GLImpl) GetError() uint32 {
return gl.GetError()
}
func (_ GLImpl) GetProgramInfoLog(program uint32) string {
func (GLImpl) GetProgramInfoLog(program uint32) string {
var length int32
gl.GetProgramiv(program, gl.INFO_LOG_LENGTH, &length)
if length == 0 {
@ -124,10 +124,10 @@ func (_ GLImpl) GetProgramInfoLog(program uint32) string {
gl.GetProgramInfoLog(program, length, nil, gl.Str(log))
return log
}
func (_ GLImpl) GetProgramiv(program uint32, pname uint32, params *int32) {
func (GLImpl) GetProgramiv(program uint32, pname uint32, params *int32) {
gl.GetProgramiv(program, pname, params)
}
func (_ GLImpl) GetShaderInfoLog(program uint32) string {
func (GLImpl) GetShaderInfoLog(program uint32) string {
var length int32
gl.GetShaderiv(program, gl.INFO_LOG_LENGTH, &length)
if length == 0 {
@ -137,71 +137,71 @@ func (_ GLImpl) GetShaderInfoLog(program uint32) string {
gl.GetShaderInfoLog(program, length, nil, gl.Str(log))
return log
}
func (_ GLImpl) GetShaderiv(shader uint32, pname uint32, params *int32) {
func (GLImpl) GetShaderiv(shader uint32, pname uint32, params *int32) {
gl.GetShaderiv(shader, pname, params)
}
func (_ GLImpl) GetUniformLocation(program uint32, name string) int32 {
func (GLImpl) GetUniformLocation(program uint32, name string) int32 {
return gl.GetUniformLocation(program, gl.Str(name+"\x00"))
}
func (_ GLImpl) LinkProgram(program uint32) {
func (GLImpl) LinkProgram(program uint32) {
gl.LinkProgram(program)
}
func (_ GLImpl) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
func (GLImpl) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
gl.RenderbufferStorage(target, internalformat, width, height)
}
func (_ GLImpl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
gl.ReadPixels(x, y, width, height, format, xtype, pixels)
}
func (_ GLImpl) Scissor(x int32, y int32, width int32, height int32) {
func (GLImpl) Scissor(x int32, y int32, width int32, height int32) {
gl.Scissor(x, y, width, height)
}
func (_ GLImpl) ShaderSource(shader uint32, source string) {
func (GLImpl) ShaderSource(shader uint32, source string) {
csource, freeFunc := gl.Strs(source + "\x00")
gl.ShaderSource(shader, 1, csource, nil)
freeFunc()
}
func (_ GLImpl) StencilFunc(xfunc uint32, ref int32, mask uint32) {
func (GLImpl) StencilFunc(xfunc uint32, ref int32, mask uint32) {
gl.StencilFunc(xfunc, ref, mask)
}
func (_ GLImpl) StencilMask(mask uint32) {
func (GLImpl) StencilMask(mask uint32) {
gl.StencilMask(mask)
}
func (_ GLImpl) StencilOp(fail uint32, zfail uint32, zpass uint32) {
func (GLImpl) StencilOp(fail uint32, zfail uint32, zpass uint32) {
gl.StencilOp(fail, zfail, zpass)
}
func (_ GLImpl) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
gl.TexImage2D(target, level, internalformat, width, height, border, format, xtype, pixels)
}
func (_ GLImpl) TexParameteri(target uint32, pname uint32, param int32) {
func (GLImpl) TexParameteri(target uint32, pname uint32, param int32) {
gl.TexParameteri(target, pname, param)
}
func (_ GLImpl) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
gl.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, xtype, pixels)
}
func (_ GLImpl) Uniform1f(location int32, v0 float32) {
func (GLImpl) Uniform1f(location int32, v0 float32) {
gl.Uniform1f(location, v0)
}
func (_ GLImpl) Uniform1fv(location int32, count int32, v *float32) {
func (GLImpl) Uniform1fv(location int32, count int32, v *float32) {
gl.Uniform1fv(location, count, v)
}
func (_ GLImpl) Uniform1i(location int32, v0 int32) {
func (GLImpl) Uniform1i(location int32, v0 int32) {
gl.Uniform1i(location, v0)
}
func (_ GLImpl) Uniform2f(location int32, v0 float32, v1 float32) {
func (GLImpl) Uniform2f(location int32, v0 float32, v1 float32) {
gl.Uniform2f(location, v0, v1)
}
func (_ GLImpl) Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
func (GLImpl) Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
gl.Uniform4f(location, v0, v1, v2, v3)
}
func (_ GLImpl) UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
func (GLImpl) UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
gl.UniformMatrix3fv(location, count, transpose, value)
}
func (_ GLImpl) UseProgram(program uint32) {
func (GLImpl) UseProgram(program uint32) {
gl.UseProgram(program)
}
func (_ GLImpl) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {
func (GLImpl) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {
gl.VertexAttribPointer(index, size, xtype, normalized, stride, gl.PtrOffset(int(offset)))
}
func (_ GLImpl) Viewport(x int32, y int32, width int32, height int32) {
func (GLImpl) Viewport(x int32, y int32, width int32, height int32) {
gl.Viewport(x, y, width, height)
}

View file

@ -16,7 +16,7 @@ type GLImpl struct{}
var _ canvas.GL = GLImpl{}
func (_ GLImpl) Ptr(data interface{}) unsafe.Pointer {
func (GLImpl) Ptr(data interface{}) unsafe.Pointer {
if data == nil {
return unsafe.Pointer(nil)
}
@ -43,40 +43,40 @@ func (_ GLImpl) Ptr(data interface{}) unsafe.Pointer {
}
return addr
}
func (_ GLImpl) ActiveTexture(texture uint32) {
func (GLImpl) ActiveTexture(texture uint32) {
C.glActiveTexture(C.GLenum(texture))
}
func (_ GLImpl) AttachShader(program uint32, shader uint32) {
func (GLImpl) AttachShader(program uint32, shader uint32) {
C.glAttachShader(C.GLuint(program), C.GLuint(shader))
}
func (_ GLImpl) BindBuffer(target uint32, buffer uint32) {
func (GLImpl) BindBuffer(target uint32, buffer uint32) {
C.glBindBuffer(C.GLenum(target), C.GLuint(buffer))
}
func (_ GLImpl) BindFramebuffer(target uint32, framebuffer uint32) {
func (GLImpl) BindFramebuffer(target uint32, framebuffer uint32) {
C.glBindFramebuffer(C.GLenum(target), C.GLuint(framebuffer))
}
func (_ GLImpl) BindRenderbuffer(target uint32, renderbuffer uint32) {
func (GLImpl) BindRenderbuffer(target uint32, renderbuffer uint32) {
C.glBindRenderbuffer(C.GLenum(target), C.GLuint(renderbuffer))
}
func (_ GLImpl) BindTexture(target uint32, texture uint32) {
func (GLImpl) BindTexture(target uint32, texture uint32) {
C.glBindTexture(C.GLenum(target), C.GLuint(texture))
}
func (_ GLImpl) BlendFunc(sfactor uint32, dfactor uint32) {
func (GLImpl) BlendFunc(sfactor uint32, dfactor uint32) {
C.glBlendFunc(C.GLenum(sfactor), C.GLenum(dfactor))
}
func (_ GLImpl) BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
func (GLImpl) BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
C.glBufferData(C.GLenum(target), C.GLsizeiptr(size), data, C.GLenum(usage))
}
func (_ GLImpl) CheckFramebufferStatus(target uint32) uint32 {
func (GLImpl) CheckFramebufferStatus(target uint32) uint32 {
return uint32(C.glCheckFramebufferStatus(C.GLenum(target)))
}
func (_ GLImpl) Clear(mask uint32) {
func (GLImpl) Clear(mask uint32) {
C.glClear(C.GLbitfield(mask))
}
func (_ GLImpl) ClearColor(red float32, green float32, blue float32, alpha float32) {
func (GLImpl) ClearColor(red float32, green float32, blue float32, alpha float32) {
C.glClearColor(C.GLfloat(red), C.GLfloat(green), C.GLfloat(blue), C.GLfloat(alpha))
}
func (_ GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
func (GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
var r, g, b, a C.GLboolean
if red {
r = 1
@ -92,72 +92,72 @@ func (_ GLImpl) ColorMask(red bool, green bool, blue bool, alpha bool) {
}
C.glColorMask(r, g, b, a)
}
func (_ GLImpl) CompileShader(shader uint32) {
func (GLImpl) CompileShader(shader uint32) {
C.glCompileShader(C.GLuint(shader))
}
func (_ GLImpl) CreateProgram() uint32 {
func (GLImpl) CreateProgram() uint32 {
return uint32(C.glCreateProgram())
}
func (_ GLImpl) CreateShader(xtype uint32) uint32 {
func (GLImpl) CreateShader(xtype uint32) uint32 {
return uint32(C.glCreateShader(C.GLenum(xtype)))
}
func (_ GLImpl) DeleteShader(shader uint32) {
func (GLImpl) DeleteShader(shader uint32) {
C.glDeleteShader(C.GLuint(shader))
}
func (_ GLImpl) DeleteFramebuffers(n int32, framebuffers *uint32) {
func (GLImpl) DeleteFramebuffers(n int32, framebuffers *uint32) {
C.glDeleteFramebuffers(C.GLsizei(n), (*C.GLuint)(framebuffers))
}
func (_ GLImpl) DeleteRenderbuffers(n int32, renderbuffers *uint32) {
func (GLImpl) DeleteRenderbuffers(n int32, renderbuffers *uint32) {
C.glDeleteRenderbuffers(C.GLsizei(n), (*C.GLuint)(renderbuffers))
}
func (_ GLImpl) DeleteTextures(n int32, textures *uint32) {
func (GLImpl) DeleteTextures(n int32, textures *uint32) {
C.glDeleteTextures(C.GLsizei(n), (*C.GLuint)(textures))
}
func (_ GLImpl) Disable(cap uint32) {
func (GLImpl) Disable(cap uint32) {
C.glDisable(C.GLenum(cap))
}
func (_ GLImpl) DisableVertexAttribArray(index uint32) {
func (GLImpl) DisableVertexAttribArray(index uint32) {
C.glDisableVertexAttribArray(C.GLuint(index))
}
func (_ GLImpl) DrawArrays(mode uint32, first int32, count int32) {
func (GLImpl) DrawArrays(mode uint32, first int32, count int32) {
C.glDrawArrays(C.GLenum(mode), C.GLint(first), C.GLsizei(count))
}
func (_ GLImpl) Enable(cap uint32) {
func (GLImpl) Enable(cap uint32) {
C.glEnable(C.GLenum(cap))
}
func (_ GLImpl) EnableVertexAttribArray(index uint32) {
func (GLImpl) EnableVertexAttribArray(index uint32) {
C.glEnableVertexAttribArray(C.GLuint(index))
}
func (_ GLImpl) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
func (GLImpl) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
C.glFramebufferRenderbuffer(C.GLenum(target), C.GLenum(attachment), C.GLenum(renderbuffertarget), C.GLuint(renderbuffer))
}
func (_ GLImpl) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
func (GLImpl) FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
C.glFramebufferTexture2D(C.GLenum(target), C.GLenum(attachment), C.GL_TEXTURE_2D, C.GLuint(texture), C.GLint(level))
}
func (_ GLImpl) GenBuffers(n int32, buffers *uint32) {
func (GLImpl) GenBuffers(n int32, buffers *uint32) {
C.glGenBuffers(C.GLsizei(n), (*C.GLuint)(buffers))
}
func (_ GLImpl) GenFramebuffers(n int32, framebuffers *uint32) {
func (GLImpl) GenFramebuffers(n int32, framebuffers *uint32) {
C.glGenFramebuffers(C.GLsizei(n), (*C.GLuint)(framebuffers))
}
func (_ GLImpl) GenRenderbuffers(n int32, renderbuffers *uint32) {
func (GLImpl) GenRenderbuffers(n int32, renderbuffers *uint32) {
C.glGenRenderbuffers(C.GLsizei(n), (*C.GLuint)(renderbuffers))
}
func (_ GLImpl) GenTextures(n int32, textures *uint32) {
func (GLImpl) GenTextures(n int32, textures *uint32) {
C.glGenTextures(C.GLsizei(n), (*C.GLuint)(textures))
}
func (_ GLImpl) GenerateMipmap(target uint32) {
func (GLImpl) GenerateMipmap(target uint32) {
C.glGenerateMipmap(C.GLenum(target))
}
func (_ GLImpl) GetAttribLocation(program uint32, name string) int32 {
func (GLImpl) GetAttribLocation(program uint32, name string) int32 {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
return int32(C.glGetAttribLocation(C.GLuint(program), (*C.GLchar)(cname)))
}
func (_ GLImpl) GetError() uint32 {
func (GLImpl) GetError() uint32 {
return uint32(C.glGetError())
}
func (_ GLImpl) GetProgramInfoLog(program uint32) string {
func (GLImpl) GetProgramInfoLog(program uint32) string {
var length C.GLint
C.glGetProgramiv(C.GLuint(program), C.GL_INFO_LOG_LENGTH, &length)
if length == 0 {
@ -168,10 +168,10 @@ func (_ GLImpl) GetProgramInfoLog(program uint32) string {
C.glGetProgramInfoLog(C.GLuint(program), C.GLsizei(length), nil, (*C.GLchar)(clog))
return string(C.GoBytes(clog, C.int(length)))
}
func (_ GLImpl) GetProgramiv(program uint32, pname uint32, params *int32) {
func (GLImpl) GetProgramiv(program uint32, pname uint32, params *int32) {
C.glGetProgramiv(C.GLuint(program), C.GLenum(pname), (*C.GLint)(params))
}
func (_ GLImpl) GetShaderInfoLog(program uint32) string {
func (GLImpl) GetShaderInfoLog(program uint32) string {
var length C.GLint
C.glGetShaderiv(C.GLuint(program), C.GL_INFO_LOG_LENGTH, &length)
if length == 0 {
@ -182,82 +182,82 @@ func (_ GLImpl) GetShaderInfoLog(program uint32) string {
C.glGetShaderInfoLog(C.GLuint(program), C.GLsizei(length), nil, (*C.GLchar)(clog))
return string(C.GoBytes(clog, C.int(length)))
}
func (_ GLImpl) GetShaderiv(shader uint32, pname uint32, params *int32) {
func (GLImpl) GetShaderiv(shader uint32, pname uint32, params *int32) {
C.glGetShaderiv(C.GLuint(shader), C.GLenum(pname), (*C.GLint)(params))
}
func (_ GLImpl) GetUniformLocation(program uint32, name string) int32 {
func (GLImpl) GetUniformLocation(program uint32, name string) int32 {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
return int32(C.glGetUniformLocation(C.GLuint(program), (*C.GLchar)(cname)))
}
func (_ GLImpl) LinkProgram(program uint32) {
func (GLImpl) LinkProgram(program uint32) {
C.glLinkProgram(C.GLuint(program))
}
func (_ GLImpl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
C.glReadPixels(C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height), C.GLenum(format), C.GLenum(xtype), pixels)
}
func (_ GLImpl) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
func (GLImpl) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
C.glRenderbufferStorage(C.GLenum(target), C.GLenum(internalformat), C.GLint(width), C.GLint(height))
}
func (_ GLImpl) Scissor(x int32, y int32, width int32, height int32) {
func (GLImpl) Scissor(x int32, y int32, width int32, height int32) {
C.glScissor(C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
}
func (_ GLImpl) ShaderSource(shader uint32, source string) {
func (GLImpl) ShaderSource(shader uint32, source string) {
csource := (*C.GLchar)(C.CString(source))
defer C.free(unsafe.Pointer(csource))
C.glShaderSource(C.GLuint(shader), 1, &csource, nil)
}
func (_ GLImpl) StencilFunc(xfunc uint32, ref int32, mask uint32) {
func (GLImpl) StencilFunc(xfunc uint32, ref int32, mask uint32) {
C.glStencilFunc(C.GLenum(xfunc), C.GLint(ref), C.GLuint(mask))
}
func (_ GLImpl) StencilMask(mask uint32) {
func (GLImpl) StencilMask(mask uint32) {
C.glStencilMask(C.GLuint(mask))
}
func (_ GLImpl) StencilOp(fail uint32, zfail uint32, zpass uint32) {
func (GLImpl) StencilOp(fail uint32, zfail uint32, zpass uint32) {
C.glStencilOp(C.GLenum(fail), C.GLenum(zfail), C.GLenum(zpass))
}
func (_ GLImpl) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
C.glTexImage2D(C.GLenum(target), C.GLint(level), C.GLint(internalformat), C.GLsizei(width), C.GLsizei(height), C.GLint(border), C.GLenum(format), C.GLenum(xtype), pixels)
}
func (_ GLImpl) TexParameteri(target uint32, pname uint32, param int32) {
func (GLImpl) TexParameteri(target uint32, pname uint32, param int32) {
C.glTexParameteri(C.GLenum(target), C.GLenum(pname), C.GLint(param))
}
func (_ GLImpl) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
func (GLImpl) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
C.glTexSubImage2D(C.GLenum(target), C.GLint(level), C.GLint(xoffset), C.GLint(yoffset), C.GLsizei(width), C.GLsizei(height), C.GLenum(format), C.GLenum(xtype), pixels)
}
func (_ GLImpl) Uniform1f(location int32, v0 float32) {
func (GLImpl) Uniform1f(location int32, v0 float32) {
C.glUniform1f(C.GLint(location), C.GLfloat(v0))
}
func (_ GLImpl) Uniform1fv(location int32, count int32, v *float32) {
func (GLImpl) Uniform1fv(location int32, count int32, v *float32) {
C.glUniform1fv(C.GLint(location), C.GLsizei(count), (*C.GLfloat)(v))
}
func (_ GLImpl) Uniform1i(location int32, v0 int32) {
func (GLImpl) Uniform1i(location int32, v0 int32) {
C.glUniform1i(C.GLint(location), C.GLint(v0))
}
func (_ GLImpl) Uniform2f(location int32, v0 float32, v1 float32) {
func (GLImpl) Uniform2f(location int32, v0 float32, v1 float32) {
C.glUniform2f(C.GLint(location), C.GLfloat(v0), C.GLfloat(v1))
}
func (_ GLImpl) Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
func (GLImpl) Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
C.glUniform4f(C.GLint(location), C.GLfloat(v0), C.GLfloat(v1), C.GLfloat(v2), C.GLfloat(v3))
}
func (_ GLImpl) UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
func (GLImpl) UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
var t C.GLboolean
if transpose {
t = 1
}
C.glUniformMatrix3fv(C.GLint(location), C.GLsizei(count), t, (*C.GLfloat)(value))
}
func (_ GLImpl) UseProgram(program uint32) {
func (GLImpl) UseProgram(program uint32) {
C.glUseProgram(C.GLuint(program))
}
func (_ GLImpl) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {
func (GLImpl) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uint32) {
var n C.GLboolean
if normalized {
n = 1
}
C.glVertexAttribPointer(C.GLuint(index), C.GLint(size), C.GLenum(xtype), n, C.GLsizei(stride), unsafe.Pointer(uintptr(offset)))
}
func (_ GLImpl) Viewport(x int32, y int32, width int32, height int32) {
func (GLImpl) Viewport(x int32, y int32, width int32, height int32) {
C.glViewport(C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
}