From 66aa23be9bf3be6e5dd99389d61fa18d1f4a8b41 Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Tue, 7 Sep 2021 13:25:20 +0200 Subject: [PATCH] internal/driver/mobile: tidy unused gl functions --- internal/driver/mobile/gl/fn.go | 100 -- internal/driver/mobile/gl/gl.go | 1364 ++--------------- internal/driver/mobile/gl/interface.go | 594 +------ .../mobile/gl/{types_prod.go => types.go} | 12 +- internal/driver/mobile/gl/work.c | 325 +--- internal/driver/mobile/gl/work.h | 101 -- internal/driver/mobile/gl/work_windows.go | 588 +------ 7 files changed, 140 insertions(+), 2944 deletions(-) rename internal/driver/mobile/gl/{types_prod.go => types.go} (85%) diff --git a/internal/driver/mobile/gl/fn.go b/internal/driver/mobile/gl/fn.go index 5606e4bbd8..8025024cee 100644 --- a/internal/driver/mobile/gl/fn.go +++ b/internal/driver/mobile/gl/fn.go @@ -33,144 +33,44 @@ const ( glfnUNDEFINED glfn = iota glfnActiveTexture glfnAttachShader - glfnBindAttribLocation glfnBindBuffer - glfnBindFramebuffer - glfnBindRenderbuffer glfnBindTexture glfnBindVertexArray glfnBlendColor - glfnBlendEquation - glfnBlendEquationSeparate glfnBlendFunc - glfnBlendFuncSeparate glfnBufferData - glfnBufferSubData - glfnCheckFramebufferStatus glfnClear glfnClearColor - glfnClearDepthf - glfnClearStencil - glfnColorMask glfnCompileShader - glfnCompressedTexImage2D - glfnCompressedTexSubImage2D - glfnCopyTexImage2D - glfnCopyTexSubImage2D glfnCreateProgram glfnCreateShader - glfnCullFace glfnDeleteBuffer - glfnDeleteFramebuffer - glfnDeleteProgram - glfnDeleteRenderbuffer - glfnDeleteShader glfnDeleteTexture - glfnDepthFunc - glfnDepthRangef - glfnDepthMask - glfnDetachShader glfnDisable - glfnDisableVertexAttribArray glfnDrawArrays - glfnDrawElements glfnEnable glfnEnableVertexAttribArray - glfnFinish glfnFlush - glfnFramebufferRenderbuffer - glfnFramebufferTexture2D - glfnFrontFace glfnGenBuffer - glfnGenFramebuffer - glfnGenRenderbuffer glfnGenTexture glfnGenVertexArray - glfnGenerateMipmap - glfnGetActiveAttrib - glfnGetActiveUniform - glfnGetAttachedShaders glfnGetAttribLocation - glfnGetBooleanv - glfnGetBufferParameteri glfnGetError - glfnGetFloatv - glfnGetFramebufferAttachmentParameteriv - glfnGetIntegerv - glfnGetProgramInfoLog - glfnGetProgramiv - glfnGetRenderbufferParameteriv glfnGetShaderInfoLog - glfnGetShaderPrecisionFormat glfnGetShaderSource glfnGetShaderiv - glfnGetString - glfnGetTexParameterfv glfnGetTexParameteriv glfnGetUniformLocation - glfnGetUniformfv - glfnGetUniformiv - glfnGetVertexAttribfv - glfnGetVertexAttribiv - glfnHint - glfnIsBuffer - glfnIsEnabled - glfnIsFramebuffer - glfnIsProgram - glfnIsRenderbuffer - glfnIsShader - glfnIsTexture - glfnLineWidth glfnLinkProgram - glfnPixelStorei - glfnPolygonOffset glfnReadPixels - glfnReleaseShaderCompiler - glfnRenderbufferStorage - glfnSampleCoverage glfnScissor glfnShaderSource - glfnStencilFunc - glfnStencilFuncSeparate - glfnStencilMask - glfnStencilMaskSeparate - glfnStencilOp - glfnStencilOpSeparate glfnTexImage2D - glfnTexParameterf - glfnTexParameterfv glfnTexParameteri - glfnTexParameteriv - glfnTexSubImage2D glfnUniform1f - glfnUniform1fv - glfnUniform1i - glfnUniform1iv - glfnUniform2f - glfnUniform2fv - glfnUniform2i - glfnUniform2iv - glfnUniform3f - glfnUniform3fv - glfnUniform3i - glfnUniform3iv glfnUniform4f glfnUniform4fv - glfnUniform4i - glfnUniform4iv - glfnUniformMatrix2fv - glfnUniformMatrix3fv - glfnUniformMatrix4fv glfnUseProgram - glfnValidateProgram - glfnVertexAttrib1f - glfnVertexAttrib1fv - glfnVertexAttrib2f - glfnVertexAttrib2fv - glfnVertexAttrib3f - glfnVertexAttrib3fv - glfnVertexAttrib4f - glfnVertexAttrib4fv glfnVertexAttribPointer glfnViewport ) diff --git a/internal/driver/mobile/gl/gl.go b/internal/driver/mobile/gl/gl.go index 56d621145b..f49e2ae813 100644 --- a/internal/driver/mobile/gl/gl.go +++ b/internal/driver/mobile/gl/gl.go @@ -35,20 +35,6 @@ func (ctx *context) AttachShader(p Program, s Shader) { }) } -func (ctx *context) BindAttribLocation(p Program, a Attrib, name string) { - s, free := ctx.cString(name) - defer free() - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindAttribLocation, - a0: p.c(), - a1: a.c(), - a2: s, - }, - blocking: true, - }) -} - func (ctx *context) BindBuffer(target Enum, b Buffer) { ctx.enqueue(call{ args: fnargs{ @@ -58,27 +44,6 @@ func (ctx *context) BindBuffer(target Enum, b Buffer) { }, }) } - -func (ctx *context) BindFramebuffer(target Enum, fb Framebuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindFramebuffer, - a0: target.c(), - a1: fb.c(), - }, - }) -} - -func (ctx *context) BindRenderbuffer(target Enum, rb Renderbuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindRenderbuffer, - a0: target.c(), - a1: rb.c(), - }, - }) -} - func (ctx *context) BindTexture(target Enum, t Texture) { ctx.enqueue(call{ args: fnargs{ @@ -110,25 +75,6 @@ func (ctx *context) BlendColor(red, green, blue, alpha float32) { }) } -func (ctx *context) BlendEquation(mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendEquation, - a0: mode.c(), - }, - }) -} - -func (ctx *context) BlendEquationSeparate(modeRGB, modeAlpha Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendEquationSeparate, - a0: modeRGB.c(), - a1: modeAlpha.c(), - }, - }) -} - func (ctx *context) BlendFunc(sfactor, dfactor Enum) { ctx.enqueue(call{ args: fnargs{ @@ -139,18 +85,6 @@ func (ctx *context) BlendFunc(sfactor, dfactor Enum) { }) } -func (ctx *context) BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendFuncSeparate, - a0: sfactorRGB.c(), - a1: dfactorRGB.c(), - a2: sfactorAlpha.c(), - a3: dfactorAlpha.c(), - }, - }) -} - func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { parg := unsafe.Pointer(nil) if len(src) > 0 { @@ -168,41 +102,6 @@ func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { }) } -func (ctx *context) BufferInit(target Enum, size int, usage Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(size), - a2: usage.c(), - }, - parg: unsafe.Pointer(nil), - }) -} - -func (ctx *context) BufferSubData(target Enum, offset int, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBufferSubData, - a0: target.c(), - a1: uintptr(offset), - a2: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CheckFramebufferStatus(target Enum) Enum { - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCheckFramebufferStatus, - a0: target.c(), - }, - blocking: true, - })) -} - func (ctx *context) Clear(mask Enum) { ctx.enqueue(call{ args: fnargs{ @@ -224,36 +123,6 @@ func (ctx *context) ClearColor(red, green, blue, alpha float32) { }) } -func (ctx *context) ClearDepthf(d float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnClearDepthf, - a0: uintptr(math.Float32bits(d)), - }, - }) -} - -func (ctx *context) ClearStencil(s int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnClearStencil, - a0: uintptr(s), - }, - }) -} - -func (ctx *context) ColorMask(red, green, blue, alpha bool) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnColorMask, - a0: glBoolean(red), - a1: glBoolean(green), - a2: glBoolean(blue), - a3: glBoolean(alpha), - }, - }) -} - func (ctx *context) CompileShader(s Shader) { ctx.enqueue(call{ args: fnargs{ @@ -263,73 +132,6 @@ func (ctx *context) CompileShader(s Shader) { }) } -func (ctx *context) CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCompressedTexImage2D, - a0: target.c(), - a1: uintptr(level), - a2: internalformat.c(), - a3: uintptr(width), - a4: uintptr(height), - a5: uintptr(border), - a6: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCompressedTexSubImage2D, - a0: target.c(), - a1: uintptr(level), - a2: uintptr(xoffset), - a3: uintptr(yoffset), - a4: uintptr(width), - a5: uintptr(height), - a6: format.c(), - a7: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCopyTexImage2D, - a0: target.c(), - a1: uintptr(level), - a2: internalformat.c(), - a3: uintptr(x), - a4: uintptr(y), - a5: uintptr(width), - a6: uintptr(height), - a7: uintptr(border), - }, - }) -} - -func (ctx *context) CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCopyTexSubImage2D, - a0: target.c(), - a1: uintptr(level), - a2: uintptr(xoffset), - a3: uintptr(yoffset), - a4: uintptr(x), - a5: uintptr(y), - a6: uintptr(width), - a7: uintptr(height), - }, - }) -} - func (ctx *context) CreateBuffer() Buffer { return Buffer{Value: uint32(ctx.enqueue(call{ args: fnargs{ @@ -339,15 +141,6 @@ func (ctx *context) CreateBuffer() Buffer { }))} } -func (ctx *context) CreateFramebuffer() Framebuffer { - return Framebuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenFramebuffer, - }, - blocking: true, - }))} -} - func (ctx *context) CreateProgram() Program { return Program{ Init: true, @@ -360,15 +153,6 @@ func (ctx *context) CreateProgram() Program { ))} } -func (ctx *context) CreateRenderbuffer() Renderbuffer { - return Renderbuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenRenderbuffer, - }, - blocking: true, - }))} -} - func (ctx *context) CreateShader(ty Enum) Shader { return Shader{Value: uint32(ctx.enqueue(call{ args: fnargs{ @@ -396,16 +180,6 @@ func (ctx *context) CreateVertexArray() VertexArray { blocking: true, }))} } - -func (ctx *context) CullFace(mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCullFace, - a0: mode.c(), - }, - }) -} - func (ctx *context) DeleteBuffer(v Buffer) { ctx.enqueue(call{ args: fnargs{ @@ -415,659 +189,159 @@ func (ctx *context) DeleteBuffer(v Buffer) { }) } -func (ctx *context) DeleteFramebuffer(v Framebuffer) { +func (ctx *context) DeleteTexture(v Texture) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteFramebuffer, + fn: glfnDeleteTexture, a0: v.c(), }, }) } -func (ctx *context) DeleteProgram(p Program) { +func (ctx *context) Disable(cap Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteProgram, - a0: p.c(), + fn: glfnDisable, + a0: cap.c(), }, }) } -func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { +func (ctx *context) DrawArrays(mode Enum, first, count int) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteRenderbuffer, - a0: v.c(), + fn: glfnDrawArrays, + a0: mode.c(), + a1: uintptr(first), + a2: uintptr(count), }, }) } - -func (ctx *context) DeleteShader(s Shader) { +func (ctx *context) Enable(cap Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteShader, - a0: s.c(), + fn: glfnEnable, + a0: cap.c(), }, }) } -func (ctx *context) DeleteTexture(v Texture) { +func (ctx *context) EnableVertexAttribArray(a Attrib) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteTexture, - a0: v.c(), + fn: glfnEnableVertexAttribArray, + a0: a.c(), }, }) } -func (ctx *context) DepthFunc(fn Enum) { +func (ctx *context) Flush() { ctx.enqueue(call{ args: fnargs{ - fn: glfnDepthFunc, - a0: fn.c(), + fn: glfnFlush, }, + blocking: true, }) } -func (ctx *context) DepthMask(flag bool) { - ctx.enqueue(call{ +func (ctx *context) GetAttribLocation(p Program, name string) Attrib { + s, free := ctx.cString(name) + defer free() + return Attrib{Value: uint(ctx.enqueue(call{ args: fnargs{ - fn: glfnDepthMask, - a0: glBoolean(flag), + fn: glfnGetAttribLocation, + a0: p.c(), + a1: s, }, - }) + blocking: true, + }))} } -func (ctx *context) DepthRangef(n, f float32) { - ctx.enqueue(call{ +func (ctx *context) GetError() Enum { + return Enum(ctx.enqueue(call{ args: fnargs{ - fn: glfnDepthRangef, - a0: uintptr(math.Float32bits(n)), - a1: uintptr(math.Float32bits(f)), + fn: glfnGetError, }, - }) + blocking: true, + })) } -func (ctx *context) DetachShader(p Program, s Shader) { - ctx.enqueue(call{ +func (ctx *context) GetShaderi(s Shader, pname Enum) int { + return int(ctx.enqueue(call{ args: fnargs{ - fn: glfnDetachShader, - a0: p.c(), - a1: s.c(), + fn: glfnGetShaderiv, + a0: s.c(), + a1: pname.c(), }, - }) + blocking: true, + })) } -func (ctx *context) Disable(cap Enum) { +func (ctx *context) GetShaderInfoLog(s Shader) string { + infoLen := ctx.GetShaderi(s, InfoLogLength) + if infoLen == 0 { + return "" + } + buf := make([]byte, infoLen) + ctx.enqueue(call{ args: fnargs{ - fn: glfnDisable, - a0: cap.c(), + fn: glfnGetShaderInfoLog, + a0: s.c(), + a1: uintptr(infoLen), }, + parg: unsafe.Pointer(&buf[0]), + blocking: true, }) + + return goString(buf) } -func (ctx *context) DisableVertexAttribArray(a Attrib) { +func (ctx *context) GetShaderSource(s Shader) string { + sourceLen := ctx.GetShaderi(s, ShaderSourceLength) + if sourceLen == 0 { + return "" + } + buf := make([]byte, sourceLen) + ctx.enqueue(call{ args: fnargs{ - fn: glfnDisableVertexAttribArray, - a0: a.c(), + fn: glfnGetShaderSource, + a0: s.c(), + a1: uintptr(sourceLen), }, + parg: unsafe.Pointer(&buf[0]), + blocking: true, }) + + return goString(buf) } -func (ctx *context) DrawArrays(mode Enum, first, count int) { +func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDrawArrays, - a0: mode.c(), - a1: uintptr(first), - a2: uintptr(count), + fn: glfnGetTexParameteriv, + a0: target.c(), + a1: pname.c(), }, + blocking: true, }) } -func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { - ctx.enqueue(call{ +func (ctx *context) GetUniformLocation(p Program, name string) Uniform { + s, free := ctx.cString(name) + defer free() + return Uniform{Value: int32(ctx.enqueue(call{ args: fnargs{ - fn: glfnDrawElements, - a0: mode.c(), - a1: uintptr(count), - a2: ty.c(), - a3: uintptr(offset), + fn: glfnGetUniformLocation, + a0: p.c(), + a1: s, }, - }) + blocking: true, + }))} } -func (ctx *context) Enable(cap Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnEnable, - a0: cap.c(), - }, - }) -} - -func (ctx *context) EnableVertexAttribArray(a Attrib) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnEnableVertexAttribArray, - a0: a.c(), - }, - }) -} - -func (ctx *context) Finish() { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFinish, - }, - blocking: true, - }) -} - -func (ctx *context) Flush() { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFlush, - }, - blocking: true, - }) -} - -func (ctx *context) FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFramebufferRenderbuffer, - a0: target.c(), - a1: attachment.c(), - a2: rbTarget.c(), - a3: rb.c(), - }, - }) -} - -func (ctx *context) FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFramebufferTexture2D, - a0: target.c(), - a1: attachment.c(), - a2: texTarget.c(), - a3: t.c(), - a4: uintptr(level), - }, - }) -} - -func (ctx *context) FrontFace(mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFrontFace, - a0: mode.c(), - }, - }) -} - -func (ctx *context) GenerateMipmap(target Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenerateMipmap, - a0: target.c(), - }, - }) -} - -func (ctx *context) GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) { - bufSize := ctx.GetProgrami(p, ActiveAttributeMaxLength) - buf := make([]byte, bufSize) - var cType int - - cSize := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetActiveAttrib, - a0: p.c(), - a1: uintptr(index), - a2: uintptr(bufSize), - a3: uintptr(unsafe.Pointer(&cType)), // TODO(crawshaw): not safe for a moving collector - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) { - bufSize := ctx.GetProgrami(p, ActiveUniformMaxLength) - buf := make([]byte, bufSize+8) // extra space for cType - var cType int - - cSize := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetActiveUniform, - a0: p.c(), - a1: uintptr(index), - a2: uintptr(bufSize), - a3: uintptr(unsafe.Pointer(&cType)), // TODO(crawshaw): not safe for a moving collector - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetAttachedShaders(p Program) []Shader { - shadersLen := ctx.GetProgrami(p, AttachedShaders) - if shadersLen == 0 { - return nil - } - buf := make([]uint32, shadersLen) - - n := int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetAttachedShaders, - a0: p.c(), - a1: uintptr(shadersLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - })) - - buf = buf[:int(n)] - shaders := make([]Shader, len(buf)) - for i, s := range buf { - shaders[i] = Shader{Value: uint32(s)} - } - return shaders -} - -func (ctx *context) GetAttribLocation(p Program, name string) Attrib { - s, free := ctx.cString(name) - defer free() - return Attrib{Value: uint(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetAttribLocation, - a0: p.c(), - a1: s, - }, - blocking: true, - }))} -} - -func (ctx *context) GetBooleanv(dst []bool, pname Enum) { - buf := make([]int32, len(dst)) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetBooleanv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - for i, v := range buf { - dst[i] = v != 0 - } -} - -func (ctx *context) GetFloatv(dst []float32, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetFloatv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetIntegerv(dst []int32, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetIntegerv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetInteger(pname Enum) int { - var v [1]int32 - ctx.GetIntegerv(v[:], pname) - return int(v[0]) -} - -func (ctx *context) GetBufferParameteri(target, value Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetBufferParameteri, - a0: target.c(), - a1: value.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetError() Enum { - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetError, - }, - blocking: true, - })) -} - -func (ctx *context) GetFramebufferAttachmentParameteri(target, attachment, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetFramebufferAttachmentParameteriv, - a0: target.c(), - a1: attachment.c(), - a2: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgrami(p Program, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetProgramiv, - a0: p.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgramInfoLog(p Program) string { - infoLen := ctx.GetProgrami(p, InfoLogLength) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetProgramInfoLog, - a0: p.c(), - a1: uintptr(infoLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf) -} - -func (ctx *context) GetRenderbufferParameteri(target, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetRenderbufferParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderi(s Shader, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderiv, - a0: s.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderInfoLog(s Shader) string { - infoLen := ctx.GetShaderi(s, InfoLogLength) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderInfoLog, - a0: s.c(), - a1: uintptr(infoLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf) -} - -func (ctx *context) GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) { - var rangeAndPrec [3]int32 - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderPrecisionFormat, - a0: shadertype.c(), - a1: precisiontype.c(), - }, - parg: unsafe.Pointer(&rangeAndPrec[0]), - blocking: true, - }) - - return int(rangeAndPrec[0]), int(rangeAndPrec[1]), int(rangeAndPrec[2]) -} - -func (ctx *context) GetShaderSource(s Shader) string { - sourceLen := ctx.GetShaderi(s, ShaderSourceLength) - if sourceLen == 0 { - return "" - } - buf := make([]byte, sourceLen) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderSource, - a0: s.c(), - a1: uintptr(sourceLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf) -} - -func (ctx *context) GetTexParameterfv(dst []float32, target, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetTexParameterfv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - }) -} - -func (ctx *context) GetUniformfv(dst []float32, src Uniform, p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformfv, - a0: p.c(), - a1: src.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetUniformiv(dst []int32, src Uniform, p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformiv, - a0: p.c(), - a1: src.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetUniformLocation(p Program, name string) Uniform { - s, free := ctx.cString(name) - defer free() - return Uniform{Value: int32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformLocation, - a0: p.c(), - a1: s, - }, - blocking: true, - }))} -} - -func (ctx *context) GetVertexAttribf(src Attrib, pname Enum) float32 { - var params [1]float32 - ctx.GetVertexAttribfv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribfv(dst []float32, src Attrib, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetVertexAttribfv, - a0: src.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetVertexAttribi(src Attrib, pname Enum) int32 { - var params [1]int32 - ctx.GetVertexAttribiv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribiv(dst []int32, src Attrib, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetVertexAttribiv, - a0: src.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) Hint(target, mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnHint, - a0: target.c(), - a1: mode.c(), - }, - }) -} - -func (ctx *context) IsBuffer(b Buffer) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsBuffer, - a0: b.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) IsEnabled(cap Enum) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsEnabled, - a0: cap.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) IsFramebuffer(fb Framebuffer) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsFramebuffer, - a0: fb.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) IsProgram(p Program) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsProgram, - a0: p.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) IsRenderbuffer(rb Renderbuffer) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsRenderbuffer, - a0: rb.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) IsShader(s Shader) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsShader, - a0: s.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) IsTexture(t Texture) bool { - return ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsTexture, - a0: t.c(), - }, - blocking: true, - }) != 0 -} - -func (ctx *context) LineWidth(width float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnLineWidth, - a0: uintptr(math.Float32bits(width)), - }, - }) -} - -func (ctx *context) LinkProgram(p Program) { +func (ctx *context) LinkProgram(p Program) { ctx.enqueue(call{ args: fnargs{ fn: glfnLinkProgram, @@ -1076,26 +350,6 @@ func (ctx *context) LinkProgram(p Program) { }) } -func (ctx *context) PixelStorei(pname Enum, param int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnPixelStorei, - a0: pname.c(), - a1: uintptr(param), - }, - }) -} - -func (ctx *context) PolygonOffset(factor, units float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnPolygonOffset, - a0: uintptr(math.Float32bits(factor)), - a1: uintptr(math.Float32bits(units)), - }, - }) -} - func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { ctx.enqueue(call{ args: fnargs{ @@ -1113,36 +367,6 @@ func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty E }) } -func (ctx *context) ReleaseShaderCompiler() { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnReleaseShaderCompiler, - }, - }) -} - -func (ctx *context) RenderbufferStorage(target, internalFormat Enum, width, height int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnRenderbufferStorage, - a0: target.c(), - a1: internalFormat.c(), - a2: uintptr(width), - a3: uintptr(height), - }, - }) -} - -func (ctx *context) SampleCoverage(value float32, invert bool) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnSampleCoverage, - a0: uintptr(math.Float32bits(value)), - a1: glBoolean(invert), - }, - }) -} - func (ctx *context) Scissor(x, y, width, height int32) { ctx.enqueue(call{ args: fnargs{ @@ -1157,83 +381,17 @@ func (ctx *context) Scissor(x, y, width, height int32) { func (ctx *context) ShaderSource(s Shader, src string) { strp, free := ctx.cStringPtr(src) - defer free() - ctx.enqueue(call{ - args: fnargs{ - fn: glfnShaderSource, - a0: s.c(), - a1: 1, - a2: strp, - }, - blocking: true, - }) -} - -func (ctx *context) StencilFunc(fn Enum, ref int, mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilFunc, - a0: fn.c(), - a1: uintptr(ref), - a2: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilFuncSeparate(face, fn Enum, ref int, mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilFuncSeparate, - a0: face.c(), - a1: fn.c(), - a2: uintptr(ref), - a3: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilMask(mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilMask, - a0: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilMaskSeparate(face Enum, mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilMaskSeparate, - a0: face.c(), - a1: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilOp(fail, zfail, zpass Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilOp, - a0: fail.c(), - a1: zfail.c(), - a2: zpass.c(), - }, - }) -} - -func (ctx *context) StencilOpSeparate(face, sfail, dpfail, dppass Enum) { + defer free() ctx.enqueue(call{ args: fnargs{ - fn: glfnStencilOpSeparate, - a0: face.c(), - a1: sfail.c(), - a2: dpfail.c(), - a3: dppass.c(), + fn: glfnShaderSource, + a0: s.c(), + a1: 1, + a2: strp, }, + blocking: true, }) } - func (ctx *context) TexImage2D(target Enum, level int, internalFormat int, width, height int, format Enum, ty Enum, data []byte) { // It is common to pass TexImage2D a nil data, indicating that a // bound GL buffer is being used as the source. In that case, it @@ -1260,48 +418,6 @@ func (ctx *context) TexImage2D(target Enum, level int, internalFormat int, width }) } -func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexSubImage2D, - // TODO(crawshaw): GLES3 offset for PIXEL_UNPACK_BUFFER and PIXEL_PACK_BUFFER. - a0: target.c(), - a1: uintptr(level), - a2: uintptr(x), - a3: uintptr(y), - a4: uintptr(width), - a5: uintptr(height), - a6: format.c(), - a7: ty.c(), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) TexParameterf(target, pname Enum, param float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameterf, - a0: target.c(), - a1: pname.c(), - a2: uintptr(math.Float32bits(param)), - }, - }) -} - -func (ctx *context) TexParameterfv(target, pname Enum, params []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameterfv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(¶ms[0]), - blocking: true, - }) -} - func (ctx *context) TexParameteri(target, pname Enum, param int) { ctx.enqueue(call{ args: fnargs{ @@ -1313,18 +429,6 @@ func (ctx *context) TexParameteri(target, pname Enum, param int) { }) } -func (ctx *context) TexParameteriv(target, pname Enum, params []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(¶ms[0]), - blocking: true, - }) -} - func (ctx *context) Uniform1f(dst Uniform, v float32) { ctx.enqueue(call{ args: fnargs{ @@ -1334,135 +438,6 @@ func (ctx *context) Uniform1f(dst Uniform, v float32) { }, }) } - -func (ctx *context) Uniform1fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1fv, - a0: dst.c(), - a1: uintptr(len(src)), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform1i(dst Uniform, v int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1i, - a0: dst.c(), - a1: uintptr(v), - }, - }) -} - -func (ctx *context) Uniform1iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1iv, - a0: dst.c(), - a1: uintptr(len(src)), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform2f(dst Uniform, v0, v1 float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - }, - }) -} - -func (ctx *context) Uniform2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2fv, - a0: dst.c(), - a1: uintptr(len(src) / 2), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform2i(dst Uniform, v0, v1 int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - }) -} - -func (ctx *context) Uniform2iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2iv, - a0: dst.c(), - a1: uintptr(len(src) / 2), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform3f(dst Uniform, v0, v1, v2 float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - }, - }) -} - -func (ctx *context) Uniform3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3fv, - a0: dst.c(), - a1: uintptr(len(src) / 3), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform3i(dst Uniform, v0, v1, v2 int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - }) -} - -func (ctx *context) Uniform3iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3iv, - a0: dst.c(), - a1: uintptr(len(src) / 3), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { ctx.enqueue(call{ args: fnargs{ @@ -1488,68 +463,6 @@ func (ctx *context) Uniform4fv(dst Uniform, src []float32) { }) } -func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - }) -} - -func (ctx *context) Uniform4iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4iv, - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix2fv, - // OpenGL ES 2 does not support transpose. - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix3fv, - a0: dst.c(), - a1: uintptr(len(src) / 9), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix4fv, - a0: dst.c(), - a1: uintptr(len(src) / 16), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - func (ctx *context) UseProgram(p Program) { ctx.enqueue(call{ args: fnargs{ @@ -1559,105 +472,6 @@ func (ctx *context) UseProgram(p Program) { }) } -func (ctx *context) ValidateProgram(p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnValidateProgram, - a0: p.c(), - }, - }) -} - -func (ctx *context) VertexAttrib1f(dst Attrib, x float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - }, - }) -} - -func (ctx *context) VertexAttrib1fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib1fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib2f(dst Attrib, x, y float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - }, - }) -} - -func (ctx *context) VertexAttrib2fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib2fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib3f(dst Attrib, x, y, z float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - }, - }) -} - -func (ctx *context) VertexAttrib3fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib3fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib4f(dst Attrib, x, y, z, w float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - a4: uintptr(math.Float32bits(w)), - }, - }) -} - -func (ctx *context) VertexAttrib4fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib4fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - func (ctx *context) VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int) { ctx.enqueue(call{ args: fnargs{ diff --git a/internal/driver/mobile/gl/interface.go b/internal/driver/mobile/gl/interface.go index f0138e4639..91bee534f3 100644 --- a/internal/driver/mobile/gl/interface.go +++ b/internal/driver/mobile/gl/interface.go @@ -7,6 +7,7 @@ package gl // Context is an OpenGL ES context. // // A Context has a method for every GL function supported by ES 2 or later. +// In a program compiled with ES 3 support. // // Calls are not safe for concurrent use. However calls can be made from // any goroutine, the gl package removes the notion of thread-local @@ -24,27 +25,10 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glAttachShader.xhtml AttachShader(p Program, s Shader) - // BindAttribLocation binds a vertex attribute index with a named - // variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindAttribLocation.xhtml - BindAttribLocation(p Program, a Attrib, name string) - // BindBuffer binds a buffer. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindBuffer.xhtml BindBuffer(target Enum, b Buffer) - - // BindFramebuffer binds a framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindFramebuffer.xhtml - BindFramebuffer(target Enum, fb Framebuffer) - - // BindRenderbuffer binds a render buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindRenderbuffer.xhtml - BindRenderbuffer(target Enum, rb Renderbuffer) - // BindTexture binds a texture. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindTexture.xhtml @@ -60,47 +44,15 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendColor.xhtml BlendColor(red, green, blue, alpha float32) - // BlendEquation sets both RGB and alpha blend equations. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendEquation.xhtml - BlendEquation(mode Enum) - - // BlendEquationSeparate sets RGB and alpha blend equations separately. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendEquationSeparate.xhtml - BlendEquationSeparate(modeRGB, modeAlpha Enum) - // BlendFunc sets the pixel blending factors. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFunc.xhtml BlendFunc(sfactor, dfactor Enum) - // BlendFunc sets the pixel RGB and alpha blending factors separately. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFuncSeparate.xhtml - BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) - // BufferData creates a new data store for the bound buffer object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glBufferData.xhtml BufferData(target Enum, src []byte, usage Enum) - - // BufferInit creates a new uninitialized data store for the bound buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBufferData.xhtml - BufferInit(target Enum, size int, usage Enum) - - // BufferSubData sets some of data in the bound buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBufferSubData.xhtml - BufferSubData(target Enum, offset int, data []byte) - - // CheckFramebufferStatus reports the completeness status of the - // active framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCheckFramebufferStatus.xhtml - CheckFramebufferStatus(target Enum) Enum - // Clear clears the window. // // The behavior of Clear is influenced by the pixel ownership test, @@ -114,68 +66,21 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glClearColor.xhtml ClearColor(red, green, blue, alpha float32) - // ClearDepthf sets the depth value used to clear the depth buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glClearDepthf.xhtml - ClearDepthf(d float32) - - // ClearStencil sets the index used to clear the stencil buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glClearStencil.xhtml - ClearStencil(s int) - - // ColorMask specifies whether color components in the framebuffer - // can be written. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glColorMask.xhtml - ColorMask(red, green, blue, alpha bool) - // CompileShader compiles the source code of s. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glCompileShader.xhtml CompileShader(s Shader) - // CompressedTexImage2D writes a compressed 2D texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexImage2D.xhtml - CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) - - // CompressedTexSubImage2D writes a subregion of a compressed 2D texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexSubImage2D.xhtml - CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) - - // CopyTexImage2D writes a 2D texture from the current framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyTexImage2D.xhtml - CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) - - // CopyTexSubImage2D writes a 2D texture subregion from the - // current framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyTexSubImage2D.xhtml - CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) - // CreateBuffer creates a buffer object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenBuffers.xhtml CreateBuffer() Buffer - // CreateFramebuffer creates a framebuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenFramebuffers.xhtml - CreateFramebuffer() Framebuffer - // CreateProgram creates a new empty program object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glCreateProgram.xhtml CreateProgram() Program - // CreateRenderbuffer create a renderbuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenRenderbuffers.xhtml - CreateRenderbuffer() Renderbuffer - // CreateShader creates a new empty shader object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glCreateShader.xhtml @@ -190,97 +95,26 @@ type Context interface { // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml CreateVertexArray() VertexArray - - // CullFace specifies which polygons are candidates for culling. - // - // Valid modes: FRONT, BACK, FRONT_AND_BACK. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCullFace.xhtml - CullFace(mode Enum) - // DeleteBuffer deletes the given buffer object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteBuffers.xhtml DeleteBuffer(v Buffer) - // DeleteFramebuffer deletes the given framebuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteFramebuffers.xhtml - DeleteFramebuffer(v Framebuffer) - - // DeleteProgram deletes the given program object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteProgram.xhtml - DeleteProgram(p Program) - - // DeleteRenderbuffer deletes the given render buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteRenderbuffers.xhtml - DeleteRenderbuffer(v Renderbuffer) - - // DeleteShader deletes shader s. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteShader.xhtml - DeleteShader(s Shader) - // DeleteTexture deletes the given texture object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTextures.xhtml DeleteTexture(v Texture) - // DepthFunc sets the function used for depth buffer comparisons. - // - // Valid fn values: - // NEVER - // LESS - // EQUAL - // LEQUAL - // GREATER - // NOTEQUAL - // GEQUAL - // ALWAYS - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDepthFunc.xhtml - DepthFunc(fn Enum) - - // DepthMask sets the depth buffer enabled for writing. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDepthMask.xhtml - DepthMask(flag bool) - - // DepthRangef sets the mapping from normalized device coordinates to - // window coordinates. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDepthRangef.xhtml - DepthRangef(n, f float32) - - // DetachShader detaches the shader s from the program p. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDetachShader.xhtml - DetachShader(p Program, s Shader) - // Disable disables various GL capabilities. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glDisable.xhtml Disable(cap Enum) - // DisableVertexAttribArray disables a vertex attribute array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDisableVertexAttribArray.xhtml - DisableVertexAttribArray(a Attrib) - // DrawArrays renders geometric primitives from the bound data. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawArrays.xhtml DrawArrays(mode Enum, first, count int) - // DrawElements renders primitives from a bound buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawElements.xhtml - DrawElements(mode Enum, count int, ty Enum, offset int) - - // TODO(crawshaw): consider DrawElements8 / DrawElements16 / DrawElements32 - // Enable enables various GL capabilities. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glEnable.xhtml @@ -290,13 +124,6 @@ type Context interface { // // http://www.khronos.org/opengles/sdk/docs/man3/html/glEnableVertexAttribArray.xhtml EnableVertexAttribArray(a Attrib) - - // Finish blocks until the effects of all previously called GL - // commands are complete. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFinish.xhtml - Finish() - // Flush empties all buffers. It does not block. // // An OpenGL implementation may buffer network communication, @@ -305,109 +132,16 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glFlush.xhtml Flush() - // FramebufferRenderbuffer attaches rb to the current frame buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFramebufferRenderbuffer.xhtml - FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) - - // FramebufferTexture2D attaches the t to the current frame buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFramebufferTexture2D.xhtml - FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) - - // FrontFace defines which polygons are front-facing. - // - // Valid modes: CW, CCW. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFrontFace.xhtml - FrontFace(mode Enum) - - // GenerateMipmap generates mipmaps for the current texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenerateMipmap.xhtml - GenerateMipmap(target Enum) - - // GetActiveAttrib returns details about an active attribute variable. - // A value of 0 for index selects the first active attribute variable. - // Permissible values for index range from 0 to the number of active - // attribute variables minus 1. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveAttrib.xhtml - GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) - - // GetActiveUniform returns details about an active uniform variable. - // A value of 0 for index selects the first active uniform variable. - // Permissible values for index range from 0 to the number of active - // uniform variables minus 1. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniform.xhtml - GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) - - // GetAttachedShaders returns the shader objects attached to program p. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttachedShaders.xhtml - GetAttachedShaders(p Program) []Shader - // GetAttribLocation returns the location of an attribute variable. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttribLocation.xhtml GetAttribLocation(p Program, name string) Attrib - // GetBooleanv returns the boolean values of parameter pname. - // - // Many boolean parameters can be queried more easily using IsEnabled. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetBooleanv(dst []bool, pname Enum) - - // GetFloatv returns the float values of parameter pname. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetFloatv(dst []float32, pname Enum) - - // GetIntegerv returns the int values of parameter pname. - // - // Single values may be queried more easily using GetInteger. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetIntegerv(dst []int32, pname Enum) - - // GetInteger returns the int value of parameter pname. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetInteger(pname Enum) int - - // GetBufferParameteri returns a parameter for the active buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetBufferParameter.xhtml - GetBufferParameteri(target, value Enum) int - // GetError returns the next error. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetError.xhtml GetError() Enum - // GetFramebufferAttachmentParameteri returns attachment parameters - // for the active framebuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetFramebufferAttachmentParameteriv.xhtml - GetFramebufferAttachmentParameteri(target, attachment, pname Enum) int - - // GetProgrami returns a parameter value for a program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramiv.xhtml - GetProgrami(p Program, pname Enum) int - - // GetProgramInfoLog returns the information log for a program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramInfoLog.xhtml - GetProgramInfoLog(p Program) string - - // GetRenderbufferParameteri returns a parameter value for a render buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetRenderbufferParameteriv.xhtml - GetRenderbufferParameteri(target, pname Enum) int - // GetShaderi returns a parameter value for a shader. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderiv.xhtml @@ -418,124 +152,16 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderInfoLog.xhtml GetShaderInfoLog(s Shader) string - // GetShaderPrecisionFormat returns range and precision limits for - // shader types. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderPrecisionFormat.xhtml - GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) - - // GetShaderSource returns source code of shader s. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderSource.xhtml - GetShaderSource(s Shader) string - - // GetTexParameterfv returns the float values of a texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTexParameter.xhtml - GetTexParameterfv(dst []float32, target, pname Enum) - - // GetTexParameteriv returns the int values of a texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTexParameter.xhtml - GetTexParameteriv(dst []int32, target, pname Enum) - - // GetUniformfv returns the float values of a uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml - GetUniformfv(dst []float32, src Uniform, p Program) - - // GetUniformiv returns the float values of a uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml - GetUniformiv(dst []int32, src Uniform, p Program) - // GetUniformLocation returns the location of a uniform variable. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformLocation.xhtml GetUniformLocation(p Program, name string) Uniform - // GetVertexAttribf reads the float value of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribf(src Attrib, pname Enum) float32 - - // GetVertexAttribfv reads float values of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribfv(dst []float32, src Attrib, pname Enum) - - // GetVertexAttribi reads the int value of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribi(src Attrib, pname Enum) int32 - - // GetVertexAttribiv reads int values of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribiv(dst []int32, src Attrib, pname Enum) - - // TODO(crawshaw): glGetVertexAttribPointerv - - // Hint sets implementation-specific modes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glHint.xhtml - Hint(target, mode Enum) - - // IsBuffer reports if b is a valid buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsBuffer.xhtml - IsBuffer(b Buffer) bool - - // IsEnabled reports if cap is an enabled capability. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsEnabled.xhtml - IsEnabled(cap Enum) bool - - // IsFramebuffer reports if fb is a valid frame buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsFramebuffer.xhtml - IsFramebuffer(fb Framebuffer) bool - - // IsProgram reports if p is a valid program object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsProgram.xhtml - IsProgram(p Program) bool - - // IsRenderbuffer reports if rb is a valid render buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsRenderbuffer.xhtml - IsRenderbuffer(rb Renderbuffer) bool - - // IsShader reports if s is valid shader. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsShader.xhtml - IsShader(s Shader) bool - - // IsTexture reports if t is a valid texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsTexture.xhtml - IsTexture(t Texture) bool - - // LineWidth specifies the width of lines. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glLineWidth.xhtml - LineWidth(width float32) - // LinkProgram links the specified program. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glLinkProgram.xhtml LinkProgram(p Program) - // PixelStorei sets pixel storage parameters. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glPixelStorei.xhtml - PixelStorei(pname Enum, param int32) - - // PolygonOffset sets the scaling factors for depth offsets. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glPolygonOffset.xhtml - PolygonOffset(factor, units float32) - // ReadPixels returns pixel data from a buffer. // // In GLES 3, the source buffer is controlled with ReadBuffer. @@ -543,162 +169,30 @@ type Context interface { // http://www.khronos.org/opengles/sdk/docs/man3/html/glReadPixels.xhtml ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) - // ReleaseShaderCompiler frees resources allocated by the shader compiler. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glReleaseShaderCompiler.xhtml - ReleaseShaderCompiler() - - // RenderbufferStorage establishes the data storage, format, and - // dimensions of a renderbuffer object's image. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glRenderbufferStorage.xhtml - RenderbufferStorage(target, internalFormat Enum, width, height int) - - // SampleCoverage sets multisample coverage parameters. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glSampleCoverage.xhtml - SampleCoverage(value float32, invert bool) - // Scissor defines the scissor box rectangle, in window coordinates. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glScissor.xhtml Scissor(x, y, width, height int32) - // TODO(crawshaw): ShaderBinary - // ShaderSource sets the source code of s to the given source code. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glShaderSource.xhtml ShaderSource(s Shader, src string) - - // StencilFunc sets the front and back stencil test reference value. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFunc.xhtml - StencilFunc(fn Enum, ref int, mask uint32) - - // StencilFunc sets the front or back stencil test reference value. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFuncSeparate.xhtml - StencilFuncSeparate(face, fn Enum, ref int, mask uint32) - - // StencilMask controls the writing of bits in the stencil planes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilMask.xhtml - StencilMask(mask uint32) - - // StencilMaskSeparate controls the writing of bits in the stencil planes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilMaskSeparate.xhtml - StencilMaskSeparate(face Enum, mask uint32) - - // StencilOp sets front and back stencil test actions. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilOp.xhtml - StencilOp(fail, zfail, zpass Enum) - - // StencilOpSeparate sets front or back stencil tests. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilOpSeparate.xhtml - StencilOpSeparate(face, sfail, dpfail, dppass Enum) - // TexImage2D writes a 2D texture image. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml TexImage2D(target Enum, level int, internalFormat int, width, height int, format Enum, ty Enum, data []byte) - // TexSubImage2D writes a subregion of a 2D texture image. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage2D.xhtml - TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) - - // TexParameterf sets a float texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameterf(target, pname Enum, param float32) - - // TexParameterfv sets a float texture parameter array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameterfv(target, pname Enum, params []float32) - // TexParameteri sets an integer texture parameter. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml TexParameteri(target, pname Enum, param int) - // TexParameteriv sets an integer texture parameter array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameteriv(target, pname Enum, params []int32) - // Uniform1f writes a float uniform variable. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml Uniform1f(dst Uniform, v float32) - // Uniform1fv writes a [len(src)]float uniform array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1fv(dst Uniform, src []float32) - - // Uniform1i writes an int uniform variable. - // - // Uniform1i and Uniform1iv are the only two functions that may be used - // to load uniform variables defined as sampler types. Loading samplers - // with any other function will result in a INVALID_OPERATION error. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1i(dst Uniform, v int) - - // Uniform1iv writes a int uniform array of len(src) elements. - // - // Uniform1i and Uniform1iv are the only two functions that may be used - // to load uniform variables defined as sampler types. Loading samplers - // with any other function will result in a INVALID_OPERATION error. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1iv(dst Uniform, src []int32) - - // Uniform2f writes a vec2 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2f(dst Uniform, v0, v1 float32) - - // Uniform2fv writes a vec2 uniform array of len(src)/2 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2fv(dst Uniform, src []float32) - - // Uniform2i writes an ivec2 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2i(dst Uniform, v0, v1 int) - - // Uniform2iv writes an ivec2 uniform array of len(src)/2 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2iv(dst Uniform, src []int32) - - // Uniform3f writes a vec3 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3f(dst Uniform, v0, v1, v2 float32) - - // Uniform3fv writes a vec3 uniform array of len(src)/3 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3fv(dst Uniform, src []float32) - - // Uniform3i writes an ivec3 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3i(dst Uniform, v0, v1, v2 int32) - - // Uniform3iv writes an ivec3 uniform array of len(src)/3 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3iv(dst Uniform, src []int32) - // Uniform4f writes a vec4 uniform variable. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml @@ -708,94 +202,11 @@ type Context interface { // // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml Uniform4fv(dst Uniform, src []float32) - - // Uniform4i writes an ivec4 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform4i(dst Uniform, v0, v1, v2, v3 int32) - - // Uniform4i writes an ivec4 uniform array of len(src)/4 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform4iv(dst Uniform, src []int32) - - // UniformMatrix2fv writes 2x2 matrices. Each matrix uses four - // float32 values, so the number of matrices written is len(src)/4. - // - // Each matrix must be supplied in column major order. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - UniformMatrix2fv(dst Uniform, src []float32) - - // UniformMatrix3fv writes 3x3 matrices. Each matrix uses nine - // float32 values, so the number of matrices written is len(src)/9. - // - // Each matrix must be supplied in column major order. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - UniformMatrix3fv(dst Uniform, src []float32) - - // UniformMatrix4fv writes 4x4 matrices. Each matrix uses 16 - // float32 values, so the number of matrices written is len(src)/16. - // - // Each matrix must be supplied in column major order. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - UniformMatrix4fv(dst Uniform, src []float32) - // UseProgram sets the active program. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glUseProgram.xhtml UseProgram(p Program) - // ValidateProgram checks to see whether the executables contained in - // program can execute given the current OpenGL state. - // - // Typically only used for debugging. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glValidateProgram.xhtml - ValidateProgram(p Program) - - // VertexAttrib1f writes a float vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib1f(dst Attrib, x float32) - - // VertexAttrib1fv writes a float vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib1fv(dst Attrib, src []float32) - - // VertexAttrib2f writes a vec2 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib2f(dst Attrib, x, y float32) - - // VertexAttrib2fv writes a vec2 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib2fv(dst Attrib, src []float32) - - // VertexAttrib3f writes a vec3 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib3f(dst Attrib, x, y, z float32) - - // VertexAttrib3fv writes a vec3 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib3fv(dst Attrib, src []float32) - - // VertexAttrib4f writes a vec4 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib4f(dst Attrib, x, y, z, w float32) - - // VertexAttrib4fv writes a vec4 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib4fv(dst Attrib, src []float32) - // VertexAttribPointer uses a bound buffer to define vertex attribute data. // // Direct use of VertexAttribPointer to load data into OpenGL is not @@ -841,8 +252,7 @@ type Context interface { // }() // // This interface is an internal implementation detail and should only be used -// by the package responsible for managing the screen, such as -// golang.org/x/mobile/app. +// by the package responsible for managing the screen. type Worker interface { // WorkAvailable returns a channel that communicates when DoWork should be // called. diff --git a/internal/driver/mobile/gl/types_prod.go b/internal/driver/mobile/gl/types.go similarity index 85% rename from internal/driver/mobile/gl/types_prod.go rename to internal/driver/mobile/gl/types.go index d6fe9ee6ab..abf5fc3c2b 100644 --- a/internal/driver/mobile/gl/types_prod.go +++ b/internal/driver/mobile/gl/types.go @@ -73,13 +73,11 @@ func (v Program) c() uintptr { } return uintptr(v.Value) } -func (v Shader) c() uintptr { return uintptr(v.Value) } -func (v Buffer) c() uintptr { return uintptr(v.Value) } -func (v Framebuffer) c() uintptr { return uintptr(v.Value) } -func (v Renderbuffer) c() uintptr { return uintptr(v.Value) } -func (v Texture) c() uintptr { return uintptr(v.Value) } -func (v Uniform) c() uintptr { return uintptr(v.Value) } -func (v VertexArray) c() uintptr { return uintptr(v.Value) } +func (v Shader) c() uintptr { return uintptr(v.Value) } +func (v Buffer) c() uintptr { return uintptr(v.Value) } +func (v Texture) c() uintptr { return uintptr(v.Value) } +func (v Uniform) c() uintptr { return uintptr(v.Value) } +func (v VertexArray) c() uintptr { return uintptr(v.Value) } func (v Attrib) String() string { return fmt.Sprintf("Attrib(%d)", v.Value) } func (v Program) String() string { return fmt.Sprintf("Program(%d)", v.Value) } diff --git a/internal/driver/mobile/gl/work.c b/internal/driver/mobile/gl/work.c index 03c729fdb5..e37c636794 100644 --- a/internal/driver/mobile/gl/work.c +++ b/internal/driver/mobile/gl/work.c @@ -31,18 +31,9 @@ uintptr_t processFn(struct fnargs* args, char* parg) { case glfnAttachShader: glAttachShader((GLint)args->a0, (GLint)args->a1); break; - case glfnBindAttribLocation: - glBindAttribLocation((GLint)args->a0, (GLint)args->a1, (GLchar*)args->a2); - break; case glfnBindBuffer: glBindBuffer((GLenum)args->a0, (GLuint)args->a1); break; - case glfnBindFramebuffer: - glBindFramebuffer((GLenum)args->a0, (GLint)args->a1); - break; - case glfnBindRenderbuffer: - glBindRenderbuffer((GLenum)args->a0, (GLint)args->a1); - break; case glfnBindTexture: glBindTexture((GLenum)args->a0, (GLint)args->a1); break; @@ -52,284 +43,84 @@ uintptr_t processFn(struct fnargs* args, char* parg) { case glfnBlendColor: glBlendColor(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); break; - case glfnBlendEquation: - glBlendEquation((GLenum)args->a0); - break; - case glfnBlendEquationSeparate: - glBlendEquationSeparate((GLenum)args->a0, (GLenum)args->a1); - break; case glfnBlendFunc: glBlendFunc((GLenum)args->a0, (GLenum)args->a1); break; - case glfnBlendFuncSeparate: - glBlendFuncSeparate((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLenum)args->a3); - break; case glfnBufferData: glBufferData((GLenum)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg, (GLenum)args->a2); break; - case glfnBufferSubData: - glBufferSubData((GLenum)args->a0, (GLint)args->a1, (GLsizeiptr)args->a2, (GLvoid*)parg); - break; - case glfnCheckFramebufferStatus: - ret = glCheckFramebufferStatus((GLenum)args->a0); - break; case glfnClear: glClear((GLenum)args->a0); break; case glfnClearColor: glClearColor(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); break; - case glfnClearDepthf: - glClearDepthf(*(GLfloat*)&args->a0); - break; - case glfnClearStencil: - glClearStencil((GLint)args->a0); - break; - case glfnColorMask: - glColorMask((GLboolean)args->a0, (GLboolean)args->a1, (GLboolean)args->a2, (GLboolean)args->a3); - break; case glfnCompileShader: glCompileShader((GLint)args->a0); break; - case glfnCompressedTexImage2D: - glCompressedTexImage2D((GLenum)args->a0, (GLint)args->a1, (GLenum)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLsizeiptr)args->a6, (GLvoid*)parg); - break; - case glfnCompressedTexSubImage2D: - glCompressedTexSubImage2D((GLenum)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLenum)args->a6, (GLsizeiptr)args->a7, (GLvoid*)parg); - break; - case glfnCopyTexImage2D: - glCopyTexImage2D((GLenum)args->a0, (GLint)args->a1, (GLenum)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLint)args->a6, (GLint)args->a7); - break; - case glfnCopyTexSubImage2D: - glCopyTexSubImage2D((GLenum)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLint)args->a6, (GLint)args->a7); - break; case glfnCreateProgram: ret = glCreateProgram(); break; case glfnCreateShader: ret = glCreateShader((GLenum)args->a0); break; - case glfnCullFace: - glCullFace((GLenum)args->a0); - break; case glfnDeleteBuffer: glDeleteBuffers(1, (const GLuint*)(&args->a0)); break; - case glfnDeleteFramebuffer: - glDeleteFramebuffers(1, (const GLuint*)(&args->a0)); - break; - case glfnDeleteProgram: - glDeleteProgram((GLint)args->a0); - break; - case glfnDeleteRenderbuffer: - glDeleteRenderbuffers(1, (const GLuint*)(&args->a0)); - break; - case glfnDeleteShader: - glDeleteShader((GLint)args->a0); - break; case glfnDeleteTexture: glDeleteTextures(1, (const GLuint*)(&args->a0)); break; - case glfnDepthFunc: - glDepthFunc((GLenum)args->a0); - break; - case glfnDepthMask: - glDepthMask((GLboolean)args->a0); - break; - case glfnDepthRangef: - glDepthRangef(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1); - break; - case glfnDetachShader: - glDetachShader((GLint)args->a0, (GLint)args->a1); - break; case glfnDisable: glDisable((GLenum)args->a0); break; - case glfnDisableVertexAttribArray: - glDisableVertexAttribArray((GLint)args->a0); - break; case glfnDrawArrays: glDrawArrays((GLenum)args->a0, (GLint)args->a1, (GLint)args->a2); break; - case glfnDrawElements: - glDrawElements((GLenum)args->a0, (GLint)args->a1, (GLenum)args->a2, (void*)args->a3); - break; case glfnEnable: glEnable((GLenum)args->a0); break; case glfnEnableVertexAttribArray: glEnableVertexAttribArray((GLint)args->a0); break; - case glfnFinish: - glFinish(); - break; case glfnFlush: glFlush(); break; - case glfnFramebufferRenderbuffer: - glFramebufferRenderbuffer((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLint)args->a3); - break; - case glfnFramebufferTexture2D: - glFramebufferTexture2D((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLint)args->a3, (GLint)args->a4); - break; - case glfnFrontFace: - glFrontFace((GLenum)args->a0); - break; case glfnGenBuffer: glGenBuffers(1, (GLuint*)&ret); break; - case glfnGenFramebuffer: - glGenFramebuffers(1, (GLuint*)&ret); - break; - case glfnGenRenderbuffer: - glGenRenderbuffers(1, (GLuint*)&ret); - break; case glfnGenTexture: glGenTextures(1, (GLuint*)&ret); break; case glfnGenVertexArray: glGenVertexArrays(1, (GLuint*)&ret); break; - case glfnGenerateMipmap: - glGenerateMipmap((GLenum)args->a0); - break; - case glfnGetActiveAttrib: - glGetActiveAttrib( - (GLuint)args->a0, - (GLuint)args->a1, - (GLsizei)args->a2, - NULL, - (GLint*)&ret, - (GLenum*)args->a3, - (GLchar*)parg); - break; - case glfnGetActiveUniform: - glGetActiveUniform( - (GLuint)args->a0, - (GLuint)args->a1, - (GLsizei)args->a2, - NULL, - (GLint*)&ret, - (GLenum*)args->a3, - (GLchar*)parg); - break; - case glfnGetAttachedShaders: - glGetAttachedShaders((GLuint)args->a0, (GLsizei)args->a1, (GLsizei*)&ret, (GLuint*)parg); - break; case glfnGetAttribLocation: ret = glGetAttribLocation((GLint)args->a0, (GLchar*)args->a1); break; - case glfnGetBooleanv: - glGetBooleanv((GLenum)args->a0, (GLboolean*)parg); - break; - case glfnGetBufferParameteri: - glGetBufferParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; - case glfnGetFloatv: - glGetFloatv((GLenum)args->a0, (GLfloat*)parg); - break; - case glfnGetIntegerv: - glGetIntegerv((GLenum)args->a0, (GLint*)parg); - break; case glfnGetError: ret = glGetError(); break; - case glfnGetFramebufferAttachmentParameteriv: - glGetFramebufferAttachmentParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLint*)&ret); - break; - case glfnGetProgramiv: - glGetProgramiv((GLint)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; - case glfnGetProgramInfoLog: - glGetProgramInfoLog((GLuint)args->a0, (GLsizei)args->a1, 0, (GLchar*)parg); - break; - case glfnGetRenderbufferParameteriv: - glGetRenderbufferParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; case glfnGetShaderiv: glGetShaderiv((GLint)args->a0, (GLenum)args->a1, (GLint*)&ret); break; case glfnGetShaderInfoLog: glGetShaderInfoLog((GLuint)args->a0, (GLsizei)args->a1, 0, (GLchar*)parg); break; - case glfnGetShaderPrecisionFormat: - glGetShaderPrecisionFormat((GLenum)args->a0, (GLenum)args->a1, (GLint*)parg, &((GLint*)parg)[2]); - break; case glfnGetShaderSource: glGetShaderSource((GLuint)args->a0, (GLsizei)args->a1, 0, (GLchar*)parg); break; - case glfnGetString: - ret = (uintptr_t)glGetString((GLenum)args->a0); - break; - case glfnGetTexParameterfv: - glGetTexParameterfv((GLenum)args->a0, (GLenum)args->a1, (GLfloat*)parg); - break; case glfnGetTexParameteriv: glGetTexParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)parg); break; - case glfnGetUniformfv: - glGetUniformfv((GLuint)args->a0, (GLint)args->a1, (GLfloat*)parg); - break; - case glfnGetUniformiv: - glGetUniformiv((GLuint)args->a0, (GLint)args->a1, (GLint*)parg); - break; case glfnGetUniformLocation: ret = glGetUniformLocation((GLint)args->a0, (GLchar*)args->a1); break; - case glfnGetVertexAttribfv: - glGetVertexAttribfv((GLuint)args->a0, (GLenum)args->a1, (GLfloat*)parg); - break; - case glfnGetVertexAttribiv: - glGetVertexAttribiv((GLuint)args->a0, (GLenum)args->a1, (GLint*)parg); - break; - case glfnHint: - glHint((GLenum)args->a0, (GLenum)args->a1); - break; - case glfnIsBuffer: - ret = glIsBuffer((GLint)args->a0); - break; - case glfnIsEnabled: - ret = glIsEnabled((GLenum)args->a0); - break; - case glfnIsFramebuffer: - ret = glIsFramebuffer((GLint)args->a0); - break; - case glfnIsProgram: - ret = glIsProgram((GLint)args->a0); - break; - case glfnIsRenderbuffer: - ret = glIsRenderbuffer((GLint)args->a0); - break; - case glfnIsShader: - ret = glIsShader((GLint)args->a0); - break; - case glfnIsTexture: - ret = glIsTexture((GLint)args->a0); - break; - case glfnLineWidth: - glLineWidth(*(GLfloat*)&args->a0); - break; case glfnLinkProgram: glLinkProgram((GLint)args->a0); break; - case glfnPixelStorei: - glPixelStorei((GLenum)args->a0, (GLint)args->a1); - break; - case glfnPolygonOffset: - glPolygonOffset(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1); - break; case glfnReadPixels: glReadPixels((GLint)args->a0, (GLint)args->a1, (GLsizei)args->a2, (GLsizei)args->a3, (GLenum)args->a4, (GLenum)args->a5, (void*)parg); break; - case glfnReleaseShaderCompiler: - glReleaseShaderCompiler(); - break; - case glfnRenderbufferStorage: - glRenderbufferStorage((GLenum)args->a0, (GLenum)args->a1, (GLint)args->a2, (GLint)args->a3); - break; - case glfnSampleCoverage: - glSampleCoverage(*(GLfloat*)&args->a0, (GLboolean)args->a1); - break; case glfnScissor: glScissor((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3); break; @@ -340,24 +131,6 @@ uintptr_t processFn(struct fnargs* args, char* parg) { glShaderSource((GLuint)args->a0, (GLsizei)args->a1, (const GLchar **)args->a2, NULL); #endif break; - case glfnStencilFunc: - glStencilFunc((GLenum)args->a0, (GLint)args->a1, (GLuint)args->a2); - break; - case glfnStencilFuncSeparate: - glStencilFuncSeparate((GLenum)args->a0, (GLenum)args->a1, (GLint)args->a2, (GLuint)args->a3); - break; - case glfnStencilMask: - glStencilMask((GLuint)args->a0); - break; - case glfnStencilMaskSeparate: - glStencilMaskSeparate((GLenum)args->a0, (GLuint)args->a1); - break; - case glfnStencilOp: - glStencilOp((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2); - break; - case glfnStencilOpSeparate: - glStencilOpSeparate((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLenum)args->a3); - break; case glfnTexImage2D: glTexImage2D( (GLenum)args->a0, @@ -370,117 +143,21 @@ uintptr_t processFn(struct fnargs* args, char* parg) { (GLenum)args->a6, (const GLvoid*)parg); break; - case glfnTexSubImage2D: - glTexSubImage2D( - (GLenum)args->a0, - (GLint)args->a1, - (GLint)args->a2, - (GLint)args->a3, - (GLsizei)args->a4, - (GLsizei)args->a5, - (GLenum)args->a6, - (GLenum)args->a7, - (const GLvoid*)parg); - break; - case glfnTexParameterf: - glTexParameterf((GLenum)args->a0, (GLenum)args->a1, *(GLfloat*)&args->a2); - break; - case glfnTexParameterfv: - glTexParameterfv((GLenum)args->a0, (GLenum)args->a1, (GLfloat*)parg); - break; case glfnTexParameteri: glTexParameteri((GLenum)args->a0, (GLenum)args->a1, (GLint)args->a2); break; - case glfnTexParameteriv: - glTexParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)parg); - break; case glfnUniform1f: glUniform1f((GLint)args->a0, *(GLfloat*)&args->a1); break; - case glfnUniform1fv: - glUniform1fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform1i: - glUniform1i((GLint)args->a0, (GLint)args->a1); - break; - case glfnUniform1iv: - glUniform1iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform2f: - glUniform2f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2); - break; - case glfnUniform2fv: - glUniform2fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform2i: - glUniform2i((GLint)args->a0, (GLint)args->a1, (GLint)args->a2); - break; - case glfnUniform2iv: - glUniform2iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform3f: - glUniform3f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); - break; - case glfnUniform3fv: - glUniform3fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform3i: - glUniform3i((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3); - break; - case glfnUniform3iv: - glUniform3iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; case glfnUniform4f: glUniform4f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3, *(GLfloat*)&args->a4); break; case glfnUniform4fv: glUniform4fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); break; - case glfnUniform4i: - glUniform4i((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4); - break; - case glfnUniform4iv: - glUniform4iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniformMatrix2fv: - glUniformMatrix2fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix3fv: - glUniformMatrix3fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix4fv: - glUniformMatrix4fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; case glfnUseProgram: glUseProgram((GLint)args->a0); break; - case glfnValidateProgram: - glValidateProgram((GLint)args->a0); - break; - case glfnVertexAttrib1f: - glVertexAttrib1f((GLint)args->a0, *(GLfloat*)&args->a1); - break; - case glfnVertexAttrib1fv: - glVertexAttrib1fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttrib2f: - glVertexAttrib2f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2); - break; - case glfnVertexAttrib2fv: - glVertexAttrib2fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttrib3f: - glVertexAttrib3f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); - break; - case glfnVertexAttrib3fv: - glVertexAttrib3fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttrib4f: - glVertexAttrib4f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3, *(GLfloat*)&args->a4); - break; - case glfnVertexAttrib4fv: - glVertexAttrib4fv((GLint)args->a0, (GLfloat*)parg); - break; case glfnVertexAttribPointer: glVertexAttribPointer((GLuint)args->a0, (GLint)args->a1, (GLenum)args->a2, (GLboolean)args->a3, (GLsizei)args->a4, (const GLvoid*)args->a5); break; @@ -489,4 +166,4 @@ uintptr_t processFn(struct fnargs* args, char* parg) { break; } return ret; -} +} \ No newline at end of file diff --git a/internal/driver/mobile/gl/work.h b/internal/driver/mobile/gl/work.h index b6322475f2..13999f238e 100644 --- a/internal/driver/mobile/gl/work.h +++ b/internal/driver/mobile/gl/work.h @@ -37,147 +37,46 @@ // TODO: generate this enum from fn.go. typedef enum { glfnUNDEFINED, - glfnActiveTexture, glfnAttachShader, - glfnBindAttribLocation, glfnBindBuffer, - glfnBindFramebuffer, - glfnBindRenderbuffer, glfnBindTexture, glfnBindVertexArray, glfnBlendColor, - glfnBlendEquation, - glfnBlendEquationSeparate, glfnBlendFunc, - glfnBlendFuncSeparate, glfnBufferData, - glfnBufferSubData, - glfnCheckFramebufferStatus, glfnClear, glfnClearColor, - glfnClearDepthf, - glfnClearStencil, - glfnColorMask, glfnCompileShader, - glfnCompressedTexImage2D, - glfnCompressedTexSubImage2D, - glfnCopyTexImage2D, - glfnCopyTexSubImage2D, glfnCreateProgram, glfnCreateShader, - glfnCullFace, glfnDeleteBuffer, - glfnDeleteFramebuffer, - glfnDeleteProgram, - glfnDeleteRenderbuffer, - glfnDeleteShader, glfnDeleteTexture, - glfnDepthFunc, - glfnDepthRangef, - glfnDepthMask, - glfnDetachShader, glfnDisable, - glfnDisableVertexAttribArray, glfnDrawArrays, - glfnDrawElements, glfnEnable, glfnEnableVertexAttribArray, - glfnFinish, glfnFlush, - glfnFramebufferRenderbuffer, - glfnFramebufferTexture2D, - glfnFrontFace, glfnGenBuffer, - glfnGenFramebuffer, - glfnGenRenderbuffer, glfnGenTexture, glfnGenVertexArray, - glfnGenerateMipmap, - glfnGetActiveAttrib, - glfnGetActiveUniform, - glfnGetAttachedShaders, glfnGetAttribLocation, - glfnGetBooleanv, - glfnGetBufferParameteri, glfnGetError, - glfnGetFloatv, - glfnGetFramebufferAttachmentParameteriv, - glfnGetIntegerv, - glfnGetProgramInfoLog, - glfnGetProgramiv, - glfnGetRenderbufferParameteriv, glfnGetShaderInfoLog, - glfnGetShaderPrecisionFormat, glfnGetShaderSource, glfnGetShaderiv, - glfnGetString, - glfnGetTexParameterfv, glfnGetTexParameteriv, glfnGetUniformLocation, - glfnGetUniformfv, - glfnGetUniformiv, - glfnGetVertexAttribfv, - glfnGetVertexAttribiv, - glfnHint, - glfnIsBuffer, - glfnIsEnabled, - glfnIsFramebuffer, - glfnIsProgram, - glfnIsRenderbuffer, - glfnIsShader, - glfnIsTexture, - glfnLineWidth, glfnLinkProgram, - glfnPixelStorei, - glfnPolygonOffset, glfnReadPixels, - glfnReleaseShaderCompiler, - glfnRenderbufferStorage, - glfnSampleCoverage, glfnScissor, glfnShaderSource, - glfnStencilFunc, - glfnStencilFuncSeparate, - glfnStencilMask, - glfnStencilMaskSeparate, - glfnStencilOp, - glfnStencilOpSeparate, glfnTexImage2D, - glfnTexParameterf, - glfnTexParameterfv, glfnTexParameteri, - glfnTexParameteriv, - glfnTexSubImage2D, glfnUniform1f, - glfnUniform1fv, - glfnUniform1i, - glfnUniform1iv, - glfnUniform2f, - glfnUniform2fv, - glfnUniform2i, - glfnUniform2iv, - glfnUniform3f, - glfnUniform3fv, - glfnUniform3i, - glfnUniform3iv, glfnUniform4f, glfnUniform4fv, - glfnUniform4i, - glfnUniform4iv, - glfnUniformMatrix2fv, - glfnUniformMatrix3fv, - glfnUniformMatrix4fv, glfnUseProgram, - glfnValidateProgram, - glfnVertexAttrib1f, - glfnVertexAttrib1fv, - glfnVertexAttrib2f, - glfnVertexAttrib2fv, - glfnVertexAttrib3f, - glfnVertexAttrib3fv, - glfnVertexAttrib4f, - glfnVertexAttrib4fv, glfnVertexAttribPointer, glfnViewport, } glfn; diff --git a/internal/driver/mobile/gl/work_windows.go b/internal/driver/mobile/gl/work_windows.go index c09e54f21c..f46cf946e4 100644 --- a/internal/driver/mobile/gl/work_windows.go +++ b/internal/driver/mobile/gl/work_windows.go @@ -117,22 +117,10 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall(glAttachShader.Addr(), 2, c.args.a0, c.args.a1, 0) return }, - glfnBindAttribLocation: func(c call) (ret uintptr) { - syscall.Syscall(glBindAttribLocation.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - return - }, glfnBindBuffer: func(c call) (ret uintptr) { syscall.Syscall(glBindBuffer.Addr(), 2, c.args.a0, c.args.a1, 0) return }, - glfnBindFramebuffer: func(c call) (ret uintptr) { - syscall.Syscall(glBindFramebuffer.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, - glfnBindRenderbuffer: func(c call) (ret uintptr) { - syscall.Syscall(glBindRenderbuffer.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, glfnBindTexture: func(c call) (ret uintptr) { syscall.Syscall(glBindTexture.Addr(), 2, c.args.a0, c.args.a1, 0) return @@ -145,34 +133,14 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall6(glBlendColor.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) return }, - glfnBlendEquation: func(c call) (ret uintptr) { - syscall.Syscall(glBlendEquation.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnBlendEquationSeparate: func(c call) (ret uintptr) { - syscall.Syscall(glBlendEquationSeparate.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, glfnBlendFunc: func(c call) (ret uintptr) { syscall.Syscall(glBlendFunc.Addr(), 2, c.args.a0, c.args.a1, 0) return }, - glfnBlendFuncSeparate: func(c call) (ret uintptr) { - syscall.Syscall6(glBlendFuncSeparate.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, glfnBufferData: func(c call) (ret uintptr) { syscall.Syscall6(glBufferData.Addr(), 4, c.args.a0, c.args.a1, uintptr(c.parg), c.args.a2, 0, 0) return }, - glfnBufferSubData: func(c call) (ret uintptr) { - syscall.Syscall6(glBufferSubData.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, uintptr(c.parg), 0, 0) - return - }, - glfnCheckFramebufferStatus: func(c call) (ret uintptr) { - ret, _, _ = syscall.Syscall(glCheckFramebufferStatus.Addr(), 1, c.args.a0, 0, 0) - return ret - }, glfnClear: func(c call) (ret uintptr) { syscall.Syscall(glClear.Addr(), 1, c.args.a0, 0, 0) return @@ -181,38 +149,10 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall6(glClearColor.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) return }, - glfnClearDepthf: func(c call) (ret uintptr) { - syscall.Syscall6(glClearDepthf.Addr(), 1, c.args.a0, 0, 0, 0, 0, 0) - return - }, - glfnClearStencil: func(c call) (ret uintptr) { - syscall.Syscall(glClearStencil.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnColorMask: func(c call) (ret uintptr) { - syscall.Syscall6(glColorMask.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, glfnCompileShader: func(c call) (ret uintptr) { syscall.Syscall(glCompileShader.Addr(), 1, c.args.a0, 0, 0) return }, - glfnCompressedTexImage2D: func(c call) (ret uintptr) { - syscall.Syscall9(glCompressedTexImage2D.Addr(), 8, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, uintptr(c.parg), 0) - return - }, - glfnCompressedTexSubImage2D: func(c call) (ret uintptr) { - syscall.Syscall9(glCompressedTexSubImage2D.Addr(), 9, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, uintptr(c.parg)) - return - }, - glfnCopyTexImage2D: func(c call) (ret uintptr) { - syscall.Syscall9(glCopyTexImage2D.Addr(), 8, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, 0) - return - }, - glfnCopyTexSubImage2D: func(c call) (ret uintptr) { - syscall.Syscall9(glCopyTexSubImage2D.Addr(), 8, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, 0) - return - }, glfnCreateProgram: func(c call) (ret uintptr) { ret, _, _ = syscall.Syscall(glCreateProgram.Addr(), 0, 0, 0, 0) return ret @@ -221,66 +161,22 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ ret, _, _ = syscall.Syscall(glCreateShader.Addr(), 1, c.args.a0, 0, 0) return ret }, - glfnCullFace: func(c call) (ret uintptr) { - syscall.Syscall(glCullFace.Addr(), 1, c.args.a0, 0, 0) - return - }, glfnDeleteBuffer: func(c call) (ret uintptr) { syscall.Syscall(glDeleteBuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) return }, - glfnDeleteFramebuffer: func(c call) (ret uintptr) { - syscall.Syscall(glDeleteFramebuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - return - }, - glfnDeleteProgram: func(c call) (ret uintptr) { - syscall.Syscall(glDeleteProgram.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnDeleteRenderbuffer: func(c call) (ret uintptr) { - syscall.Syscall(glDeleteRenderbuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - return - }, - glfnDeleteShader: func(c call) (ret uintptr) { - syscall.Syscall(glDeleteShader.Addr(), 1, c.args.a0, 0, 0) - return - }, glfnDeleteTexture: func(c call) (ret uintptr) { syscall.Syscall(glDeleteTextures.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) return }, - glfnDepthFunc: func(c call) (ret uintptr) { - syscall.Syscall(glDepthFunc.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnDepthRangef: func(c call) (ret uintptr) { - syscall.Syscall6(glDepthRangef.Addr(), 2, c.args.a0, c.args.a1, 0, 0, 0, 0) - return - }, - glfnDepthMask: func(c call) (ret uintptr) { - syscall.Syscall(glDepthMask.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnDetachShader: func(c call) (ret uintptr) { - syscall.Syscall(glDetachShader.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, glfnDisable: func(c call) (ret uintptr) { syscall.Syscall(glDisable.Addr(), 1, c.args.a0, 0, 0) return }, - glfnDisableVertexAttribArray: func(c call) (ret uintptr) { - syscall.Syscall(glDisableVertexAttribArray.Addr(), 1, c.args.a0, 0, 0) - return - }, glfnDrawArrays: func(c call) (ret uintptr) { syscall.Syscall(glDrawArrays.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) return }, - glfnDrawElements: func(c call) (ret uintptr) { - syscall.Syscall6(glDrawElements.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, glfnEnable: func(c call) (ret uintptr) { syscall.Syscall(glEnable.Addr(), 1, c.args.a0, 0, 0) return @@ -289,38 +185,14 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall(glEnableVertexAttribArray.Addr(), 1, c.args.a0, 0, 0) return }, - glfnFinish: func(c call) (ret uintptr) { - syscall.Syscall(glFinish.Addr(), 0, 0, 0, 0) - return - }, glfnFlush: func(c call) (ret uintptr) { syscall.Syscall(glFlush.Addr(), 0, 0, 0, 0) return }, - glfnFramebufferRenderbuffer: func(c call) (ret uintptr) { - syscall.Syscall6(glFramebufferRenderbuffer.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, - glfnFramebufferTexture2D: func(c call) (ret uintptr) { - syscall.Syscall6(glFramebufferTexture2D.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, 0) - return - }, - glfnFrontFace: func(c call) (ret uintptr) { - syscall.Syscall(glFrontFace.Addr(), 1, c.args.a0, 0, 0) - return - }, glfnGenBuffer: func(c call) (ret uintptr) { syscall.Syscall(glGenBuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) return }, - glfnGenFramebuffer: func(c call) (ret uintptr) { - syscall.Syscall(glGenFramebuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - return - }, - glfnGenRenderbuffer: func(c call) (ret uintptr) { - syscall.Syscall(glGenRenderbuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - return - }, glfnGenVertexArray: func(c call) (ret uintptr) { syscall.Syscall(glGenVertexArrays.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) return @@ -329,72 +201,18 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall(glGenTextures.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) return }, - glfnGenerateMipmap: func(c call) (ret uintptr) { - syscall.Syscall(glGenerateMipmap.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnGetActiveAttrib: func(c call) (ret uintptr) { - syscall.Syscall9(glGetActiveAttrib.Addr(), 7, c.args.a0, c.args.a1, c.args.a2, 0, uintptr(unsafe.Pointer(&ret)), c.args.a3, uintptr(c.parg), 0, 0) - return - }, - glfnGetActiveUniform: func(c call) (ret uintptr) { - syscall.Syscall9(glGetActiveUniform.Addr(), 7, c.args.a0, c.args.a1, c.args.a2, 0, uintptr(unsafe.Pointer(&ret)), c.args.a3, uintptr(c.parg), 0, 0) - return - }, - glfnGetAttachedShaders: func(c call) (ret uintptr) { - syscall.Syscall6(glGetAttachedShaders.Addr(), 4, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret)), uintptr(c.parg), 0, 0) - return - }, glfnGetAttribLocation: func(c call) (ret uintptr) { ret, _, _ = syscall.Syscall(glGetAttribLocation.Addr(), 2, c.args.a0, c.args.a1, 0) return ret }, - glfnGetBooleanv: func(c call) (ret uintptr) { - syscall.Syscall(glGetBooleanv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, - glfnGetBufferParameteri: func(c call) (ret uintptr) { - syscall.Syscall(glGetBufferParameteri.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - return - }, glfnGetError: func(c call) (ret uintptr) { ret, _, _ = syscall.Syscall(glGetError.Addr(), 0, 0, 0, 0) return ret }, - glfnGetFloatv: func(c call) (ret uintptr) { - syscall.Syscall(glGetFloatv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, - glfnGetFramebufferAttachmentParameteriv: func(c call) (ret uintptr) { - syscall.Syscall6(glGetFramebufferAttachmentParameteriv.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, uintptr(unsafe.Pointer(&ret)), 0, 0) - return - }, - glfnGetIntegerv: func(c call) (ret uintptr) { - syscall.Syscall(glGetIntegerv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, - glfnGetProgramInfoLog: func(c call) (ret uintptr) { - syscall.Syscall6(glGetProgramInfoLog.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - return - }, - glfnGetProgramiv: func(c call) (ret uintptr) { - syscall.Syscall(glGetProgramiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - return - }, - glfnGetRenderbufferParameteriv: func(c call) (ret uintptr) { - syscall.Syscall(glGetRenderbufferParameteriv.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - return - }, glfnGetShaderInfoLog: func(c call) (ret uintptr) { syscall.Syscall6(glGetShaderInfoLog.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) return }, - glfnGetShaderPrecisionFormat: func(c call) (ret uintptr) { - // c.parg is a [3]int32. The first [2]int32 of the array is one - // parameter, the final *int32 is another parameter. - syscall.Syscall6(glGetShaderPrecisionFormat.Addr(), 4, c.args.a0, c.args.a1, uintptr(c.parg), uintptr(c.parg)+2*unsafe.Sizeof(uintptr(0)), 0, 0) - return - }, glfnGetShaderSource: func(c call) (ret uintptr) { syscall.Syscall6(glGetShaderSource.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) return @@ -403,14 +221,6 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall(glGetShaderiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) return }, - glfnGetString: func(c call) (ret uintptr) { - ret, _, _ = syscall.Syscall(glGetString.Addr(), 1, c.args.a0, 0, 0) - return ret - }, - glfnGetTexParameterfv: func(c call) (ret uintptr) { - syscall.Syscall(glGetTexParameterfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, glfnGetTexParameteriv: func(c call) (ret uintptr) { syscall.Syscall(glGetTexParameteriv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) return @@ -419,86 +229,14 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ ret, _, _ = syscall.Syscall(glGetUniformLocation.Addr(), 2, c.args.a0, c.args.a1, 0) return ret }, - glfnGetUniformfv: func(c call) (ret uintptr) { - syscall.Syscall(glGetUniformfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnGetUniformiv: func(c call) (ret uintptr) { - syscall.Syscall(glGetUniformiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnGetVertexAttribfv: func(c call) (ret uintptr) { - syscall.Syscall(glGetVertexAttribfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnGetVertexAttribiv: func(c call) (ret uintptr) { - syscall.Syscall(glGetVertexAttribiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnHint: func(c call) (ret uintptr) { - syscall.Syscall(glHint.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, - glfnIsBuffer: func(c call) (ret uintptr) { - syscall.Syscall(glIsBuffer.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnIsEnabled: func(c call) (ret uintptr) { - syscall.Syscall(glIsEnabled.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnIsFramebuffer: func(c call) (ret uintptr) { - syscall.Syscall(glIsFramebuffer.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnIsProgram: func(c call) (ret uintptr) { - ret, _, _ = syscall.Syscall(glIsProgram.Addr(), 1, c.args.a0, 0, 0) - return ret - }, - glfnIsRenderbuffer: func(c call) (ret uintptr) { - syscall.Syscall(glIsRenderbuffer.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnIsShader: func(c call) (ret uintptr) { - syscall.Syscall(glIsShader.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnIsTexture: func(c call) (ret uintptr) { - syscall.Syscall(glIsTexture.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnLineWidth: func(c call) (ret uintptr) { - syscall.Syscall(glLineWidth.Addr(), 1, c.args.a0, 0, 0) - return - }, glfnLinkProgram: func(c call) (ret uintptr) { syscall.Syscall(glLinkProgram.Addr(), 1, c.args.a0, 0, 0) return }, - glfnPixelStorei: func(c call) (ret uintptr) { - syscall.Syscall(glPixelStorei.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, - glfnPolygonOffset: func(c call) (ret uintptr) { - syscall.Syscall6(glPolygonOffset.Addr(), 2, c.args.a0, c.args.a1, 0, 0, 0, 0) - return - }, glfnReadPixels: func(c call) (ret uintptr) { syscall.Syscall9(glReadPixels.Addr(), 7, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, uintptr(c.parg), 0, 0) return }, - glfnReleaseShaderCompiler: func(c call) (ret uintptr) { - syscall.Syscall(glReleaseShaderCompiler.Addr(), 0, 0, 0, 0) - return - }, - glfnRenderbufferStorage: func(c call) (ret uintptr) { - syscall.Syscall6(glRenderbufferStorage.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, - glfnSampleCoverage: func(c call) (ret uintptr) { - syscall.Syscall6(glSampleCoverage.Addr(), 1, c.args.a0, 0, 0, 0, 0, 0) - return - }, glfnScissor: func(c call) (ret uintptr) { syscall.Syscall6(glScissor.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) return @@ -507,102 +245,18 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall6(glShaderSource.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, 0, 0, 0) return }, - glfnStencilFunc: func(c call) (ret uintptr) { - syscall.Syscall(glStencilFunc.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - return - }, - glfnStencilFuncSeparate: func(c call) (ret uintptr) { - syscall.Syscall6(glStencilFuncSeparate.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, - glfnStencilMask: func(c call) (ret uintptr) { - syscall.Syscall(glStencilMask.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnStencilMaskSeparate: func(c call) (ret uintptr) { - syscall.Syscall(glStencilMaskSeparate.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, - glfnStencilOp: func(c call) (ret uintptr) { - syscall.Syscall(glStencilOp.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - return - }, - glfnStencilOpSeparate: func(c call) (ret uintptr) { - syscall.Syscall6(glStencilOpSeparate.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, glfnTexImage2D: func(c call) (ret uintptr) { syscall.Syscall9(glTexImage2D.Addr(), 9, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, 0, c.args.a5, c.args.a6, uintptr(c.parg)) return }, - glfnTexParameterf: func(c call) (ret uintptr) { - syscall.Syscall6(glTexParameterf.Addr(), 3, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnTexParameterfv: func(c call) (ret uintptr) { - syscall.Syscall(glTexParameterfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, glfnTexParameteri: func(c call) (ret uintptr) { syscall.Syscall(glTexParameteri.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) return }, - glfnTexParameteriv: func(c call) (ret uintptr) { - syscall.Syscall(glTexParameteriv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnTexSubImage2D: func(c call) (ret uintptr) { - syscall.Syscall9(glTexSubImage2D.Addr(), 9, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, uintptr(c.parg)) - return - }, glfnUniform1f: func(c call) (ret uintptr) { syscall.Syscall6(glUniform1f.Addr(), 2, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) return }, - glfnUniform1fv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform1fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnUniform1i: func(c call) (ret uintptr) { - syscall.Syscall(glUniform1i.Addr(), 2, c.args.a0, c.args.a1, 0) - return - }, - glfnUniform1iv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform1iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnUniform2f: func(c call) (ret uintptr) { - syscall.Syscall6(glUniform2f.Addr(), 3, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnUniform2fv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform2fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnUniform2i: func(c call) (ret uintptr) { - syscall.Syscall(glUniform2i.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - return - }, - glfnUniform2iv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform2iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnUniform3f: func(c call) (ret uintptr) { - syscall.Syscall6(glUniform3f.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnUniform3fv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform3fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnUniform3i: func(c call) (ret uintptr) { - syscall.Syscall6(glUniform3i.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - return - }, - glfnUniform3iv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform3iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, glfnUniform4f: func(c call) (ret uintptr) { syscall.Syscall6(glUniform4f.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) return @@ -611,66 +265,10 @@ var glfnMap = map[glfn]func(c call) (ret uintptr){ syscall.Syscall(glUniform4fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) return }, - glfnUniform4i: func(c call) (ret uintptr) { - syscall.Syscall6(glUniform4i.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, 0) - return - }, - glfnUniform4iv: func(c call) (ret uintptr) { - syscall.Syscall(glUniform4iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - return - }, - glfnUniformMatrix2fv: func(c call) (ret uintptr) { - syscall.Syscall6(glUniformMatrix2fv.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - return - }, - glfnUniformMatrix3fv: func(c call) (ret uintptr) { - syscall.Syscall6(glUniformMatrix3fv.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - return - }, - glfnUniformMatrix4fv: func(c call) (ret uintptr) { - syscall.Syscall6(glUniformMatrix4fv.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - return - }, glfnUseProgram: func(c call) (ret uintptr) { syscall.Syscall(glUseProgram.Addr(), 1, c.args.a0, 0, 0) return }, - glfnValidateProgram: func(c call) (ret uintptr) { - syscall.Syscall(glValidateProgram.Addr(), 1, c.args.a0, 0, 0) - return - }, - glfnVertexAttrib1f: func(c call) (ret uintptr) { - syscall.Syscall6(glVertexAttrib1f.Addr(), 2, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnVertexAttrib1fv: func(c call) (ret uintptr) { - syscall.Syscall(glVertexAttrib1fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, - glfnVertexAttrib2f: func(c call) (ret uintptr) { - syscall.Syscall6(glVertexAttrib2f.Addr(), 3, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnVertexAttrib2fv: func(c call) (ret uintptr) { - syscall.Syscall(glVertexAttrib2fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, - glfnVertexAttrib3f: func(c call) (ret uintptr) { - syscall.Syscall6(glVertexAttrib3f.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnVertexAttrib3fv: func(c call) (ret uintptr) { - syscall.Syscall(glVertexAttrib3fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, - glfnVertexAttrib4f: func(c call) (ret uintptr) { - syscall.Syscall6(glVertexAttrib4f.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - return - }, - glfnVertexAttrib4fv: func(c call) (ret uintptr) { - syscall.Syscall(glVertexAttrib4fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - return - }, glfnVertexAttribPointer: func(c call) (ret uintptr) { syscall.Syscall6(glVertexAttribPointer.Addr(), 6, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) return @@ -705,147 +303,47 @@ var ( ) var ( - libGLESv2 = LibGLESv2 - glActiveTexture = libGLESv2.NewProc("glActiveTexture") - glAttachShader = libGLESv2.NewProc("glAttachShader") - glBindAttribLocation = libGLESv2.NewProc("glBindAttribLocation") - glBindBuffer = libGLESv2.NewProc("glBindBuffer") - glBindFramebuffer = libGLESv2.NewProc("glBindFramebuffer") - glBindRenderbuffer = libGLESv2.NewProc("glBindRenderbuffer") - glBindTexture = libGLESv2.NewProc("glBindTexture") - glBindVertexArray = libGLESv2.NewProc("glBindVertexArray") - glBlendColor = libGLESv2.NewProc("glBlendColor") - glBlendEquation = libGLESv2.NewProc("glBlendEquation") - glBlendEquationSeparate = libGLESv2.NewProc("glBlendEquationSeparate") - glBlendFunc = libGLESv2.NewProc("glBlendFunc") - glBlendFuncSeparate = libGLESv2.NewProc("glBlendFuncSeparate") - glBufferData = libGLESv2.NewProc("glBufferData") - glBufferSubData = libGLESv2.NewProc("glBufferSubData") - glCheckFramebufferStatus = libGLESv2.NewProc("glCheckFramebufferStatus") - glClear = libGLESv2.NewProc("glClear") - glClearColor = libGLESv2.NewProc("glClearColor") - glClearDepthf = libGLESv2.NewProc("glClearDepthf") - glClearStencil = libGLESv2.NewProc("glClearStencil") - glColorMask = libGLESv2.NewProc("glColorMask") - glCompileShader = libGLESv2.NewProc("glCompileShader") - glCompressedTexImage2D = libGLESv2.NewProc("glCompressedTexImage2D") - glCompressedTexSubImage2D = libGLESv2.NewProc("glCompressedTexSubImage2D") - glCopyTexImage2D = libGLESv2.NewProc("glCopyTexImage2D") - glCopyTexSubImage2D = libGLESv2.NewProc("glCopyTexSubImage2D") - glCreateProgram = libGLESv2.NewProc("glCreateProgram") - glCreateShader = libGLESv2.NewProc("glCreateShader") - glCullFace = libGLESv2.NewProc("glCullFace") - glDeleteBuffers = libGLESv2.NewProc("glDeleteBuffers") - glDeleteFramebuffers = libGLESv2.NewProc("glDeleteFramebuffers") - glDeleteProgram = libGLESv2.NewProc("glDeleteProgram") - glDeleteRenderbuffers = libGLESv2.NewProc("glDeleteRenderbuffers") - glDeleteShader = libGLESv2.NewProc("glDeleteShader") - glDeleteTextures = libGLESv2.NewProc("glDeleteTextures") - glDepthFunc = libGLESv2.NewProc("glDepthFunc") - glDepthRangef = libGLESv2.NewProc("glDepthRangef") - glDepthMask = libGLESv2.NewProc("glDepthMask") - glDetachShader = libGLESv2.NewProc("glDetachShader") - glDisable = libGLESv2.NewProc("glDisable") - glDisableVertexAttribArray = libGLESv2.NewProc("glDisableVertexAttribArray") - glDrawArrays = libGLESv2.NewProc("glDrawArrays") - glDrawElements = libGLESv2.NewProc("glDrawElements") - glEnable = libGLESv2.NewProc("glEnable") - glEnableVertexAttribArray = libGLESv2.NewProc("glEnableVertexAttribArray") - glFinish = libGLESv2.NewProc("glFinish") - glFlush = libGLESv2.NewProc("glFlush") - glFramebufferRenderbuffer = libGLESv2.NewProc("glFramebufferRenderbuffer") - glFramebufferTexture2D = libGLESv2.NewProc("glFramebufferTexture2D") - glFrontFace = libGLESv2.NewProc("glFrontFace") - glGenBuffers = libGLESv2.NewProc("glGenBuffers") - glGenFramebuffers = libGLESv2.NewProc("glGenFramebuffers") - glGenRenderbuffers = libGLESv2.NewProc("glGenRenderbuffers") - glGenTextures = libGLESv2.NewProc("glGenTextures") - glGenVertexArrays = libGLESv2.NewProc("glGenVertexArrays") - glGenerateMipmap = libGLESv2.NewProc("glGenerateMipmap") - glGetActiveAttrib = libGLESv2.NewProc("glGetActiveAttrib") - glGetActiveUniform = libGLESv2.NewProc("glGetActiveUniform") - glGetAttachedShaders = libGLESv2.NewProc("glGetAttachedShaders") - glGetAttribLocation = libGLESv2.NewProc("glGetAttribLocation") - glGetBooleanv = libGLESv2.NewProc("glGetBooleanv") - glGetBufferParameteri = libGLESv2.NewProc("glGetBufferParameteri") - glGetError = libGLESv2.NewProc("glGetError") - glGetFloatv = libGLESv2.NewProc("glGetFloatv") - glGetFramebufferAttachmentParameteriv = libGLESv2.NewProc("glGetFramebufferAttachmentParameteriv") - glGetIntegerv = libGLESv2.NewProc("glGetIntegerv") - glGetProgramInfoLog = libGLESv2.NewProc("glGetProgramInfoLog") - glGetProgramiv = libGLESv2.NewProc("glGetProgramiv") - glGetRenderbufferParameteriv = libGLESv2.NewProc("glGetRenderbufferParameteriv") - glGetShaderInfoLog = libGLESv2.NewProc("glGetShaderInfoLog") - glGetShaderPrecisionFormat = libGLESv2.NewProc("glGetShaderPrecisionFormat") - glGetShaderSource = libGLESv2.NewProc("glGetShaderSource") - glGetShaderiv = libGLESv2.NewProc("glGetShaderiv") - glGetString = libGLESv2.NewProc("glGetString") - glGetTexParameterfv = libGLESv2.NewProc("glGetTexParameterfv") - glGetTexParameteriv = libGLESv2.NewProc("glGetTexParameteriv") - glGetUniformLocation = libGLESv2.NewProc("glGetUniformLocation") - glGetUniformfv = libGLESv2.NewProc("glGetUniformfv") - glGetUniformiv = libGLESv2.NewProc("glGetUniformiv") - glGetVertexAttribfv = libGLESv2.NewProc("glGetVertexAttribfv") - glGetVertexAttribiv = libGLESv2.NewProc("glGetVertexAttribiv") - glHint = libGLESv2.NewProc("glHint") - glIsBuffer = libGLESv2.NewProc("glIsBuffer") - glIsEnabled = libGLESv2.NewProc("glIsEnabled") - glIsFramebuffer = libGLESv2.NewProc("glIsFramebuffer") - glIsProgram = libGLESv2.NewProc("glIsProgram") - glIsRenderbuffer = libGLESv2.NewProc("glIsRenderbuffer") - glIsShader = libGLESv2.NewProc("glIsShader") - glIsTexture = libGLESv2.NewProc("glIsTexture") - glLineWidth = libGLESv2.NewProc("glLineWidth") - glLinkProgram = libGLESv2.NewProc("glLinkProgram") - glPixelStorei = libGLESv2.NewProc("glPixelStorei") - glPolygonOffset = libGLESv2.NewProc("glPolygonOffset") - glReadPixels = libGLESv2.NewProc("glReadPixels") - glReleaseShaderCompiler = libGLESv2.NewProc("glReleaseShaderCompiler") - glRenderbufferStorage = libGLESv2.NewProc("glRenderbufferStorage") - glSampleCoverage = libGLESv2.NewProc("glSampleCoverage") - glScissor = libGLESv2.NewProc("glScissor") - glShaderSource = libGLESv2.NewProc("glShaderSource") - glStencilFunc = libGLESv2.NewProc("glStencilFunc") - glStencilFuncSeparate = libGLESv2.NewProc("glStencilFuncSeparate") - glStencilMask = libGLESv2.NewProc("glStencilMask") - glStencilMaskSeparate = libGLESv2.NewProc("glStencilMaskSeparate") - glStencilOp = libGLESv2.NewProc("glStencilOp") - glStencilOpSeparate = libGLESv2.NewProc("glStencilOpSeparate") - glTexImage2D = libGLESv2.NewProc("glTexImage2D") - glTexParameterf = libGLESv2.NewProc("glTexParameterf") - glTexParameterfv = libGLESv2.NewProc("glTexParameterfv") - glTexParameteri = libGLESv2.NewProc("glTexParameteri") - glTexParameteriv = libGLESv2.NewProc("glTexParameteriv") - glTexSubImage2D = libGLESv2.NewProc("glTexSubImage2D") - glUniform1f = libGLESv2.NewProc("glUniform1f") - glUniform1fv = libGLESv2.NewProc("glUniform1fv") - glUniform1i = libGLESv2.NewProc("glUniform1i") - glUniform1iv = libGLESv2.NewProc("glUniform1iv") - glUniform2f = libGLESv2.NewProc("glUniform2f") - glUniform2fv = libGLESv2.NewProc("glUniform2fv") - glUniform2i = libGLESv2.NewProc("glUniform2i") - glUniform2iv = libGLESv2.NewProc("glUniform2iv") - glUniform3f = libGLESv2.NewProc("glUniform3f") - glUniform3fv = libGLESv2.NewProc("glUniform3fv") - glUniform3i = libGLESv2.NewProc("glUniform3i") - glUniform3iv = libGLESv2.NewProc("glUniform3iv") - glUniform4f = libGLESv2.NewProc("glUniform4f") - glUniform4fv = libGLESv2.NewProc("glUniform4fv") - glUniform4i = libGLESv2.NewProc("glUniform4i") - glUniform4iv = libGLESv2.NewProc("glUniform4iv") - glUniformMatrix2fv = libGLESv2.NewProc("glUniformMatrix2fv") - glUniformMatrix3fv = libGLESv2.NewProc("glUniformMatrix3fv") - glUniformMatrix4fv = libGLESv2.NewProc("glUniformMatrix4fv") - glUseProgram = libGLESv2.NewProc("glUseProgram") - glValidateProgram = libGLESv2.NewProc("glValidateProgram") - glVertexAttrib1f = libGLESv2.NewProc("glVertexAttrib1f") - glVertexAttrib1fv = libGLESv2.NewProc("glVertexAttrib1fv") - glVertexAttrib2f = libGLESv2.NewProc("glVertexAttrib2f") - glVertexAttrib2fv = libGLESv2.NewProc("glVertexAttrib2fv") - glVertexAttrib3f = libGLESv2.NewProc("glVertexAttrib3f") - glVertexAttrib3fv = libGLESv2.NewProc("glVertexAttrib3fv") - glVertexAttrib4f = libGLESv2.NewProc("glVertexAttrib4f") - glVertexAttrib4fv = libGLESv2.NewProc("glVertexAttrib4fv") - glVertexAttribPointer = libGLESv2.NewProc("glVertexAttribPointer") - glViewport = libGLESv2.NewProc("glViewport") + libGLESv2 = LibGLESv2 + glActiveTexture = libGLESv2.NewProc("glActiveTexture") + glAttachShader = libGLESv2.NewProc("glAttachShader") + glBindBuffer = libGLESv2.NewProc("glBindBuffer") + glBindTexture = libGLESv2.NewProc("glBindTexture") + glBindVertexArray = libGLESv2.NewProc("glBindVertexArray") + glBlendColor = libGLESv2.NewProc("glBlendColor") + glBlendFunc = libGLESv2.NewProc("glBlendFunc") + glBufferData = libGLESv2.NewProc("glBufferData") + glClear = libGLESv2.NewProc("glClear") + glClearColor = libGLESv2.NewProc("glClearColor") + glCompileShader = libGLESv2.NewProc("glCompileShader") + glCreateProgram = libGLESv2.NewProc("glCreateProgram") + glCreateShader = libGLESv2.NewProc("glCreateShader") + glDeleteBuffers = libGLESv2.NewProc("glDeleteBuffers") + glDeleteTextures = libGLESv2.NewProc("glDeleteTextures") + glDisable = libGLESv2.NewProc("glDisable") + glDrawArrays = libGLESv2.NewProc("glDrawArrays") + glEnable = libGLESv2.NewProc("glEnable") + glEnableVertexAttribArray = libGLESv2.NewProc("glEnableVertexAttribArray") + glFlush = libGLESv2.NewProc("glFlush") + glGenBuffers = libGLESv2.NewProc("glGenBuffers") + glGenTextures = libGLESv2.NewProc("glGenTextures") + glGenVertexArrays = libGLESv2.NewProc("glGenVertexArrays") + glGetAttribLocation = libGLESv2.NewProc("glGetAttribLocation") + glGetError = libGLESv2.NewProc("glGetError") + glGetShaderInfoLog = libGLESv2.NewProc("glGetShaderInfoLog") + glGetShaderSource = libGLESv2.NewProc("glGetShaderSource") + glGetShaderiv = libGLESv2.NewProc("glGetShaderiv") + glGetTexParameteriv = libGLESv2.NewProc("glGetTexParameteriv") + glGetUniformLocation = libGLESv2.NewProc("glGetUniformLocation") + glLinkProgram = libGLESv2.NewProc("glLinkProgram") + glReadPixels = libGLESv2.NewProc("glReadPixels") + glScissor = libGLESv2.NewProc("glScissor") + glShaderSource = libGLESv2.NewProc("glShaderSource") + glTexImage2D = libGLESv2.NewProc("glTexImage2D") + glTexParameteri = libGLESv2.NewProc("glTexParameteri") + glUniform1f = libGLESv2.NewProc("glUniform1f") + glUniform4f = libGLESv2.NewProc("glUniform4f") + glUniform4fv = libGLESv2.NewProc("glUniform4fv") + glUseProgram = libGLESv2.NewProc("glUseProgram") + glVertexAttribPointer = libGLESv2.NewProc("glVertexAttribPointer") + glViewport = libGLESv2.NewProc("glViewport") )