diff --git a/internal/driver/mobile/app/android.go b/internal/driver/mobile/app/android.go index a7b90bd79c..cf0b8ccd98 100644 --- a/internal/driver/mobile/app/android.go +++ b/internal/driver/mobile/app/android.go @@ -60,13 +60,12 @@ import ( "time" "unsafe" - "fyne.io/fyne/v2/internal/driver/mobile/app/internal/callfn" + "fyne.io/fyne/v2/internal/driver/mobile/app/callfn" "fyne.io/fyne/v2/internal/driver/mobile/event/key" "fyne.io/fyne/v2/internal/driver/mobile/event/lifecycle" "fyne.io/fyne/v2/internal/driver/mobile/event/paint" "fyne.io/fyne/v2/internal/driver/mobile/event/size" "fyne.io/fyne/v2/internal/driver/mobile/event/touch" - "fyne.io/fyne/v2/internal/driver/mobile/geom" "fyne.io/fyne/v2/internal/driver/mobile/mobileinit" ) @@ -448,8 +447,8 @@ func mainUI(vm, jniEnv, ctx uintptr) error { theApp.eventsIn <- size.Event{ WidthPx: widthPx, HeightPx: heightPx, - WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt), - HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt), + WidthPt: float32(widthPx) / pixelsPerPt, + HeightPt: float32(heightPx) / pixelsPerPt, InsetTopPx: screenInsetTop, InsetBottomPx: screenInsetBottom, InsetLeftPx: screenInsetLeft, diff --git a/internal/driver/mobile/app/internal/callfn/callfn.go b/internal/driver/mobile/app/callfn/callfn.go similarity index 100% rename from internal/driver/mobile/app/internal/callfn/callfn.go rename to internal/driver/mobile/app/callfn/callfn.go diff --git a/internal/driver/mobile/app/internal/callfn/callfn_386.s b/internal/driver/mobile/app/callfn/callfn_386.s similarity index 100% rename from internal/driver/mobile/app/internal/callfn/callfn_386.s rename to internal/driver/mobile/app/callfn/callfn_386.s diff --git a/internal/driver/mobile/app/internal/callfn/callfn_amd64.s b/internal/driver/mobile/app/callfn/callfn_amd64.s similarity index 100% rename from internal/driver/mobile/app/internal/callfn/callfn_amd64.s rename to internal/driver/mobile/app/callfn/callfn_amd64.s diff --git a/internal/driver/mobile/app/internal/callfn/callfn_arm.s b/internal/driver/mobile/app/callfn/callfn_arm.s similarity index 100% rename from internal/driver/mobile/app/internal/callfn/callfn_arm.s rename to internal/driver/mobile/app/callfn/callfn_arm.s diff --git a/internal/driver/mobile/app/internal/callfn/callfn_arm64.s b/internal/driver/mobile/app/callfn/callfn_arm64.s similarity index 100% rename from internal/driver/mobile/app/internal/callfn/callfn_arm64.s rename to internal/driver/mobile/app/callfn/callfn_arm64.s diff --git a/internal/driver/mobile/app/darwin_desktop.go b/internal/driver/mobile/app/darwin_desktop.go index 073946f1a6..22f82a81b2 100644 --- a/internal/driver/mobile/app/darwin_desktop.go +++ b/internal/driver/mobile/app/darwin_desktop.go @@ -34,7 +34,6 @@ import ( "fyne.io/fyne/v2/internal/driver/mobile/event/paint" "fyne.io/fyne/v2/internal/driver/mobile/event/size" "fyne.io/fyne/v2/internal/driver/mobile/event/touch" - "fyne.io/fyne/v2/internal/driver/mobile/geom" ) var initThreadID uint64 @@ -134,8 +133,8 @@ func setGeom(pixelsPerPt float32, widthPx, heightPx int) { theApp.eventsIn <- size.Event{ WidthPx: widthPx, HeightPx: heightPx, - WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt), - HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt), + WidthPt: float32(widthPx) / pixelsPerPt, + HeightPt: float32(heightPx) / pixelsPerPt, PixelsPerPt: pixelsPerPt, Orientation: screenOrientation(widthPx, heightPx), } diff --git a/internal/driver/mobile/app/darwin_ios.go b/internal/driver/mobile/app/darwin_ios.go index a12bcbabfc..98a6101060 100644 --- a/internal/driver/mobile/app/darwin_ios.go +++ b/internal/driver/mobile/app/darwin_ios.go @@ -46,7 +46,6 @@ import ( "fyne.io/fyne/v2/internal/driver/mobile/event/paint" "fyne.io/fyne/v2/internal/driver/mobile/event/size" "fyne.io/fyne/v2/internal/driver/mobile/event/touch" - "fyne.io/fyne/v2/internal/driver/mobile/geom" ) var initThreadID uint64 @@ -136,8 +135,8 @@ func updateConfig(width, height, orientation int32) { theApp.eventsIn <- size.Event{ WidthPx: int(width), HeightPx: int(height), - WidthPt: geom.Pt(float32(width) / pixelsPerPt), - HeightPt: geom.Pt(float32(height) / pixelsPerPt), + WidthPt: float32(width) / pixelsPerPt, + HeightPt: float32(height) / pixelsPerPt, InsetTopPx: int(float32(insets.top) * float32(screenScale)), InsetBottomPx: int(float32(insets.bottom) * float32(screenScale)), InsetLeftPx: int(float32(insets.left) * float32(screenScale)), diff --git a/internal/driver/mobile/app/x11.go b/internal/driver/mobile/app/x11.go index dc710b6052..9eaf3c35ad 100644 --- a/internal/driver/mobile/app/x11.go +++ b/internal/driver/mobile/app/x11.go @@ -28,7 +28,6 @@ import ( "fyne.io/fyne/v2/internal/driver/mobile/event/paint" "fyne.io/fyne/v2/internal/driver/mobile/event/size" "fyne.io/fyne/v2/internal/driver/mobile/event/touch" - "fyne.io/fyne/v2/internal/driver/mobile/geom" ) func init() { @@ -87,8 +86,8 @@ func onResize(w, h int) { theApp.eventsIn <- size.Event{ WidthPx: w, HeightPx: h, - WidthPt: geom.Pt(w), - HeightPt: geom.Pt(h), + WidthPt: float32(w), + HeightPt: float32(h), PixelsPerPt: pixelsPerPt, Orientation: screenOrientation(w, h), } diff --git a/internal/driver/mobile/event/size/size.go b/internal/driver/mobile/event/size/size.go index 664038e9c4..3e951ee71b 100644 --- a/internal/driver/mobile/event/size/size.go +++ b/internal/driver/mobile/event/size/size.go @@ -10,8 +10,6 @@ package size // import "fyne.io/fyne/v2/internal/driver/mobile/event/size" import ( "image" - - "fyne.io/fyne/v2/internal/driver/mobile/geom" ) // Event holds the dimensions, physical resolution and orientation of the app's @@ -25,14 +23,14 @@ type Event struct { // // The values are based on PixelsPerPt and are therefore approximate, as // per the comment on PixelsPerPt. - WidthPt, HeightPt geom.Pt + WidthPt, HeightPt float32 // PixelsPerPt is the window's physical resolution. It is the number of - // pixels in a single geom.Pt, from the golang.org/x/mobile/geom package. + // pixels in a single float32. // // There are a wide variety of pixel densities in existing phones and // tablets, so apps should be written to expect various non-integer - // PixelsPerPt values. In general, work in geom.Pt. + // PixelsPerPt values. // // The value is approximate, in that the OS, drivers or hardware may report // approximate or quantized values. An N x N pixel square should be roughly diff --git a/internal/driver/mobile/geom/geom.go b/internal/driver/mobile/geom/geom.go deleted file mode 100644 index 83b76b2a4d..0000000000 --- a/internal/driver/mobile/geom/geom.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package geom defines a two-dimensional coordinate system. - -The coordinate system is based on an left-handed Cartesian plane. -That is, X increases to the right and Y increases down. For (x,y), - - (0,0) → (1,0) - ↓ ↘ - (0,1) (1,1) - -The display window places the origin (0, 0) in the upper-left corner of -the screen. Positions on the plane are measured in typographic points, -1/72 of an inch, which is represented by the Pt type. - -Any interface that draws to the screen using types from the geom package -scales the number of pixels to maintain a Pt as 1/72 of an inch. -*/ -package geom // import "fyne.io/fyne/v2/internal/driver/mobile/geom" - -/* -Notes on the various underlying coordinate systems. - -Both Android and iOS (UIKit) use upper-left-origin coordinate systems -with for events, however they have different units. - -UIKit measures distance in points. A point is a single-pixel on a -pre-Retina display. UIKit maintains a scale factor that to turn points -into pixels. On current retina devices, the scale factor is 2.0. - -A UIKit point does not correspond to a fixed physical distance, as the -iPhone has a 163 DPI/PPI (326 PPI retina) display, and the iPad has a -132 PPI (264 retina) display. Points are 32-bit floats. - -Even though point is the official UIKit term, they are commonly called -pixels. Indeed, the units were equivalent until the retina display was -introduced. - -N.b. as a UIKit point is unrelated to a typographic point, it is not -related to this packages's Pt and Point types. - -More details about iOS drawing: - -https://developer.apple.com/library/ios/documentation/2ddrawing/conceptual/drawingprintingios/GraphicsDrawingOverview/GraphicsDrawingOverview.html - -Android uses pixels. Sub-pixel precision is possible, so pixels are -represented as 32-bit floats. The ACONFIGURATION_DENSITY enum provides -the screen DPI/PPI, which varies frequently between devices. - -It would be tempting to adopt the pixel, given the clear pixel/DPI split -in the core android events API. However, the plot thickens: - -http://developer.android.com/training/multiscreen/screendensities.html - -Android promotes the notion of a density-independent pixel in many of -their interfaces, often prefixed by "dp". 1dp is a real physical length, -as "independent" means it is assumed to be 1/160th of an inch and is -adjusted for the current screen. - -In addition, android has a scale-indepdendent pixel used for expressing -a user's preferred text size. The user text size preference is a useful -notion not yet expressed in the geom package. - -For the sake of clarity when working across platforms, the geom package -tries to put distance between it and the word pixel. -*/ - -import "fmt" - -// Pt is a length. -// -// The unit Pt is a typographical point, 1/72 of an inch (0.3527 mm). -// -// It can be be converted to a length in current device pixels by -// multiplying with PixelsPerPt after app initialization is complete. -type Pt float32 - -// Px converts the length to current device pixels. -func (p Pt) Px(pixelsPerPt float32) float32 { return float32(p) * pixelsPerPt } - -// String returns a string representation of p like "3.2pt". -func (p Pt) String() string { return fmt.Sprintf("%.2fpt", p) } - -// Point is a point in a two-dimensional plane. -type Point struct { - X, Y Pt -} - -// String returns a string representation of p like "(1.2,3.4)". -func (p Point) String() string { return fmt.Sprintf("(%.2f,%.2f)", p.X, p.Y) } - -// A Rectangle is region of points. -// The top-left point is Min, and the bottom-right point is Max. -type Rectangle struct { - Min, Max Point -} - -// String returns a string representation of r like "(3,4)-(6,5)". -func (r Rectangle) String() string { return r.Min.String() + "-" + r.Max.String() } diff --git a/internal/driver/mobile/gl/doc.go b/internal/driver/mobile/gl/doc.go index e69d693cc0..584800c1f5 100644 --- a/internal/driver/mobile/gl/doc.go +++ b/internal/driver/mobile/gl/doc.go @@ -21,26 +21,6 @@ https://www.khronos.org/opengles/sdk/docs/man/ One notable departure from the C API is the introduction of types to represent common uses of GLint: Texture, Surface, Buffer, etc. - -Debug Logging - -A tracing version of the OpenGL bindings is behind the `gldebug` build -tag. It acts as a simplified version of apitrace. Build your Go binary -with - - -tags gldebug - -and each call to a GL function will log its input, output, and any -error messages. For example, - - I/Fyne (27668): gl.GenBuffers(1) [Buffer(70001)] - I/Fyne (27668): gl.BindBuffer(ARRAY_BUFFER, Buffer(70001)) - I/Fyne (27668): gl.BufferData(ARRAY_BUFFER, 36, len(36), STATIC_DRAW) - I/Fyne (27668): gl.BindBuffer(ARRAY_BUFFER, Buffer(70001)) - I/Fyne (27668): gl.VertexAttribPointer(Attrib(0), 6, FLOAT, false, 0, 0) error: [INVALID_VALUE] - -The gldebug tracing has very high overhead, so make sure to remove -the build tag before deploying any binaries. */ package gl // import "fyne.io/fyne/v2/internal/driver/mobile/gl" @@ -62,5 +42,3 @@ For the purpose of analyzing this code for race conditions, picture two separate goroutines: one blocked on gl.Start, and another making calls to the gl package exported functions. */ - -//go:generate go run gendebug.go -o gldebug.go diff --git a/internal/driver/mobile/gl/fn.go b/internal/driver/mobile/gl/fn.go index 066c3a2ada..8025024cee 100644 --- a/internal/driver/mobile/gl/fn.go +++ b/internal/driver/mobile/gl/fn.go @@ -33,164 +33,46 @@ 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 - glfnDeleteVertexArray - 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 - - // ES 3.0 functions - glfnUniformMatrix2x3fv - glfnUniformMatrix3x2fv - glfnUniformMatrix2x4fv - glfnUniformMatrix4x2fv - glfnUniformMatrix3x4fv - glfnUniformMatrix4x3fv - glfnBlitFramebuffer - glfnUniform1ui - glfnUniform2ui - glfnUniform3ui - glfnUniform4ui - glfnUniform1uiv - glfnUniform2uiv - glfnUniform3uiv - glfnUniform4uiv ) func goString(buf []byte) string { diff --git a/internal/driver/mobile/gl/gl.go b/internal/driver/mobile/gl/gl.go index 5a2c904916..f49e2ae813 100644 --- a/internal/driver/mobile/gl/gl.go +++ b/internal/driver/mobile/gl/gl.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. // +build darwin linux openbsd freebsd windows -// +build !gldebug package gl @@ -36,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{ @@ -59,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{ @@ -111,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{ @@ -140,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 { @@ -169,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{ @@ -225,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{ @@ -264,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{ @@ -340,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, @@ -361,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{ @@ -397,711 +180,172 @@ func (ctx *context) CreateVertexArray() VertexArray { blocking: true, }))} } - -func (ctx *context) CullFace(mode Enum) { +func (ctx *context) DeleteBuffer(v Buffer) { ctx.enqueue(call{ args: fnargs{ - fn: glfnCullFace, - a0: mode.c(), + fn: glfnDeleteBuffer, + a0: v.c(), }, }) } -func (ctx *context) DeleteBuffer(v Buffer) { +func (ctx *context) DeleteTexture(v Texture) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteBuffer, + fn: glfnDeleteTexture, a0: v.c(), }, }) } -func (ctx *context) DeleteFramebuffer(v Framebuffer) { +func (ctx *context) Disable(cap Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteFramebuffer, - a0: v.c(), + fn: glfnDisable, + a0: cap.c(), }, }) } -func (ctx *context) DeleteProgram(p Program) { +func (ctx *context) DrawArrays(mode Enum, first, count int) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteProgram, - a0: p.c(), + fn: glfnDrawArrays, + a0: mode.c(), + a1: uintptr(first), + a2: uintptr(count), }, }) } - -func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { +func (ctx *context) Enable(cap Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteRenderbuffer, - a0: v.c(), + fn: glfnEnable, + a0: cap.c(), }, }) } -func (ctx *context) DeleteShader(s Shader) { +func (ctx *context) EnableVertexAttribArray(a Attrib) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteShader, - a0: s.c(), + fn: glfnEnableVertexAttribArray, + a0: a.c(), }, }) } -func (ctx *context) DeleteTexture(v Texture) { +func (ctx *context) Flush() { ctx.enqueue(call{ args: fnargs{ - fn: glfnDeleteTexture, - a0: v.c(), + fn: glfnFlush, }, + blocking: true, }) } -func (ctx *context) DeleteVertexArray(v VertexArray) { - 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: glfnDeleteVertexArray, - a0: v.c(), + fn: glfnGetAttribLocation, + a0: p.c(), + a1: s, }, - }) + blocking: true, + }))} } -func (ctx *context) DepthFunc(fn Enum) { - ctx.enqueue(call{ +func (ctx *context) GetError() Enum { + return Enum(ctx.enqueue(call{ args: fnargs{ - fn: glfnDepthFunc, - a0: fn.c(), + fn: glfnGetError, }, - }) + blocking: true, + })) } -func (ctx *context) DepthMask(flag bool) { - ctx.enqueue(call{ +func (ctx *context) GetShaderi(s Shader, pname Enum) int { + return int(ctx.enqueue(call{ args: fnargs{ - fn: glfnDepthMask, - a0: glBoolean(flag), + fn: glfnGetShaderiv, + a0: s.c(), + a1: pname.c(), }, - }) + blocking: true, + })) } -func (ctx *context) DepthRangef(n, f float32) { +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: glfnDepthRangef, - a0: uintptr(math.Float32bits(n)), - a1: uintptr(math.Float32bits(f)), + fn: glfnGetShaderInfoLog, + a0: s.c(), + a1: uintptr(infoLen), }, + parg: unsafe.Pointer(&buf[0]), + blocking: true, }) + + return goString(buf) } -func (ctx *context) DetachShader(p Program, s Shader) { +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: glfnDetachShader, - a0: p.c(), - a1: s.c(), + fn: glfnGetShaderSource, + a0: s.c(), + a1: uintptr(sourceLen), }, + parg: unsafe.Pointer(&buf[0]), + blocking: true, }) + + return goString(buf) } -func (ctx *context) Disable(cap Enum) { +func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDisable, - a0: cap.c(), + fn: glfnGetTexParameteriv, + a0: target.c(), + a1: pname.c(), }, + blocking: true, }) } -func (ctx *context) DisableVertexAttribArray(a Attrib) { - 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: glfnDisableVertexAttribArray, - a0: a.c(), + fn: glfnGetUniformLocation, + a0: p.c(), + a1: s, }, - }) + blocking: true, + }))} } -func (ctx *context) DrawArrays(mode Enum, first, count int) { +func (ctx *context) LinkProgram(p Program) { ctx.enqueue(call{ args: fnargs{ - fn: glfnDrawArrays, - a0: mode.c(), - a1: uintptr(first), - a2: uintptr(count), - }, - }) -} - -func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDrawElements, - a0: mode.c(), - a1: uintptr(count), - a2: ty.c(), - a3: uintptr(offset), - }, - }) -} - -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) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnLinkProgram, - a0: p.c(), - }, - }) -} - -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)), + fn: glfnLinkProgram, + a0: p.c(), }, }) } @@ -1109,425 +353,108 @@ func (ctx *context) PolygonOffset(factor, units float32) { func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { ctx.enqueue(call{ args: fnargs{ - fn: glfnReadPixels, - // TODO(crawshaw): support PIXEL_PACK_BUFFER in GLES3, uses offset. - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - a4: format.c(), - a5: ty.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -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{ - fn: glfnScissor, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - }) -} - -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) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilOpSeparate, - a0: face.c(), - a1: sfail.c(), - a2: dpfail.c(), - a3: dppass.c(), - }, - }) -} - -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 - // is not necessary to block. - parg := unsafe.Pointer(nil) - if len(data) > 0 { - parg = unsafe.Pointer(&data[0]) - } - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexImage2D, - // TODO(crawshaw): GLES3 offset for PIXEL_UNPACK_BUFFER and PIXEL_PACK_BUFFER. - a0: target.c(), - a1: uintptr(level), - a2: uintptr(internalFormat), - a3: uintptr(width), - a4: uintptr(height), - a5: format.c(), - a6: ty.c(), - }, - parg: parg, - blocking: parg != nil, - }) -} - -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{ - fn: glfnTexParameteri, - a0: target.c(), - a1: pname.c(), - a2: uintptr(param), - }, - }) -} - -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{ - fn: glfnUniform1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v)), - }, - }) -} - -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), + fn: glfnReadPixels, + // TODO(crawshaw): support PIXEL_PACK_BUFFER in GLES3, uses offset. + a0: uintptr(x), + a1: uintptr(y), + a2: uintptr(width), + a3: uintptr(height), + a4: format.c(), + a5: ty.c(), }, - parg: unsafe.Pointer(&src[0]), + parg: unsafe.Pointer(&dst[0]), blocking: true, }) } -func (ctx *context) Uniform3i(dst Uniform, v0, v1, v2 int32) { +func (ctx *context) Scissor(x, y, width, height int32) { ctx.enqueue(call{ args: fnargs{ - fn: glfnUniform3i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), + fn: glfnScissor, + a0: uintptr(x), + a1: uintptr(y), + a2: uintptr(width), + a3: uintptr(height), }, }) } -func (ctx *context) Uniform3iv(dst Uniform, src []int32) { +func (ctx *context) ShaderSource(s Shader, src string) { + strp, free := ctx.cStringPtr(src) + defer free() ctx.enqueue(call{ args: fnargs{ - fn: glfnUniform3iv, - a0: dst.c(), - a1: uintptr(len(src) / 3), + fn: glfnShaderSource, + a0: s.c(), + a1: 1, + a2: strp, }, - parg: unsafe.Pointer(&src[0]), 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 + // is not necessary to block. + parg := unsafe.Pointer(nil) + if len(data) > 0 { + parg = unsafe.Pointer(&data[0]) + } -func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { ctx.enqueue(call{ args: fnargs{ - fn: glfnUniform4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - a4: uintptr(math.Float32bits(v3)), + fn: glfnTexImage2D, + // TODO(crawshaw): GLES3 offset for PIXEL_UNPACK_BUFFER and PIXEL_PACK_BUFFER. + a0: target.c(), + a1: uintptr(level), + a2: uintptr(internalFormat), + a3: uintptr(width), + a4: uintptr(height), + a5: format.c(), + a6: ty.c(), }, + parg: parg, + blocking: parg != nil, }) } -func (ctx *context) Uniform4fv(dst Uniform, src []float32) { +func (ctx *context) TexParameteri(target, pname Enum, param int) { ctx.enqueue(call{ args: fnargs{ - fn: glfnUniform4fv, - a0: dst.c(), - a1: uintptr(len(src) / 4), + fn: glfnTexParameteri, + a0: target.c(), + a1: pname.c(), + a2: uintptr(param), }, - parg: unsafe.Pointer(&src[0]), - blocking: true, }) } -func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { +func (ctx *context) Uniform1f(dst Uniform, v float32) { ctx.enqueue(call{ args: fnargs{ - fn: glfnUniform4i, + fn: glfnUniform1f, a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), + a1: uintptr(math.Float32bits(v)), }, }) } - -func (ctx *context) Uniform4iv(dst Uniform, src []int32) { +func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { ctx.enqueue(call{ args: fnargs{ - fn: glfnUniform4iv, + fn: glfnUniform4f, a0: dst.c(), - a1: uintptr(len(src) / 4), + a1: uintptr(math.Float32bits(v0)), + a2: uintptr(math.Float32bits(v1)), + a3: uintptr(math.Float32bits(v2)), + a4: uintptr(math.Float32bits(v3)), }, - parg: unsafe.Pointer(&src[0]), - blocking: true, }) } -func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { +func (ctx *context) Uniform4fv(dst Uniform, src []float32) { ctx.enqueue(call{ args: fnargs{ - fn: glfnUniformMatrix2fv, - // OpenGL ES 2 does not support transpose. + fn: glfnUniform4fv, a0: dst.c(), a1: uintptr(len(src) / 4), }, @@ -1536,30 +463,6 @@ func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { }) } -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{ @@ -1569,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{ @@ -1693,139 +497,3 @@ func (ctx *context) Viewport(x, y, width, height int) { }, }) } - -func (ctx context3) UniformMatrix2x3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix2x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix3x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix2x4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix2x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix4x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix3x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix4x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlitFramebuffer, - a0: uintptr(srcX0), - a1: uintptr(srcY0), - a2: uintptr(srcX1), - a3: uintptr(srcY1), - a4: uintptr(dstX0), - a5: uintptr(dstY0), - a6: uintptr(dstX1), - a7: uintptr(dstY1), - a8: uintptr(mask), - a9: filter.c(), - }, - }) -} - -func (ctx context3) Uniform1ui(dst Uniform, v uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1ui, - a0: dst.c(), - a1: uintptr(v), - }, - }) -} - -func (ctx context3) Uniform2ui(dst Uniform, v0, v1 uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - }) -} - -func (ctx context3) Uniform3ui(dst Uniform, v0, v1, v2 uint) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - }) -} - -func (ctx context3) Uniform4ui(dst Uniform, v0, v1, v2, v3 uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - }) -} diff --git a/internal/driver/mobile/gl/gldebug.go b/internal/driver/mobile/gl/gldebug.go deleted file mode 100644 index b10ac1e07a..0000000000 --- a/internal/driver/mobile/gl/gldebug.go +++ /dev/null @@ -1,3068 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated from gl.go using go generate. DO NOT EDIT. -// See doc.go for details. - -// +build darwin linux openbsd freebsd windows -// +build gldebug - -package gl - -import ( - "fmt" - "log" - "math" - "sync/atomic" - "unsafe" -) - -func (ctx *context) errDrain() string { - var errs []Enum - for { - e := ctx.GetError() - if e == 0 { - break - } - errs = append(errs, e) - } - if len(errs) > 0 { - return fmt.Sprintf(" error: %v", errs) - } - return "" -} - -func (ctx *context) enqueueDebug(c call) uintptr { - numCalls := atomic.AddInt32(&ctx.debug, 1) - if numCalls > 1 { - panic("concurrent calls made to the same GL context") - } - defer func() { - if atomic.AddInt32(&ctx.debug, -1) > 0 { - select {} // block so you see us in the panic - } - }() - - return ctx.enqueue(c) -} - -var enumString = map[Enum]string{ - 0x0: "0", - 0x1: "1", - 0x2: "2", - 0x3: "LINE_STRIP", - 0x4: "4", - 0x5: "TRIANGLE_STRIP", - 0x6: "TRIANGLE_FAN", - 0x300: "SRC_COLOR", - 0x301: "ONE_MINUS_SRC_COLOR", - 0x302: "SRC_ALPHA", - 0x303: "ONE_MINUS_SRC_ALPHA", - 0x304: "DST_ALPHA", - 0x305: "ONE_MINUS_DST_ALPHA", - 0x306: "DST_COLOR", - 0x307: "ONE_MINUS_DST_COLOR", - 0x308: "SRC_ALPHA_SATURATE", - 0x8006: "FUNC_ADD", - 0x8009: "32777", - 0x883d: "BLEND_EQUATION_ALPHA", - 0x800a: "FUNC_SUBTRACT", - 0x800b: "FUNC_REVERSE_SUBTRACT", - 0x80c8: "BLEND_DST_RGB", - 0x80c9: "BLEND_SRC_RGB", - 0x80ca: "BLEND_DST_ALPHA", - 0x80cb: "BLEND_SRC_ALPHA", - 0x8001: "CONSTANT_COLOR", - 0x8002: "ONE_MINUS_CONSTANT_COLOR", - 0x8003: "CONSTANT_ALPHA", - 0x8004: "ONE_MINUS_CONSTANT_ALPHA", - 0x8005: "BLEND_COLOR", - 0x8892: "ARRAY_BUFFER", - 0x8893: "ELEMENT_ARRAY_BUFFER", - 0x8894: "ARRAY_BUFFER_BINDING", - 0x8895: "ELEMENT_ARRAY_BUFFER_BINDING", - 0x88e0: "STREAM_DRAW", - 0x88e4: "STATIC_DRAW", - 0x88e8: "DYNAMIC_DRAW", - 0x8764: "BUFFER_SIZE", - 0x8765: "BUFFER_USAGE", - 0x8626: "CURRENT_VERTEX_ATTRIB", - 0x404: "FRONT", - 0x405: "BACK", - 0x408: "FRONT_AND_BACK", - 0xde1: "TEXTURE_2D", - 0xb44: "CULL_FACE", - 0xbe2: "BLEND", - 0xbd0: "DITHER", - 0xb90: "STENCIL_TEST", - 0xb71: "DEPTH_TEST", - 0xc11: "SCISSOR_TEST", - 0x8037: "POLYGON_OFFSET_FILL", - 0x809e: "SAMPLE_ALPHA_TO_COVERAGE", - 0x80a0: "SAMPLE_COVERAGE", - 0x500: "INVALID_ENUM", - 0x501: "INVALID_VALUE", - 0x502: "INVALID_OPERATION", - 0x505: "OUT_OF_MEMORY", - 0x900: "CW", - 0x901: "CCW", - 0xb21: "LINE_WIDTH", - 0x846d: "ALIASED_POINT_SIZE_RANGE", - 0x846e: "ALIASED_LINE_WIDTH_RANGE", - 0xb45: "CULL_FACE_MODE", - 0xb46: "FRONT_FACE", - 0xb70: "DEPTH_RANGE", - 0xb72: "DEPTH_WRITEMASK", - 0xb73: "DEPTH_CLEAR_VALUE", - 0xb74: "DEPTH_FUNC", - 0xb91: "STENCIL_CLEAR_VALUE", - 0xb92: "STENCIL_FUNC", - 0xb94: "STENCIL_FAIL", - 0xb95: "STENCIL_PASS_DEPTH_FAIL", - 0xb96: "STENCIL_PASS_DEPTH_PASS", - 0xb97: "STENCIL_REF", - 0xb93: "STENCIL_VALUE_MASK", - 0xb98: "STENCIL_WRITEMASK", - 0x8800: "STENCIL_BACK_FUNC", - 0x8801: "STENCIL_BACK_FAIL", - 0x8802: "STENCIL_BACK_PASS_DEPTH_FAIL", - 0x8803: "STENCIL_BACK_PASS_DEPTH_PASS", - 0x8ca3: "STENCIL_BACK_REF", - 0x8ca4: "STENCIL_BACK_VALUE_MASK", - 0x8ca5: "STENCIL_BACK_WRITEMASK", - 0xba2: "VIEWPORT", - 0xc10: "SCISSOR_BOX", - 0xc22: "COLOR_CLEAR_VALUE", - 0xc23: "COLOR_WRITEMASK", - 0xcf5: "UNPACK_ALIGNMENT", - 0xd05: "PACK_ALIGNMENT", - 0xd33: "MAX_TEXTURE_SIZE", - 0xd3a: "MAX_VIEWPORT_DIMS", - 0xd50: "SUBPIXEL_BITS", - 0xd52: "RED_BITS", - 0xd53: "GREEN_BITS", - 0xd54: "BLUE_BITS", - 0xd55: "ALPHA_BITS", - 0xd56: "DEPTH_BITS", - 0xd57: "STENCIL_BITS", - 0x2a00: "POLYGON_OFFSET_UNITS", - 0x8038: "POLYGON_OFFSET_FACTOR", - 0x8069: "TEXTURE_BINDING_2D", - 0x80a8: "SAMPLE_BUFFERS", - 0x80a9: "SAMPLES", - 0x80aa: "SAMPLE_COVERAGE_VALUE", - 0x80ab: "SAMPLE_COVERAGE_INVERT", - 0x86a2: "NUM_COMPRESSED_TEXTURE_FORMATS", - 0x86a3: "COMPRESSED_TEXTURE_FORMATS", - 0x1100: "DONT_CARE", - 0x1101: "FASTEST", - 0x1102: "NICEST", - 0x8192: "GENERATE_MIPMAP_HINT", - 0x1400: "BYTE", - 0x1401: "UNSIGNED_BYTE", - 0x1402: "SHORT", - 0x1403: "UNSIGNED_SHORT", - 0x1404: "INT", - 0x1405: "UNSIGNED_INT", - 0x1406: "FLOAT", - 0x140c: "FIXED", - 0x1902: "DEPTH_COMPONENT", - 0x1906: "ALPHA", - 0x1907: "RGB", - 0x1908: "RGBA", - 0x1909: "LUMINANCE", - 0x190a: "LUMINANCE_ALPHA", - 0x8033: "UNSIGNED_SHORT_4_4_4_4", - 0x8034: "UNSIGNED_SHORT_5_5_5_1", - 0x8363: "UNSIGNED_SHORT_5_6_5", - 0x8869: "MAX_VERTEX_ATTRIBS", - 0x8dfb: "MAX_VERTEX_UNIFORM_VECTORS", - 0x8dfc: "MAX_VARYING_VECTORS", - 0x8b4d: "MAX_COMBINED_TEXTURE_IMAGE_UNITS", - 0x8b4c: "MAX_VERTEX_TEXTURE_IMAGE_UNITS", - 0x8872: "MAX_TEXTURE_IMAGE_UNITS", - 0x8dfd: "MAX_FRAGMENT_UNIFORM_VECTORS", - 0x8b4f: "SHADER_TYPE", - 0x8b80: "DELETE_STATUS", - 0x8b82: "LINK_STATUS", - 0x8b83: "VALIDATE_STATUS", - 0x8b85: "ATTACHED_SHADERS", - 0x8b86: "ACTIVE_UNIFORMS", - 0x8b87: "ACTIVE_UNIFORM_MAX_LENGTH", - 0x8b89: "ACTIVE_ATTRIBUTES", - 0x8b8a: "ACTIVE_ATTRIBUTE_MAX_LENGTH", - 0x8b8c: "SHADING_LANGUAGE_VERSION", - 0x8b8d: "CURRENT_PROGRAM", - 0x200: "NEVER", - 0x201: "LESS", - 0x202: "EQUAL", - 0x203: "LEQUAL", - 0x204: "GREATER", - 0x205: "NOTEQUAL", - 0x206: "GEQUAL", - 0x207: "ALWAYS", - 0x1e00: "KEEP", - 0x1e01: "REPLACE", - 0x1e02: "INCR", - 0x1e03: "DECR", - 0x150a: "INVERT", - 0x8507: "INCR_WRAP", - 0x8508: "DECR_WRAP", - 0x1f00: "VENDOR", - 0x1f01: "RENDERER", - 0x1f02: "VERSION", - 0x1f03: "EXTENSIONS", - 0x2600: "NEAREST", - 0x2601: "LINEAR", - 0x2700: "NEAREST_MIPMAP_NEAREST", - 0x2701: "LINEAR_MIPMAP_NEAREST", - 0x2702: "NEAREST_MIPMAP_LINEAR", - 0x2703: "LINEAR_MIPMAP_LINEAR", - 0x2800: "TEXTURE_MAG_FILTER", - 0x2801: "TEXTURE_MIN_FILTER", - 0x2802: "TEXTURE_WRAP_S", - 0x2803: "TEXTURE_WRAP_T", - 0x1702: "TEXTURE", - 0x8513: "TEXTURE_CUBE_MAP", - 0x8514: "TEXTURE_BINDING_CUBE_MAP", - 0x8515: "TEXTURE_CUBE_MAP_POSITIVE_X", - 0x8516: "TEXTURE_CUBE_MAP_NEGATIVE_X", - 0x8517: "TEXTURE_CUBE_MAP_POSITIVE_Y", - 0x8518: "TEXTURE_CUBE_MAP_NEGATIVE_Y", - 0x8519: "TEXTURE_CUBE_MAP_POSITIVE_Z", - 0x851a: "TEXTURE_CUBE_MAP_NEGATIVE_Z", - 0x851c: "MAX_CUBE_MAP_TEXTURE_SIZE", - 0x84c0: "TEXTURE0", - 0x84c1: "TEXTURE1", - 0x84c2: "TEXTURE2", - 0x84c3: "TEXTURE3", - 0x84c4: "TEXTURE4", - 0x84c5: "TEXTURE5", - 0x84c6: "TEXTURE6", - 0x84c7: "TEXTURE7", - 0x84c8: "TEXTURE8", - 0x84c9: "TEXTURE9", - 0x84ca: "TEXTURE10", - 0x84cb: "TEXTURE11", - 0x84cc: "TEXTURE12", - 0x84cd: "TEXTURE13", - 0x84ce: "TEXTURE14", - 0x84cf: "TEXTURE15", - 0x84d0: "TEXTURE16", - 0x84d1: "TEXTURE17", - 0x84d2: "TEXTURE18", - 0x84d3: "TEXTURE19", - 0x84d4: "TEXTURE20", - 0x84d5: "TEXTURE21", - 0x84d6: "TEXTURE22", - 0x84d7: "TEXTURE23", - 0x84d8: "TEXTURE24", - 0x84d9: "TEXTURE25", - 0x84da: "TEXTURE26", - 0x84db: "TEXTURE27", - 0x84dc: "TEXTURE28", - 0x84dd: "TEXTURE29", - 0x84de: "TEXTURE30", - 0x84df: "TEXTURE31", - 0x84e0: "ACTIVE_TEXTURE", - 0x2901: "REPEAT", - 0x812f: "CLAMP_TO_EDGE", - 0x8370: "MIRRORED_REPEAT", - 0x8622: "VERTEX_ATTRIB_ARRAY_ENABLED", - 0x8623: "VERTEX_ATTRIB_ARRAY_SIZE", - 0x8624: "VERTEX_ATTRIB_ARRAY_STRIDE", - 0x8625: "VERTEX_ATTRIB_ARRAY_TYPE", - 0x886a: "VERTEX_ATTRIB_ARRAY_NORMALIZED", - 0x8645: "VERTEX_ATTRIB_ARRAY_POINTER", - 0x889f: "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", - 0x8b9a: "IMPLEMENTATION_COLOR_READ_TYPE", - 0x8b9b: "IMPLEMENTATION_COLOR_READ_FORMAT", - 0x8b81: "COMPILE_STATUS", - 0x8b84: "INFO_LOG_LENGTH", - 0x8b88: "SHADER_SOURCE_LENGTH", - 0x8dfa: "SHADER_COMPILER", - 0x8df8: "SHADER_BINARY_FORMATS", - 0x8df9: "NUM_SHADER_BINARY_FORMATS", - 0x8df0: "LOW_FLOAT", - 0x8df1: "MEDIUM_FLOAT", - 0x8df2: "HIGH_FLOAT", - 0x8df3: "LOW_INT", - 0x8df4: "MEDIUM_INT", - 0x8df5: "HIGH_INT", - 0x8d40: "FRAMEBUFFER", - 0x8d41: "RENDERBUFFER", - 0x8056: "RGBA4", - 0x8057: "RGB5_A1", - 0x8d62: "RGB565", - 0x81a5: "DEPTH_COMPONENT16", - 0x8d48: "STENCIL_INDEX8", - 0x8d42: "RENDERBUFFER_WIDTH", - 0x8d43: "RENDERBUFFER_HEIGHT", - 0x8d44: "RENDERBUFFER_INTERNAL_FORMAT", - 0x8d50: "RENDERBUFFER_RED_SIZE", - 0x8d51: "RENDERBUFFER_GREEN_SIZE", - 0x8d52: "RENDERBUFFER_BLUE_SIZE", - 0x8d53: "RENDERBUFFER_ALPHA_SIZE", - 0x8d54: "RENDERBUFFER_DEPTH_SIZE", - 0x8d55: "RENDERBUFFER_STENCIL_SIZE", - 0x8cd0: "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", - 0x8cd1: "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", - 0x8cd2: "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", - 0x8cd3: "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - 0x8ce0: "COLOR_ATTACHMENT0", - 0x8d00: "DEPTH_ATTACHMENT", - 0x8d20: "STENCIL_ATTACHMENT", - 0x8cd5: "FRAMEBUFFER_COMPLETE", - 0x8cd6: "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", - 0x8cd7: "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - 0x8cd9: "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", - 0x8cdd: "FRAMEBUFFER_UNSUPPORTED", - 0x8ca6: "36006", - 0x8ca7: "RENDERBUFFER_BINDING", - 0x84e8: "MAX_RENDERBUFFER_SIZE", - 0x506: "INVALID_FRAMEBUFFER_OPERATION", - 0x100: "DEPTH_BUFFER_BIT", - 0x400: "STENCIL_BUFFER_BIT", - 0x4000: "COLOR_BUFFER_BIT", - 0x8b50: "FLOAT_VEC2", - 0x8b51: "FLOAT_VEC3", - 0x8b52: "FLOAT_VEC4", - 0x8b53: "INT_VEC2", - 0x8b54: "INT_VEC3", - 0x8b55: "INT_VEC4", - 0x8b56: "BOOL", - 0x8b57: "BOOL_VEC2", - 0x8b58: "BOOL_VEC3", - 0x8b59: "BOOL_VEC4", - 0x8b5a: "FLOAT_MAT2", - 0x8b5b: "FLOAT_MAT3", - 0x8b5c: "FLOAT_MAT4", - 0x8b5e: "SAMPLER_2D", - 0x8b60: "SAMPLER_CUBE", - 0x8b30: "FRAGMENT_SHADER", - 0x8b31: "VERTEX_SHADER", - 0x8a35: "ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH", - 0x8a36: "ACTIVE_UNIFORM_BLOCKS", - 0x911a: "ALREADY_SIGNALED", - 0x8c2f: "ANY_SAMPLES_PASSED", - 0x8d6a: "ANY_SAMPLES_PASSED_CONSERVATIVE", - 0x1905: "BLUE", - 0x911f: "BUFFER_ACCESS_FLAGS", - 0x9120: "BUFFER_MAP_LENGTH", - 0x9121: "BUFFER_MAP_OFFSET", - 0x88bc: "BUFFER_MAPPED", - 0x88bd: "BUFFER_MAP_POINTER", - 0x1800: "COLOR", - 0x8cea: "COLOR_ATTACHMENT10", - 0x8ce1: "COLOR_ATTACHMENT1", - 0x8ceb: "COLOR_ATTACHMENT11", - 0x8cec: "COLOR_ATTACHMENT12", - 0x8ced: "COLOR_ATTACHMENT13", - 0x8cee: "COLOR_ATTACHMENT14", - 0x8cef: "COLOR_ATTACHMENT15", - 0x8ce2: "COLOR_ATTACHMENT2", - 0x8ce3: "COLOR_ATTACHMENT3", - 0x8ce4: "COLOR_ATTACHMENT4", - 0x8ce5: "COLOR_ATTACHMENT5", - 0x8ce6: "COLOR_ATTACHMENT6", - 0x8ce7: "COLOR_ATTACHMENT7", - 0x8ce8: "COLOR_ATTACHMENT8", - 0x8ce9: "COLOR_ATTACHMENT9", - 0x884e: "COMPARE_REF_TO_TEXTURE", - 0x9270: "COMPRESSED_R11_EAC", - 0x9272: "COMPRESSED_RG11_EAC", - 0x9274: "COMPRESSED_RGB8_ETC2", - 0x9276: "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", - 0x9278: "COMPRESSED_RGBA8_ETC2_EAC", - 0x9271: "COMPRESSED_SIGNED_R11_EAC", - 0x9273: "COMPRESSED_SIGNED_RG11_EAC", - 0x9279: "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", - 0x9275: "COMPRESSED_SRGB8_ETC2", - 0x9277: "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", - 0x911c: "CONDITION_SATISFIED", - 0x8f36: "36662", - 0x8f37: "36663", - 0x8865: "CURRENT_QUERY", - 0x1801: "DEPTH", - 0x88f0: "DEPTH24_STENCIL8", - 0x8cad: "DEPTH32F_STENCIL8", - 0x81a6: "DEPTH_COMPONENT24", - 0x8cac: "DEPTH_COMPONENT32F", - 0x84f9: "DEPTH_STENCIL", - 0x821a: "DEPTH_STENCIL_ATTACHMENT", - 0x8825: "DRAW_BUFFER0", - 0x882f: "DRAW_BUFFER10", - 0x8826: "DRAW_BUFFER1", - 0x8830: "DRAW_BUFFER11", - 0x8831: "DRAW_BUFFER12", - 0x8832: "DRAW_BUFFER13", - 0x8833: "DRAW_BUFFER14", - 0x8834: "DRAW_BUFFER15", - 0x8827: "DRAW_BUFFER2", - 0x8828: "DRAW_BUFFER3", - 0x8829: "DRAW_BUFFER4", - 0x882a: "DRAW_BUFFER5", - 0x882b: "DRAW_BUFFER6", - 0x882c: "DRAW_BUFFER7", - 0x882d: "DRAW_BUFFER8", - 0x882e: "DRAW_BUFFER9", - 0x8ca9: "DRAW_FRAMEBUFFER", - 0x88ea: "DYNAMIC_COPY", - 0x88e9: "DYNAMIC_READ", - 0x8dad: "FLOAT_32_UNSIGNED_INT_24_8_REV", - 0x8b65: "FLOAT_MAT2x3", - 0x8b66: "FLOAT_MAT2x4", - 0x8b67: "FLOAT_MAT3x2", - 0x8b68: "FLOAT_MAT3x4", - 0x8b69: "FLOAT_MAT4x2", - 0x8b6a: "FLOAT_MAT4x3", - 0x8b8b: "FRAGMENT_SHADER_DERIVATIVE_HINT", - 0x8215: "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", - 0x8214: "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", - 0x8210: "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", - 0x8211: "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", - 0x8216: "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", - 0x8213: "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", - 0x8212: "FRAMEBUFFER_ATTACHMENT_RED_SIZE", - 0x8217: "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", - 0x8cd4: "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", - 0x8218: "FRAMEBUFFER_DEFAULT", - 0x8d56: "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", - 0x8219: "FRAMEBUFFER_UNDEFINED", - 0x1904: "GREEN", - 0x140b: "HALF_FLOAT", - 0x8d9f: "INT_2_10_10_10_REV", - 0x8c8c: "INTERLEAVED_ATTRIBS", - 0x8dca: "INT_SAMPLER_2D", - 0x8dcf: "INT_SAMPLER_2D_ARRAY", - 0x8dcb: "INT_SAMPLER_3D", - 0x8dcc: "INT_SAMPLER_CUBE", - 0xffffffff: "INVALID_INDEX", - 0x821b: "MAJOR_VERSION", - 0x10: "MAP_FLUSH_EXPLICIT_BIT", - 0x8: "MAP_INVALIDATE_BUFFER_BIT", - 0x20: "MAP_UNSYNCHRONIZED_BIT", - 0x8008: "MAX", - 0x8073: "MAX_3D_TEXTURE_SIZE", - 0x88ff: "MAX_ARRAY_TEXTURE_LAYERS", - 0x8cdf: "MAX_COLOR_ATTACHMENTS", - 0x8a33: "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", - 0x8a2e: "MAX_COMBINED_UNIFORM_BLOCKS", - 0x8a31: "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", - 0x8824: "MAX_DRAW_BUFFERS", - 0x8d6b: "MAX_ELEMENT_INDEX", - 0x80e9: "MAX_ELEMENTS_INDICES", - 0x80e8: "MAX_ELEMENTS_VERTICES", - 0x9125: "MAX_FRAGMENT_INPUT_COMPONENTS", - 0x8a2d: "MAX_FRAGMENT_UNIFORM_BLOCKS", - 0x8b49: "MAX_FRAGMENT_UNIFORM_COMPONENTS", - 0x8905: "MAX_PROGRAM_TEXEL_OFFSET", - 0x8d57: "MAX_SAMPLES", - 0x9111: "MAX_SERVER_WAIT_TIMEOUT", - 0x84fd: "MAX_TEXTURE_LOD_BIAS", - 0x8c8a: "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", - 0x8c8b: "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", - 0x8c80: "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", - 0x8a30: "MAX_UNIFORM_BLOCK_SIZE", - 0x8a2f: "MAX_UNIFORM_BUFFER_BINDINGS", - 0x8b4b: "MAX_VARYING_COMPONENTS", - 0x9122: "MAX_VERTEX_OUTPUT_COMPONENTS", - 0x8a2b: "MAX_VERTEX_UNIFORM_BLOCKS", - 0x8b4a: "MAX_VERTEX_UNIFORM_COMPONENTS", - 0x8007: "MIN", - 0x821c: "MINOR_VERSION", - 0x8904: "MIN_PROGRAM_TEXEL_OFFSET", - 0x821d: "NUM_EXTENSIONS", - 0x87fe: "NUM_PROGRAM_BINARY_FORMATS", - 0x9380: "NUM_SAMPLE_COUNTS", - 0x9112: "OBJECT_TYPE", - 0xd02: "PACK_ROW_LENGTH", - 0xd04: "PACK_SKIP_PIXELS", - 0xd03: "PACK_SKIP_ROWS", - 0x88eb: "PIXEL_PACK_BUFFER", - 0x88ed: "PIXEL_PACK_BUFFER_BINDING", - 0x88ec: "PIXEL_UNPACK_BUFFER", - 0x88ef: "PIXEL_UNPACK_BUFFER_BINDING", - 0x8d69: "PRIMITIVE_RESTART_FIXED_INDEX", - 0x87ff: "PROGRAM_BINARY_FORMATS", - 0x8741: "PROGRAM_BINARY_LENGTH", - 0x8257: "PROGRAM_BINARY_RETRIEVABLE_HINT", - 0x8866: "QUERY_RESULT", - 0x8867: "QUERY_RESULT_AVAILABLE", - 0x8c3a: "R11F_G11F_B10F", - 0x822d: "R16F", - 0x8233: "R16I", - 0x8234: "R16UI", - 0x822e: "R32F", - 0x8235: "R32I", - 0x8236: "R32UI", - 0x8229: "R8", - 0x8231: "R8I", - 0x8f94: "R8_SNORM", - 0x8232: "R8UI", - 0x8c89: "RASTERIZER_DISCARD", - 0xc02: "READ_BUFFER", - 0x8ca8: "READ_FRAMEBUFFER", - 0x8caa: "READ_FRAMEBUFFER_BINDING", - 0x1903: "RED", - 0x8d94: "RED_INTEGER", - 0x8cab: "RENDERBUFFER_SAMPLES", - 0x8227: "RG", - 0x822f: "RG16F", - 0x8239: "RG16I", - 0x823a: "RG16UI", - 0x8230: "RG32F", - 0x823b: "RG32I", - 0x823c: "RG32UI", - 0x822b: "RG8", - 0x8237: "RG8I", - 0x8f95: "RG8_SNORM", - 0x8238: "RG8UI", - 0x8059: "RGB10_A2", - 0x906f: "RGB10_A2UI", - 0x881b: "RGB16F", - 0x8d89: "RGB16I", - 0x8d77: "RGB16UI", - 0x8815: "RGB32F", - 0x8d83: "RGB32I", - 0x8d71: "RGB32UI", - 0x8051: "RGB8", - 0x8d8f: "RGB8I", - 0x8f96: "RGB8_SNORM", - 0x8d7d: "RGB8UI", - 0x8c3d: "RGB9_E5", - 0x881a: "RGBA16F", - 0x8d88: "RGBA16I", - 0x8d76: "RGBA16UI", - 0x8814: "RGBA32F", - 0x8d82: "RGBA32I", - 0x8d70: "RGBA32UI", - 0x8058: "RGBA8", - 0x8d8e: "RGBA8I", - 0x8f97: "RGBA8_SNORM", - 0x8d7c: "RGBA8UI", - 0x8d99: "RGBA_INTEGER", - 0x8d98: "RGB_INTEGER", - 0x8228: "RG_INTEGER", - 0x8dc1: "SAMPLER_2D_ARRAY", - 0x8dc4: "SAMPLER_2D_ARRAY_SHADOW", - 0x8b62: "SAMPLER_2D_SHADOW", - 0x8b5f: "SAMPLER_3D", - 0x8919: "SAMPLER_BINDING", - 0x8dc5: "SAMPLER_CUBE_SHADOW", - 0x8c8d: "SEPARATE_ATTRIBS", - 0x9119: "SIGNALED", - 0x8f9c: "SIGNED_NORMALIZED", - 0x8c40: "SRGB", - 0x8c41: "SRGB8", - 0x8c43: "SRGB8_ALPHA8", - 0x88e6: "STATIC_COPY", - 0x88e5: "STATIC_READ", - 0x1802: "STENCIL", - 0x88e2: "STREAM_COPY", - 0x88e1: "STREAM_READ", - 0x9113: "SYNC_CONDITION", - 0x9116: "SYNC_FENCE", - 0x9115: "SYNC_FLAGS", - 0x9117: "SYNC_GPU_COMMANDS_COMPLETE", - 0x9114: "SYNC_STATUS", - 0x8c1a: "TEXTURE_2D_ARRAY", - 0x806f: "TEXTURE_3D", - 0x813c: "TEXTURE_BASE_LEVEL", - 0x8c1d: "TEXTURE_BINDING_2D_ARRAY", - 0x806a: "TEXTURE_BINDING_3D", - 0x884d: "TEXTURE_COMPARE_FUNC", - 0x884c: "TEXTURE_COMPARE_MODE", - 0x912f: "TEXTURE_IMMUTABLE_FORMAT", - 0x82df: "TEXTURE_IMMUTABLE_LEVELS", - 0x813d: "TEXTURE_MAX_LEVEL", - 0x813b: "TEXTURE_MAX_LOD", - 0x813a: "TEXTURE_MIN_LOD", - 0x8e45: "TEXTURE_SWIZZLE_A", - 0x8e44: "TEXTURE_SWIZZLE_B", - 0x8e43: "TEXTURE_SWIZZLE_G", - 0x8e42: "TEXTURE_SWIZZLE_R", - 0x8072: "TEXTURE_WRAP_R", - 0x911b: "TIMEOUT_EXPIRED", - 0x8e22: "TRANSFORM_FEEDBACK", - 0x8e24: "TRANSFORM_FEEDBACK_ACTIVE", - 0x8e25: "TRANSFORM_FEEDBACK_BINDING", - 0x8c8e: "TRANSFORM_FEEDBACK_BUFFER", - 0x8c8f: "TRANSFORM_FEEDBACK_BUFFER_BINDING", - 0x8c7f: "TRANSFORM_FEEDBACK_BUFFER_MODE", - 0x8c85: "TRANSFORM_FEEDBACK_BUFFER_SIZE", - 0x8c84: "TRANSFORM_FEEDBACK_BUFFER_START", - 0x8e23: "TRANSFORM_FEEDBACK_PAUSED", - 0x8c88: "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", - 0x8c76: "TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH", - 0x8c83: "TRANSFORM_FEEDBACK_VARYINGS", - 0x8a3c: "UNIFORM_ARRAY_STRIDE", - 0x8a43: "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", - 0x8a42: "UNIFORM_BLOCK_ACTIVE_UNIFORMS", - 0x8a3f: "UNIFORM_BLOCK_BINDING", - 0x8a40: "UNIFORM_BLOCK_DATA_SIZE", - 0x8a3a: "UNIFORM_BLOCK_INDEX", - 0x8a41: "UNIFORM_BLOCK_NAME_LENGTH", - 0x8a46: "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", - 0x8a44: "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", - 0x8a11: "UNIFORM_BUFFER", - 0x8a28: "UNIFORM_BUFFER_BINDING", - 0x8a34: "UNIFORM_BUFFER_OFFSET_ALIGNMENT", - 0x8a2a: "UNIFORM_BUFFER_SIZE", - 0x8a29: "UNIFORM_BUFFER_START", - 0x8a3e: "UNIFORM_IS_ROW_MAJOR", - 0x8a3d: "UNIFORM_MATRIX_STRIDE", - 0x8a39: "UNIFORM_NAME_LENGTH", - 0x8a3b: "UNIFORM_OFFSET", - 0x8a38: "UNIFORM_SIZE", - 0x8a37: "UNIFORM_TYPE", - 0x806e: "UNPACK_IMAGE_HEIGHT", - 0xcf2: "UNPACK_ROW_LENGTH", - 0x806d: "UNPACK_SKIP_IMAGES", - 0xcf4: "UNPACK_SKIP_PIXELS", - 0xcf3: "UNPACK_SKIP_ROWS", - 0x9118: "UNSIGNALED", - 0x8c3b: "UNSIGNED_INT_10F_11F_11F_REV", - 0x8368: "UNSIGNED_INT_2_10_10_10_REV", - 0x84fa: "UNSIGNED_INT_24_8", - 0x8c3e: "UNSIGNED_INT_5_9_9_9_REV", - 0x8dd2: "UNSIGNED_INT_SAMPLER_2D", - 0x8dd7: "UNSIGNED_INT_SAMPLER_2D_ARRAY", - 0x8dd3: "UNSIGNED_INT_SAMPLER_3D", - 0x8dd4: "UNSIGNED_INT_SAMPLER_CUBE", - 0x8dc6: "UNSIGNED_INT_VEC2", - 0x8dc7: "UNSIGNED_INT_VEC3", - 0x8dc8: "UNSIGNED_INT_VEC4", - 0x8c17: "UNSIGNED_NORMALIZED", - 0x85b5: "VERTEX_ARRAY_BINDING", - 0x88fe: "VERTEX_ATTRIB_ARRAY_DIVISOR", - 0x88fd: "VERTEX_ATTRIB_ARRAY_INTEGER", - 0x911d: "WAIT_FAILED", -} - -func (v Enum) String() string { - if s, ok := enumString[v]; ok { - return s - } - return fmt.Sprintf("gl.Enum(0x%x)", uint32(v)) -} - -func (ctx *context) ActiveTexture(texture Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ActiveTexture(%v) %v", texture, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnActiveTexture, - a0: texture.c(), - }, - blocking: true}) -} - -func (ctx *context) AttachShader(p Program, s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.AttachShader(%v, %v) %v", p, s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnAttachShader, - a0: p.c(), - a1: s.c(), - }, - blocking: true}) -} - -func (ctx *context) BindAttribLocation(p Program, a Attrib, name string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindAttribLocation(%v, %v, %v) %v", p, a, name, errstr) - }() - s, free := ctx.cString(name) - defer free() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindAttribLocation, - a0: p.c(), - a1: a.c(), - a2: s, - }, - blocking: true, - }) -} - -func (ctx *context) BindBuffer(target Enum, b Buffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindBuffer(%v, %v) %v", target, b, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindBuffer, - a0: target.c(), - a1: b.c(), - }, - blocking: true}) -} - -func (ctx *context) BindFramebuffer(target Enum, fb Framebuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindFramebuffer(%v, %v) %v", target, fb, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindFramebuffer, - a0: target.c(), - a1: fb.c(), - }, - blocking: true}) -} - -func (ctx *context) BindRenderbuffer(target Enum, rb Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindRenderbuffer(%v, %v) %v", target, rb, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindRenderbuffer, - a0: target.c(), - a1: rb.c(), - }, - blocking: true}) -} - -func (ctx *context) BindTexture(target Enum, t Texture) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindTexture(%v, %v) %v", target, t, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindTexture, - a0: target.c(), - a1: t.c(), - }, - blocking: true}) -} - -func (ctx *context) BindVertexArray(va VertexArray) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindVertexArray(%v) %v", va, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindVertexArray, - a0: va.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendColor(red, green, blue, alpha float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendColor, - a0: uintptr(math.Float32bits(red)), - a1: uintptr(math.Float32bits(green)), - a2: uintptr(math.Float32bits(blue)), - a3: uintptr(math.Float32bits(alpha)), - }, - blocking: true}) -} - -func (ctx *context) BlendEquation(mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendEquation(%v) %v", mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendEquation, - a0: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendEquationSeparate(modeRGB, modeAlpha Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendEquationSeparate(%v, %v) %v", modeRGB, modeAlpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendEquationSeparate, - a0: modeRGB.c(), - a1: modeAlpha.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendFunc(sfactor, dfactor Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendFunc(%v, %v) %v", sfactor, dfactor, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendFunc, - a0: sfactor.c(), - a1: dfactor.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendFuncSeparate(%v, %v, %v, %v) %v", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendFuncSeparate, - a0: sfactorRGB.c(), - a1: dfactorRGB.c(), - a2: sfactorAlpha.c(), - a3: dfactorAlpha.c(), - }, - blocking: true}) -} - -func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BufferData(%v, len(%d), %v) %v", target, len(src), usage, errstr) - }() - parg := unsafe.Pointer(nil) - if len(src) > 0 { - parg = unsafe.Pointer(&src[0]) - } - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(len(src)), - a2: usage.c(), - }, - parg: parg, - blocking: true, - }) -} - -func (ctx *context) BufferInit(target Enum, size int, usage Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BufferInit(%v, %v, %v) %v", target, size, usage, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(size), - a2: usage.c(), - }, - parg: unsafe.Pointer(nil), - blocking: true}) -} - -func (ctx *context) BufferSubData(target Enum, offset int, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BufferSubData(%v, %v, len(%d)) %v", target, offset, len(data), errstr) - }() - ctx.enqueueDebug(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) (r0 Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CheckFramebufferStatus(%v) %v%v", target, r0, errstr) - }() - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCheckFramebufferStatus, - a0: target.c(), - }, - blocking: true, - })) -} - -func (ctx *context) Clear(mask Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Clear(%v) %v", mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClear, - a0: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) ClearColor(red, green, blue, alpha float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ClearColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClearColor, - a0: uintptr(math.Float32bits(red)), - a1: uintptr(math.Float32bits(green)), - a2: uintptr(math.Float32bits(blue)), - a3: uintptr(math.Float32bits(alpha)), - }, - blocking: true}) -} - -func (ctx *context) ClearDepthf(d float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ClearDepthf(%v) %v", d, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClearDepthf, - a0: uintptr(math.Float32bits(d)), - }, - blocking: true}) -} - -func (ctx *context) ClearStencil(s int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ClearStencil(%v) %v", s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClearStencil, - a0: uintptr(s), - }, - blocking: true}) -} - -func (ctx *context) ColorMask(red, green, blue, alpha bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ColorMask(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnColorMask, - a0: glBoolean(red), - a1: glBoolean(green), - a2: glBoolean(blue), - a3: glBoolean(alpha), - }, - blocking: true}) -} - -func (ctx *context) CompileShader(s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CompileShader(%v) %v", s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCompileShader, - a0: s.c(), - }, - blocking: true}) -} - -func (ctx *context) CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CompressedTexImage2D(%v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalformat, width, height, border, len(data), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CompressedTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, xoffset, yoffset, width, height, format, len(data), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CopyTexImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, internalformat, x, y, width, height, border, errstr) - }() - ctx.enqueueDebug(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), - }, - blocking: true}) -} - -func (ctx *context) CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CopyTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, xoffset, yoffset, x, y, width, height, errstr) - }() - ctx.enqueueDebug(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), - }, - blocking: true}) -} - -func (ctx *context) CreateBuffer() (r0 Buffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateBuffer() %v%v", r0, errstr) - }() - return Buffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenBuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateFramebuffer() (r0 Framebuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateFramebuffer() %v%v", r0, errstr) - }() - return Framebuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenFramebuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateProgram() (r0 Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateProgram() %v%v", r0, errstr) - }() - return Program{ - Init: true, - Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCreateProgram, - }, - blocking: true, - }, - ))} -} - -func (ctx *context) CreateRenderbuffer() (r0 Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateRenderbuffer() %v%v", r0, errstr) - }() - return Renderbuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenRenderbuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateShader(ty Enum) (r0 Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateShader(%v) %v%v", ty, r0, errstr) - }() - return Shader{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCreateShader, - a0: uintptr(ty), - }, - blocking: true, - }))} -} - -func (ctx *context) CreateTexture() (r0 Texture) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateTexture() %v%v", r0, errstr) - }() - return Texture{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenTexture, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateVertexArray() (r0 VertexArray) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateVertexArray() %v%v", r0, errstr) - }() - return VertexArray{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenVertexArray, - }, - blocking: true, - }))} -} - -func (ctx *context) CullFace(mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CullFace(%v) %v", mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCullFace, - a0: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteBuffer(v Buffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteBuffer(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteBuffer, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteFramebuffer(v Framebuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteFramebuffer(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteFramebuffer, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteRenderbuffer(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteRenderbuffer, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteShader(s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteShader(%v) %v", s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteShader, - a0: s.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteTexture(v Texture) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteTexture(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteTexture, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteVertexArray(v VertexArray) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteVertexArray(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteVertexArray, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DepthFunc(fn Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DepthFunc(%v) %v", fn, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDepthFunc, - a0: fn.c(), - }, - blocking: true}) -} - -func (ctx *context) DepthMask(flag bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DepthMask(%v) %v", flag, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDepthMask, - a0: glBoolean(flag), - }, - blocking: true}) -} - -func (ctx *context) DepthRangef(n, f float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DepthRangef(%v, %v) %v", n, f, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDepthRangef, - a0: uintptr(math.Float32bits(n)), - a1: uintptr(math.Float32bits(f)), - }, - blocking: true}) -} - -func (ctx *context) DetachShader(p Program, s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DetachShader(%v, %v) %v", p, s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDetachShader, - a0: p.c(), - a1: s.c(), - }, - blocking: true}) -} - -func (ctx *context) Disable(cap Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Disable(%v) %v", cap, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDisable, - a0: cap.c(), - }, - blocking: true}) -} - -func (ctx *context) DisableVertexAttribArray(a Attrib) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DisableVertexAttribArray(%v) %v", a, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDisableVertexAttribArray, - a0: a.c(), - }, - blocking: true}) -} - -func (ctx *context) DrawArrays(mode Enum, first, count int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DrawArrays(%v, %v, %v) %v", mode, first, count, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDrawArrays, - a0: mode.c(), - a1: uintptr(first), - a2: uintptr(count), - }, - blocking: true}) -} - -func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DrawElements(%v, %v, %v, %v) %v", mode, count, ty, offset, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDrawElements, - a0: mode.c(), - a1: uintptr(count), - a2: ty.c(), - a3: uintptr(offset), - }, - blocking: true}) -} - -func (ctx *context) Enable(cap Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Enable(%v) %v", cap, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnEnable, - a0: cap.c(), - }, - blocking: true}) -} - -func (ctx *context) EnableVertexAttribArray(a Attrib) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.EnableVertexAttribArray(%v) %v", a, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnEnableVertexAttribArray, - a0: a.c(), - }, - blocking: true}) -} - -func (ctx *context) Finish() { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Finish() %v", errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFinish, - }, - blocking: true, - }) -} - -func (ctx *context) Flush() { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Flush() %v", errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFlush, - }, - blocking: true, - }) -} - -func (ctx *context) FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.FramebufferRenderbuffer(%v, %v, %v, %v) %v", target, attachment, rbTarget, rb, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFramebufferRenderbuffer, - a0: target.c(), - a1: attachment.c(), - a2: rbTarget.c(), - a3: rb.c(), - }, - blocking: true}) -} - -func (ctx *context) FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.FramebufferTexture2D(%v, %v, %v, %v, %v) %v", target, attachment, texTarget, t, level, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFramebufferTexture2D, - a0: target.c(), - a1: attachment.c(), - a2: texTarget.c(), - a3: t.c(), - a4: uintptr(level), - }, - blocking: true}) -} - -func (ctx *context) FrontFace(mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.FrontFace(%v) %v", mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFrontFace, - a0: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) GenerateMipmap(target Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GenerateMipmap(%v) %v", target, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGenerateMipmap, - a0: target.c(), - }, - blocking: true}) -} - -func (ctx *context) GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetActiveAttrib(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) - }() - bufSize := ctx.GetProgrami(p, ACTIVE_ATTRIBUTE_MAX_LENGTH) - 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)), - }, - 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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetActiveUniform(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) - }() - bufSize := ctx.GetProgrami(p, ACTIVE_UNIFORM_MAX_LENGTH) - buf := make([]byte, bufSize+8) - 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)), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetAttachedShaders(p Program) (r0 []Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetAttachedShaders(%v) %v%v", p, r0, errstr) - }() - shadersLen := ctx.GetProgrami(p, ATTACHED_SHADERS) - 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) (r0 Attrib) { - defer func() { - errstr := ctx.errDrain() - r0.name = name - log.Printf("gl.GetAttribLocation(%v, %v) %v%v", p, name, r0, errstr) - }() - 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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetBooleanv(%v, %v) %v", dst, pname, errstr) - }() - buf := make([]int32, len(dst)) - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetFloatv(len(%d), %v) %v", len(dst), pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetFloatv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetIntegerv(dst []int32, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetIntegerv(%v, %v) %v", dst, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetIntegerv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetInteger(pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetInteger(%v) %v%v", pname, r0, errstr) - }() - var v [1]int32 - ctx.GetIntegerv(v[:], pname) - return int(v[0]) -} - -func (ctx *context) GetBufferParameteri(target, value Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetBufferParameteri(%v, %v) %v%v", target, value, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetBufferParameteri, - a0: target.c(), - a1: value.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetError() (r0 Enum) { - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetError, - }, - blocking: true, - })) -} - -func (ctx *context) GetFramebufferAttachmentParameteri(target, attachment, pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetFramebufferAttachmentParameteri(%v, %v, %v) %v%v", target, attachment, pname, r0, errstr) - }() - 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) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetProgrami(%v, %v) %v%v", p, pname, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetProgramiv, - a0: p.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgramInfoLog(p Program) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetProgramInfoLog(%v) %v%v", p, r0, errstr) - }() - infoLen := ctx.GetProgrami(p, INFO_LOG_LENGTH) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - ctx.enqueueDebug(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) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetRenderbufferParameteri(%v, %v) %v%v", target, pname, r0, errstr) - }() - 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) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderi(%v, %v) %v%v", s, pname, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderiv, - a0: s.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderInfoLog(s Shader) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderInfoLog(%v) %v%v", s, r0, errstr) - }() - infoLen := ctx.GetShaderi(s, INFO_LOG_LENGTH) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderPrecisionFormat(%v, %v) (%v, %v, %v) %v", shadertype, precisiontype, rangeLow, rangeHigh, precision, errstr) - }() - var rangeAndPrec [3]int32 - ctx.enqueueDebug(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) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderSource(%v) %v%v", s, r0, errstr) - }() - sourceLen := ctx.GetShaderi(s, SHADER_SOURCE_LENGTH) - if sourceLen == 0 { - return "" - } - buf := make([]byte, sourceLen) - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetTexParameterfv(len(%d), %v, %v) %v", len(dst), target, pname, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetTexParameteriv(%v, %v, %v) %v", dst, target, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - }) -} - -func (ctx *context) GetUniformfv(dst []float32, src Uniform, p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetUniformfv(len(%d), %v, %v) %v", len(dst), src, p, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetUniformiv(%v, %v, %v) %v", dst, src, p, errstr) - }() - ctx.enqueueDebug(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) (r0 Uniform) { - defer func() { - errstr := ctx.errDrain() - r0.name = name - log.Printf("gl.GetUniformLocation(%v, %v) %v%v", p, name, r0, errstr) - }() - 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) (r0 float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribf(%v, %v) %v%v", src, pname, r0, errstr) - }() - var params [1]float32 - ctx.GetVertexAttribfv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribfv(dst []float32, src Attrib, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribfv(len(%d), %v, %v) %v", len(dst), src, pname, errstr) - }() - ctx.enqueueDebug(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) (r0 int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribi(%v, %v) %v%v", src, pname, r0, errstr) - }() - var params [1]int32 - ctx.GetVertexAttribiv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribiv(dst []int32, src Attrib, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribiv(%v, %v, %v) %v", dst, src, pname, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Hint(%v, %v) %v", target, mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnHint, - a0: target.c(), - a1: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) IsBuffer(b Buffer) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsBuffer(%v) %v%v", b, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsBuffer, - a0: b.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsEnabled(cap Enum) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsEnabled(%v) %v%v", cap, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsEnabled, - a0: cap.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsFramebuffer(fb Framebuffer) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsFramebuffer(%v) %v%v", fb, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsFramebuffer, - a0: fb.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsProgram(p Program) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsProgram(%v) %v%v", p, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsProgram, - a0: p.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsRenderbuffer(rb Renderbuffer) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsRenderbuffer(%v) %v%v", rb, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsRenderbuffer, - a0: rb.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsShader(s Shader) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsShader(%v) %v%v", s, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsShader, - a0: s.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsTexture(t Texture) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsTexture(%v) %v%v", t, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsTexture, - a0: t.c(), - }, - blocking: true, - }) -} - -func (ctx *context) LineWidth(width float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.LineWidth(%v) %v", width, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnLineWidth, - a0: uintptr(math.Float32bits(width)), - }, - blocking: true}) -} - -func (ctx *context) LinkProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.LinkProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnLinkProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) PixelStorei(pname Enum, param int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.PixelStorei(%v, %v) %v", pname, param, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnPixelStorei, - a0: pname.c(), - a1: uintptr(param), - }, - blocking: true}) -} - -func (ctx *context) PolygonOffset(factor, units float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.PolygonOffset(%v, %v) %v", factor, units, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnPolygonOffset, - a0: uintptr(math.Float32bits(factor)), - a1: uintptr(math.Float32bits(units)), - }, - blocking: true}) -} - -func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ReadPixels(len(%d), %v, %v, %v, %v, %v, %v) %v", len(dst), x, y, width, height, format, ty, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnReadPixels, - - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - a4: format.c(), - a5: ty.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) ReleaseShaderCompiler() { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ReleaseShaderCompiler() %v", errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnReleaseShaderCompiler, - }, - blocking: true}) -} - -func (ctx *context) RenderbufferStorage(target, internalFormat Enum, width, height int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.RenderbufferStorage(%v, %v, %v, %v) %v", target, internalFormat, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnRenderbufferStorage, - a0: target.c(), - a1: internalFormat.c(), - a2: uintptr(width), - a3: uintptr(height), - }, - blocking: true}) -} - -func (ctx *context) SampleCoverage(value float32, invert bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.SampleCoverage(%v, %v) %v", value, invert, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnSampleCoverage, - a0: uintptr(math.Float32bits(value)), - a1: glBoolean(invert), - }, - blocking: true}) -} - -func (ctx *context) Scissor(x, y, width, height int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Scissor(%v, %v, %v, %v) %v", x, y, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnScissor, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - blocking: true}) -} - -func (ctx *context) ShaderSource(s Shader, src string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ShaderSource(%v, %v) %v", s, src, errstr) - }() - strp, free := ctx.cStringPtr(src) - defer free() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnShaderSource, - a0: s.c(), - a1: 1, - a2: strp, - }, - blocking: true, - }) -} - -func (ctx *context) StencilFunc(fn Enum, ref int, mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilFunc(%v, %v, %v) %v", fn, ref, mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilFunc, - a0: fn.c(), - a1: uintptr(ref), - a2: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilFuncSeparate(face, fn Enum, ref int, mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilFuncSeparate(%v, %v, %v, %v) %v", face, fn, ref, mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilFuncSeparate, - a0: face.c(), - a1: fn.c(), - a2: uintptr(ref), - a3: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilMask(mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilMask(%v) %v", mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilMask, - a0: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilMaskSeparate(face Enum, mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilMaskSeparate(%v, %v) %v", face, mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilMaskSeparate, - a0: face.c(), - a1: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilOp(fail, zfail, zpass Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilOp(%v, %v, %v) %v", fail, zfail, zpass, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilOp, - a0: fail.c(), - a1: zfail.c(), - a2: zpass.c(), - }, - blocking: true}) -} - -func (ctx *context) StencilOpSeparate(face, sfail, dpfail, dppass Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilOpSeparate(%v, %v, %v, %v) %v", face, sfail, dpfail, dppass, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilOpSeparate, - a0: face.c(), - a1: sfail.c(), - a2: dpfail.c(), - a3: dppass.c(), - }, - blocking: true}) -} - -func (ctx *context) TexImage2D(target Enum, level int, internalFormat int, width, height int, format Enum, ty Enum, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalFormat, width, height, format, ty, len(data), errstr) - }() - parg := unsafe.Pointer(nil) - if len(data) > 0 { - parg = unsafe.Pointer(&data[0]) - } - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexImage2D, - - a0: target.c(), - a1: uintptr(level), - a2: uintptr(internalFormat), - a3: uintptr(width), - a4: uintptr(height), - a5: format.c(), - a6: ty.c(), - }, - parg: parg, - blocking: true, - }) -} - -func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, x, y, width, height, format, ty, len(data), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexSubImage2D, - - 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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameterf(%v, %v, %v) %v", target, pname, param, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexParameterf, - a0: target.c(), - a1: pname.c(), - a2: uintptr(math.Float32bits(param)), - }, - blocking: true}) -} - -func (ctx *context) TexParameterfv(target, pname Enum, params []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameterfv(%v, %v, len(%d)) %v", target, pname, len(params), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameteri(%v, %v, %v) %v", target, pname, param, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexParameteri, - a0: target.c(), - a1: pname.c(), - a2: uintptr(param), - }, - blocking: true}) -} - -func (ctx *context) TexParameteriv(target, pname Enum, params []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameteriv(%v, %v, %v) %v", target, pname, params, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1f(%v, %v) %v", dst, v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v)), - }, - blocking: true}) -} - -func (ctx *context) Uniform1fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1i(%v, %v) %v", dst, v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1i, - a0: dst.c(), - a1: uintptr(v), - }, - blocking: true}) -} - -func (ctx *context) Uniform1iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2f(%v, %v, %v) %v", dst, v0, v1, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - }, - blocking: true}) -} - -func (ctx *context) Uniform2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2i(%v, %v, %v) %v", dst, v0, v1, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - blocking: true}) -} - -func (ctx *context) Uniform2iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3f(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - }, - blocking: true}) -} - -func (ctx *context) Uniform3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3i(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - blocking: true}) -} - -func (ctx *context) Uniform3iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4f(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - a4: uintptr(math.Float32bits(v3)), - }, - blocking: true}) -} - -func (ctx *context) Uniform4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4fv, - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4i(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - blocking: true}) -} - -func (ctx *context) Uniform4iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix2fv, - - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UseProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUseProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) ValidateProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ValidateProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnValidateProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib1f(dst Attrib, x float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib1f(%v, %v) %v", dst, x, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib1fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib1fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib1fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib2f(dst Attrib, x, y float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib2f(%v, %v, %v) %v", dst, x, y, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib2fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib3f(%v, %v, %v, %v) %v", dst, x, y, z, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib3fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib4f(%v, %v, %v, %v, %v) %v", dst, x, y, z, w, errstr) - }() - ctx.enqueueDebug(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)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib4fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(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) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttribPointer(%v, %v, %v, %v, %v, %v) %v", dst, size, ty, normalized, stride, offset, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttribPointer, - a0: dst.c(), - a1: uintptr(size), - a2: ty.c(), - a3: glBoolean(normalized), - a4: uintptr(stride), - a5: uintptr(offset), - }, - blocking: true}) -} - -func (ctx *context) Viewport(x, y, width, height int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Viewport(%v, %v, %v, %v) %v", x, y, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnViewport, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - blocking: true}) -} - -func (ctx context3) UniformMatrix2x3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix2x3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix2x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix3x2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix3x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix2x4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix2x4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix2x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix4x2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix4x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix3x4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix3x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix4x3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix4x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlitFramebuffer(%v, %v, %v, %v, %v, %v, %v, %v, %v, %v) %v", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlitFramebuffer, - a0: uintptr(srcX0), - a1: uintptr(srcY0), - a2: uintptr(srcX1), - a3: uintptr(srcY1), - a4: uintptr(dstX0), - a5: uintptr(dstY0), - a6: uintptr(dstX1), - a7: uintptr(dstY1), - a8: uintptr(mask), - a9: filter.c(), - }, - blocking: true}) -} - -func (ctx context3) Uniform1ui(dst Uniform, v uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1ui(%v, %v) %v", dst, v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1ui, - a0: dst.c(), - a1: uintptr(v), - }, - blocking: true}) -} - -func (ctx context3) Uniform2ui(dst Uniform, v0, v1 uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2ui(%v, %v, %v) %v", dst, v0, v1, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - blocking: true}) -} - -func (ctx context3) Uniform3ui(dst Uniform, v0, v1, v2 uint) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3ui(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - blocking: true}) -} - -func (ctx context3) Uniform4ui(dst Uniform, v0, v1, v2, v3 uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4ui(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - blocking: true}) -} diff --git a/internal/driver/mobile/gl/interface.go b/internal/driver/mobile/gl/interface.go index aa80d5b201..91bee534f3 100644 --- a/internal/driver/mobile/gl/interface.go +++ b/internal/driver/mobile/gl/interface.go @@ -7,12 +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, a Context is also a Context3. -// For example, a program can: -// -// func f(glctx gl.Context) { -// glctx.(gl.Context3).BlitFramebuffer(...) -// } +// 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 @@ -30,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 @@ -66,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, @@ -120,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 @@ -196,102 +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) - // DeleteVertexArray deletes the given render buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteVertexArrays.xhtml - DeleteVertexArray(v VertexArray) - - // 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 @@ -301,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, @@ -316,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 @@ -429,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. @@ -554,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 @@ -719,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 @@ -827,19 +227,6 @@ type Context interface { Viewport(x, y, width, height int) } -// Context3 is an OpenGL ES 3 context. -// -// When the gl package is compiled with GL ES 3 support, the produced -// Context object also implements the Context3 interface. -type Context3 interface { - Context - - // BlitFramebuffer copies a block of pixels between framebuffers. - // - // https://www.khronos.org/opengles/sdk/docs/man3/html/glBlitFramebuffer.xhtml - BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) -} - // Worker is used by display driver code to execute OpenGL calls. // // Typically display driver code creates a gl.Context for an application, @@ -865,8 +252,7 @@ type Context3 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 84% rename from internal/driver/mobile/gl/types_prod.go rename to internal/driver/mobile/gl/types.go index 16805e5ba5..abf5fc3c2b 100644 --- a/internal/driver/mobile/gl/types_prod.go +++ b/internal/driver/mobile/gl/types.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. // +build darwin linux openbsd freebsd windows -// +build !gldebug package gl @@ -74,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/types_debug.go b/internal/driver/mobile/gl/types_debug.go deleted file mode 100644 index d311676245..0000000000 --- a/internal/driver/mobile/gl/types_debug.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin linux openbsd freebsd windows -// +build gldebug - -package gl - -// Alternate versions of the types defined in types.go with extra -// debugging information attached. For documentation, see types.go. - -import "fmt" - -type Enum uint32 - -type Attrib struct { - Value uint - name string -} - -type Program struct { - Init bool - Value uint32 -} - -type Shader struct { - Value uint32 -} - -type Buffer struct { - Value uint32 -} - -type Framebuffer struct { - Value uint32 -} - -type Renderbuffer struct { - Value uint32 -} - -type Texture struct { - Value uint32 -} - -type Uniform struct { - Value int32 - name string -} - -type VertexArray struct { - Value uint32 -} - -func (v Attrib) c() uintptr { return uintptr(v.Value) } -func (v Enum) c() uintptr { return uintptr(v) } -func (v Program) c() uintptr { - if !v.Init { - ret := uintptr(0) - ret-- - return ret - } - 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 Attrib) String() string { return fmt.Sprintf("Attrib(%d:%s)", v.Value, v.name) } -func (v Program) String() string { return fmt.Sprintf("Program(%d)", v.Value) } -func (v Shader) String() string { return fmt.Sprintf("Shader(%d)", v.Value) } -func (v Buffer) String() string { return fmt.Sprintf("Buffer(%d)", v.Value) } -func (v Framebuffer) String() string { return fmt.Sprintf("Framebuffer(%d)", v.Value) } -func (v Renderbuffer) String() string { return fmt.Sprintf("Renderbuffer(%d)", v.Value) } -func (v Texture) String() string { return fmt.Sprintf("Texture(%d)", v.Value) } -func (v Uniform) String() string { return fmt.Sprintf("Uniform(%d:%s)", v.Value, v.name) } -func (v VertexArray) String() string { return fmt.Sprintf("VertexArray(%d)", v.Value) } diff --git a/internal/driver/mobile/gl/work.c b/internal/driver/mobile/gl/work.c index f68d26b681..e37c636794 100644 --- a/internal/driver/mobile/gl/work.c +++ b/internal/driver/mobile/gl/work.c @@ -15,24 +15,8 @@ static void gles3missing() { printf("GLES3 function is missing\n"); exit(2); } -static void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { gles3missing(); } -static void glUniform1ui(GLint location, GLuint v0) { gles3missing(); } -static void glUniform2ui(GLint location, GLuint v0, GLuint v1) { gles3missing(); } -static void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) { gles3missing(); } -static void glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) { gles3missing(); } -static void glUniform1uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glUniform2uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glUniform3uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glUniform4uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } static void glBindVertexArray(GLuint array) { gles3missing(); } static void glGenVertexArrays(GLsizei n, GLuint *arrays) { gles3missing(); } -static void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) { gles3missing(); } #endif uintptr_t processFn(struct fnargs* args, char* parg) { @@ -47,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; @@ -68,290 +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 glfnBlitFramebuffer: - glBlitFramebuffer((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLint)args->a6, (GLint)args->a7, (GLbitfield)args->a8, (GLenum)args->a9); - 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 glfnDeleteVertexArray: - glDeleteVertexArrays(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; @@ -362,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, @@ -392,159 +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 glfnUniform1ui: - glUniform1ui((GLint)args->a0, (GLuint)args->a1); - break; - case glfnUniform1uiv: - glUniform1uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - 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 glfnUniform2ui: - glUniform2ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2); - break; - case glfnUniform2uiv: - glUniform2uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - 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 glfnUniform3ui: - glUniform3ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3); - break; - case glfnUniform3uiv: - glUniform3uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - 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 glfnUniform4ui: - glUniform4ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3, (GLuint)args->a4); - break; - case glfnUniform4uiv: - glUniform4uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - 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 glfnUniformMatrix2x3fv: - glUniformMatrix2x3fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix3x2fv: - glUniformMatrix3x2fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix2x4fv: - glUniformMatrix2x4fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix4x2fv: - glUniformMatrix4x2fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix3x4fv: - glUniformMatrix3x4fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix4x3fv: - glUniformMatrix4x3fv((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; @@ -553,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 4808632ec7..13999f238e 100644 --- a/internal/driver/mobile/gl/work.h +++ b/internal/driver/mobile/gl/work.h @@ -37,167 +37,48 @@ // 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, - glfnDeleteVertexArray, - 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, - - // ES 3.0 functions - glfnUniformMatrix2x3fv, - glfnUniformMatrix3x2fv, - glfnUniformMatrix2x4fv, - glfnUniformMatrix4x2fv, - glfnUniformMatrix3x4fv, - glfnUniformMatrix4x3fv, - glfnBlitFramebuffer, - glfnUniform1ui, - glfnUniform2ui, - glfnUniform3ui, - glfnUniform4ui, - glfnUniform1uiv, - glfnUniform2uiv, - glfnUniform3uiv, - glfnUniform4uiv, } glfn; // TODO: generate this type from fn.go. diff --git a/internal/driver/mobile/gl/work_windows.go b/internal/driver/mobile/gl/work_windows.go index d76bb3ce7c..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,70 +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 - }, - glfnDeleteVertexArray: func(c call) (ret uintptr) { - syscall.Syscall(glDeleteVertexArrays.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 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 @@ -293,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 @@ -333,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 @@ -407,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 @@ -423,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 @@ -511,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 @@ -615,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 @@ -709,148 +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") - glDeleteVertexArrays = libGLESv2.NewProc("glDeleteVertexArrays") - 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") )