diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..47a8ade --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,73 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/faiface/glhf" + packages = ["."] + revision = "98c0391c0fd3f0b365cfe5d467ac162b79dfb002" + +[[projects]] + branch = "master" + name = "github.com/faiface/mainthread" + packages = ["."] + revision = "8b78f0a41ae388189090ac4506612659fa53082b" + +[[projects]] + name = "github.com/faiface/pixel" + packages = [ + ".", + "imdraw", + "pixelgl" + ] + revision = "2d9a739e406f1f7093747c599d844e50c6e92d0e" + version = "v0.7" + +[[projects]] + branch = "master" + name = "github.com/go-gl/gl" + packages = ["v3.3-core/gl"] + revision = "eafa86a81d9705ff0b4ab163d26fe74da80e0559" + +[[projects]] + branch = "master" + name = "github.com/go-gl/glfw" + packages = ["v3.2/glfw"] + revision = "513e4f2bf85c31fba0fc4907abd7895242ccbe50" + +[[projects]] + branch = "master" + name = "github.com/go-gl/mathgl" + packages = ["mgl32"] + revision = "d28d8d903c65929938eaac4953b3eb50a425b5ee" + +[[projects]] + name = "github.com/pkg/errors" + packages = ["."] + revision = "645ef00459ed84a119197bfb8d8205042c6df63d" + version = "v0.8.0" + +[[projects]] + branch = "master" + name = "golang.org/x/image" + packages = [ + "colornames", + "math/f32" + ] + revision = "f3a9b89b59def9194717c1d0bd4c0d08fa1afa7b" + +[[projects]] + branch = "master" + name = "golang.org/x/net" + packages = [ + "html", + "html/atom" + ] + revision = "24dd3780ca4f75fed9f321890729414a4b5d3f13" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "20e4628692bb0166d60606bd2f9e88c17bbd484bfe0e1fc0e3478c05a5d5f736" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..bcb6b3c --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,38 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/faiface/pixel" + version = "0.7.0" + +[[constraint]] + branch = "master" + name = "golang.org/x/image" + +[prune] + go-tests = true + unused-packages = true diff --git a/vendor/github.com/faiface/glhf/LICENSE b/vendor/github.com/faiface/glhf/LICENSE new file mode 100644 index 0000000..b497e83 --- /dev/null +++ b/vendor/github.com/faiface/glhf/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Michal Štrba + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/faiface/glhf/README.md b/vendor/github.com/faiface/glhf/README.md new file mode 100644 index 0000000..f862d7f --- /dev/null +++ b/vendor/github.com/faiface/glhf/README.md @@ -0,0 +1,191 @@ +# glhf [![GoDoc](https://godoc.org/github.com/faiface/glhf?status.svg)](http://godoc.org/github.com/faiface/glhf) [![Report card](https://goreportcard.com/badge/github.com/faiface/glhf)](https://goreportcard.com/report/github.com/faiface/glhf) + +open**GL** **H**ave **F**un - A Go package that makes life with OpenGL enjoyable. + +``` +go get github.com/faiface/glhf +``` + +## Main features + +- Garbage collected OpenGL objects +- Dynamically sized vertex slices (vertex arrays are boring) +- Textures, Shaders, Frames (reasonably managed framebuffers) +- Always possible to use standard OpenGL with `glhf` + +## Motivation + +OpenGL is verbose, it's usage patterns are repetitive and it's manual memory management doesn't fit +Go's design. When making a game development library, it's usually desirable to create some +higher-level abstractions around OpenGL. This library is a take on that. + +## Contribute! + +The library is young and many features are still missing. If you find a bug, have a proposal or a +feature request, _do an issue_!. If you know how to implement something that's missing, _do a pull +request_. + +## Code + +The following are parts of the demo program, which can be found in the [examples](https://github.com/faiface/glhf/tree/master/examples/demo). + +```go +// ... GLFW window creation and stuff ... + +// vertex shader source +var vertexShader = ` +#version 330 core + +in vec2 position; +in vec2 texture; + +out vec2 Texture; + +void main() { + gl_Position = vec4(position, 0.0, 1.0); + Texture = texture; +} +` + +// fragment shader source +var fragmentShader = ` +#version 330 core + +in vec2 Texture; + +out vec4 color; + +uniform sampler2D tex; + +void main() { + color = texture(tex, Texture); +} +` + +var ( + // Here we define a vertex format of our vertex slice. It's actually a basic slice + // literal. + // + // The vertex format consists of names and types of the attributes. The name is the + // name that the attribute is referenced by inside a shader. + vertexFormat = glhf.AttrFormat{ + {Name: "position", Type: glhf.Vec2}, + {Name: "texture", Type: glhf.Vec2}, + } + + // Here we declare some variables for later use. + shader *glhf.Shader + texture *glhf.Texture + slice *glhf.VertexSlice +) + +// Here we load an image from a file. The loadImage function is not within the library, it +// just loads and returns a image.NRGBA. +gopherImage, err := loadImage("celebrate.png") +if err != nil { + panic(err) +} + +// Every OpenGL call needs to be done inside the main thread. +mainthread.Call(func() { + var err error + + // Here we create a shader. The second argument is the format of the uniform + // attributes. Since our shader has no uniform attributes, the format is empty. + shader, err = glhf.NewShader(vertexFormat, glhf.AttrFormat{}, vertexShader, fragmentShader) + + // If the shader compilation did not go successfully, an error with a full + // description is returned. + if err != nil { + panic(err) + } + + // We create a texture from the loaded image. + texture = glhf.NewTexture( + gopherImage.Bounds().Dx(), + gopherImage.Bounds().Dy(), + true, + gopherImage.Pix, + ) + + // And finally, we make a vertex slice, which is basically a dynamically sized + // vertex array. The length of the slice is 6 and the capacity is the same. + // + // The slice inherits the vertex format of the supplied shader. Also, it should + // only be used with that shader. + slice = glhf.MakeVertexSlice(shader, 6, 6) + + // Before we use a slice, we need to Begin it. The same holds for all objects in + // GLHF. + slice.Begin() + + // We assign data to the vertex slice. The values are in the order as in the vertex + // format of the slice (shader). Each two floats correspond to an attribute of type + // glhf.Vec2. + slice.SetVertexData([]float32{ + -1, -1, 0, 1, + +1, -1, 1, 1, + +1, +1, 1, 0, + + -1, -1, 0, 1, + +1, +1, 1, 0, + -1, +1, 0, 0, + }) + + // When we're done with the slice, we End it. + slice.End() +}) + +shouldQuit := false +for !shouldQuit { + mainthread.Call(func() { + // ... GLFW stuff ... + + // Clear the window. + glhf.Clear(1, 1, 1, 1) + + // Here we Begin/End all necessary objects and finally draw the vertex + // slice. + shader.Begin() + texture.Begin() + slice.Begin() + slice.Draw() + slice.End() + texture.End() + shader.End() + + // ... GLFW stuff ... + }) +} +``` + +## FAQ + +### Which version of OpenGL does GLHF use? + +It uses OpenGL 3.3 and uses +[`github.com/go-gl/gl/v3.3-core/gl`](https://github.com/go-gl/gl/tree/master/v3.3-core/gl). + +### Why do I have to use `github.com/faiface/mainthread` package with GLHF? + +First of all, OpenGL has to be done from one thread and many operating systems require, that the one +thread will be the main thread of your application. + +But why that specific package? GLHF uses the `mainthread` package to do the garbage collection of +OpenGL objects, which is super convenient. So in order for it to work correctly, you have to +initialize the `mainthread` package through `mainthread.Run`. However, once you call this function +there is no way to run functions on the main thread, except for through the `mainthread` package. + +### Why is the important XY feature not included? + +I probably didn't need it yet. If you want that features, create an issue or implement it and do a +pull request. + +### Does GLHF create windows for me? + +No. You have to use another library for windowing, e.g. +[github.com/go-gl/glfw/v3.2/glfw](https://github.com/go-gl/glfw/tree/master/v3.2/glfw). + +### Why no tests? + +If you find a way to automatically test OpenGL, I may add tests. \ No newline at end of file diff --git a/vendor/github.com/faiface/glhf/attr.go b/vendor/github.com/faiface/glhf/attr.go new file mode 100644 index 0000000..fb1b4f7 --- /dev/null +++ b/vendor/github.com/faiface/glhf/attr.go @@ -0,0 +1,80 @@ +package glhf + +// AttrFormat defines names and types of OpenGL attributes (vertex format, uniform format, etc.). +// +// Example: +// AttrFormat{{"position", Vec2}, {"color", Vec4}, {"texCoord": Vec2}} +type AttrFormat []Attr + +// Size returns the total size of all attributes of the AttrFormat. +func (af AttrFormat) Size() int { + total := 0 + for _, attr := range af { + total += attr.Type.Size() + } + return total +} + +// Attr represents an arbitrary OpenGL attribute, such as a vertex attribute or a shader +// uniform attribute. +type Attr struct { + Name string + Type AttrType +} + +// AttrType represents the type of an OpenGL attribute. +type AttrType int + +// List of all possible attribute types. +const ( + Int AttrType = iota + Float + Vec2 + Vec3 + Vec4 + Mat2 + Mat23 + Mat24 + Mat3 + Mat32 + Mat34 + Mat4 + Mat42 + Mat43 +) + +// Size returns the size of a type in bytes. +func (at AttrType) Size() int { + switch at { + case Int: + return 4 + case Float: + return 4 + case Vec2: + return 2 * 4 + case Vec3: + return 3 * 4 + case Vec4: + return 4 * 4 + case Mat2: + return 2 * 2 * 4 + case Mat23: + return 2 * 3 * 4 + case Mat24: + return 2 * 4 * 4 + case Mat3: + return 3 * 3 * 4 + case Mat32: + return 3 * 2 * 4 + case Mat34: + return 3 * 4 * 4 + case Mat4: + return 4 * 4 * 4 + case Mat42: + return 4 * 2 * 4 + case Mat43: + return 4 * 3 * 4 + default: + panic("size of vertex attribute type: invalid type") + } +} diff --git a/vendor/github.com/faiface/glhf/doc.go b/vendor/github.com/faiface/glhf/doc.go new file mode 100644 index 0000000..3a25b1b --- /dev/null +++ b/vendor/github.com/faiface/glhf/doc.go @@ -0,0 +1,7 @@ +// Package glhf provides abstractions around the basic OpenGL primitives and operations. +// +// All calls should be done from the main thread using "github.com/faiface/mainthread" package. +// +// This package deliberately does not handle nor report trivial OpenGL errors, it's up to you to +// cause none. It does of course report errors like shader compilation error and such. +package glhf diff --git a/vendor/github.com/faiface/glhf/frame.go b/vendor/github.com/faiface/glhf/frame.go new file mode 100644 index 0000000..1cb7af3 --- /dev/null +++ b/vendor/github.com/faiface/glhf/frame.go @@ -0,0 +1,108 @@ +package glhf + +import ( + "runtime" + + "github.com/faiface/mainthread" + "github.com/go-gl/gl/v3.3-core/gl" +) + +// Frame is a fixed resolution texture that you can draw on. +type Frame struct { + fb, rf, df binder // framebuffer, read framebuffer, draw framebuffer + tex *Texture +} + +// NewFrame creates a new fully transparent Frame with given dimensions in pixels. +func NewFrame(width, height int, smooth bool) *Frame { + f := &Frame{ + fb: binder{ + restoreLoc: gl.FRAMEBUFFER_BINDING, + bindFunc: func(obj uint32) { + gl.BindFramebuffer(gl.FRAMEBUFFER, obj) + }, + }, + rf: binder{ + restoreLoc: gl.READ_FRAMEBUFFER_BINDING, + bindFunc: func(obj uint32) { + gl.BindFramebuffer(gl.READ_FRAMEBUFFER, obj) + }, + }, + df: binder{ + restoreLoc: gl.DRAW_FRAMEBUFFER_BINDING, + bindFunc: func(obj uint32) { + gl.BindFramebuffer(gl.DRAW_FRAMEBUFFER, obj) + }, + }, + tex: NewTexture(width, height, smooth, make([]uint8, width*height*4)), + } + + gl.GenFramebuffers(1, &f.fb.obj) + + f.fb.bind() + gl.FramebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, f.tex.tex.obj, 0) + f.fb.restore() + + runtime.SetFinalizer(f, (*Frame).delete) + + return f +} + +func (f *Frame) delete() { + mainthread.CallNonBlock(func() { + gl.DeleteFramebuffers(1, &f.fb.obj) + }) +} + +// ID returns the OpenGL framebuffer ID of this Frame. +func (f *Frame) ID() uint32 { + return f.fb.obj +} + +// Begin binds the Frame. All draw operations will target this Frame until End is called. +func (f *Frame) Begin() { + f.fb.bind() +} + +// End unbinds the Frame. All draw operations will go to whatever was bound before this Frame. +func (f *Frame) End() { + f.fb.restore() +} + +// Blit copies rectangle (sx0, sy0, sx1, sy1) in this Frame onto rectangle (dx0, dy0, dx1, dy1) in +// dst Frame. +// +// If the dst Frame is nil, the destination will be the framebuffer 0, which is the screen. +// +// If the sizes of the rectangles don't match, the source will be stretched to fit the destination +// rectangle. The stretch will be either smooth or pixely according to the source Frame's +// smoothness. +func (f *Frame) Blit(dst *Frame, sx0, sy0, sx1, sy1, dx0, dy0, dx1, dy1 int) { + f.rf.obj = f.fb.obj + if dst != nil { + f.df.obj = dst.fb.obj + } else { + f.df.obj = 0 + } + f.rf.bind() + f.df.bind() + + filter := gl.NEAREST + if f.tex.smooth { + filter = gl.LINEAR + } + + gl.BlitFramebuffer( + int32(sx0), int32(sy0), int32(sx1), int32(sy1), + int32(dx0), int32(dy0), int32(dx1), int32(dy1), + gl.COLOR_BUFFER_BIT, uint32(filter), + ) + + f.rf.restore() + f.df.restore() +} + +// Texture returns the Frame's underlying Texture that the Frame draws on. +func (f *Frame) Texture() *Texture { + return f.tex +} diff --git a/vendor/github.com/faiface/glhf/interface.go b/vendor/github.com/faiface/glhf/interface.go new file mode 100644 index 0000000..0511ced --- /dev/null +++ b/vendor/github.com/faiface/glhf/interface.go @@ -0,0 +1,11 @@ +package glhf + +// BeginEnder is an interface for manipulating OpenGL state. +// +// OpenGL is a state machine. Every object can 'enter' it's state and 'leave' it's state. For +// example, you can bind a buffer and unbind a buffer, bind a texture and unbind it, use shader +// and unuse it, and so on. +type BeginEnder interface { + Begin() + End() +} diff --git a/vendor/github.com/faiface/glhf/orphan.go b/vendor/github.com/faiface/glhf/orphan.go new file mode 100644 index 0000000..7e93751 --- /dev/null +++ b/vendor/github.com/faiface/glhf/orphan.go @@ -0,0 +1,51 @@ +package glhf + +import "github.com/go-gl/gl/v3.3-core/gl" + +// Init initializes OpenGL by loading function pointers from the active OpenGL context. +// This function must be manually run inside the main thread (using "github.com/faiface/mainthread" +// package). +// +// It must be called under the presence of an active OpenGL context, e.g., always after calling +// window.MakeContextCurrent(). Also, always call this function when switching contexts. +func Init() { + err := gl.Init() + if err != nil { + panic(err) + } + gl.Enable(gl.BLEND) + gl.Enable(gl.SCISSOR_TEST) + gl.BlendEquation(gl.FUNC_ADD) +} + +// Clear clears the current framebuffer or window with the given color. +func Clear(r, g, b, a float32) { + gl.ClearColor(r, g, b, a) + gl.Clear(gl.COLOR_BUFFER_BIT) +} + +// Bounds sets the drawing bounds in pixels. Drawing outside bounds is always discarted. +// +// Calling this function is equivalent to setting viewport and scissor in OpenGL. +func Bounds(x, y, w, h int) { + gl.Viewport(int32(x), int32(y), int32(w), int32(h)) + gl.Scissor(int32(x), int32(y), int32(w), int32(h)) +} + +// BlendFactor represents a source or destination blend factor. +type BlendFactor int + +// Here's the list of all blend factors. +const ( + One = BlendFactor(gl.ONE) + Zero = BlendFactor(gl.ZERO) + SrcAlpha = BlendFactor(gl.SRC_ALPHA) + DstAlpha = BlendFactor(gl.DST_ALPHA) + OneMinusSrcAlpha = BlendFactor(gl.ONE_MINUS_SRC_ALPHA) + OneMinusDstAlpha = BlendFactor(gl.ONE_MINUS_DST_ALPHA) +) + +// BlendFunc sets the source and destination blend factor. +func BlendFunc(src, dst BlendFactor) { + gl.BlendFunc(uint32(src), uint32(dst)) +} diff --git a/vendor/github.com/faiface/glhf/shader.go b/vendor/github.com/faiface/glhf/shader.go new file mode 100644 index 0000000..ad4c8f0 --- /dev/null +++ b/vendor/github.com/faiface/glhf/shader.go @@ -0,0 +1,224 @@ +package glhf + +import ( + "fmt" + "runtime" + + "github.com/faiface/mainthread" + "github.com/go-gl/gl/v3.3-core/gl" + "github.com/go-gl/mathgl/mgl32" +) + +// Shader is an OpenGL shader program. +type Shader struct { + program binder + vertexFmt AttrFormat + uniformFmt AttrFormat + uniformLoc []int32 +} + +// NewShader creates a new shader program from the specified vertex shader and fragment shader +// sources. +// +// Note that vertexShader and fragmentShader parameters must contain the source code, they're +// not filenames. +func NewShader(vertexFmt, uniformFmt AttrFormat, vertexShader, fragmentShader string) (*Shader, error) { + shader := &Shader{ + program: binder{ + restoreLoc: gl.CURRENT_PROGRAM, + bindFunc: func(obj uint32) { + gl.UseProgram(obj) + }, + }, + vertexFmt: vertexFmt, + uniformFmt: uniformFmt, + uniformLoc: make([]int32, len(uniformFmt)), + } + + var vshader, fshader uint32 + + // vertex shader + { + vshader = gl.CreateShader(gl.VERTEX_SHADER) + src, free := gl.Strs(vertexShader) + defer free() + length := int32(len(vertexShader)) + gl.ShaderSource(vshader, 1, src, &length) + gl.CompileShader(vshader) + + var success int32 + gl.GetShaderiv(vshader, gl.COMPILE_STATUS, &success) + if success == gl.FALSE { + var logLen int32 + gl.GetShaderiv(vshader, gl.INFO_LOG_LENGTH, &logLen) + + infoLog := make([]byte, logLen) + gl.GetShaderInfoLog(vshader, logLen, nil, &infoLog[0]) + return nil, fmt.Errorf("error compiling vertex shader: %s", string(infoLog)) + } + + defer gl.DeleteShader(vshader) + } + + // fragment shader + { + fshader = gl.CreateShader(gl.FRAGMENT_SHADER) + src, free := gl.Strs(fragmentShader) + defer free() + length := int32(len(fragmentShader)) + gl.ShaderSource(fshader, 1, src, &length) + gl.CompileShader(fshader) + + var success int32 + gl.GetShaderiv(fshader, gl.COMPILE_STATUS, &success) + if success == gl.FALSE { + var logLen int32 + gl.GetShaderiv(fshader, gl.INFO_LOG_LENGTH, &logLen) + + infoLog := make([]byte, logLen) + gl.GetShaderInfoLog(fshader, logLen, nil, &infoLog[0]) + return nil, fmt.Errorf("error compiling fragment shader: %s", string(infoLog)) + } + + defer gl.DeleteShader(fshader) + } + + // shader program + { + shader.program.obj = gl.CreateProgram() + gl.AttachShader(shader.program.obj, vshader) + gl.AttachShader(shader.program.obj, fshader) + gl.LinkProgram(shader.program.obj) + + var success int32 + gl.GetProgramiv(shader.program.obj, gl.LINK_STATUS, &success) + if success == gl.FALSE { + var logLen int32 + gl.GetProgramiv(shader.program.obj, gl.INFO_LOG_LENGTH, &logLen) + + infoLog := make([]byte, logLen) + gl.GetProgramInfoLog(shader.program.obj, logLen, nil, &infoLog[0]) + return nil, fmt.Errorf("error linking shader program: %s", string(infoLog)) + } + } + + // uniforms + for i, uniform := range uniformFmt { + loc := gl.GetUniformLocation(shader.program.obj, gl.Str(uniform.Name+"\x00")) + shader.uniformLoc[i] = loc + } + + runtime.SetFinalizer(shader, (*Shader).delete) + + return shader, nil +} + +func (s *Shader) delete() { + mainthread.CallNonBlock(func() { + gl.DeleteProgram(s.program.obj) + }) +} + +// ID returns the OpenGL ID of this Shader. +func (s *Shader) ID() uint32 { + return s.program.obj +} + +// VertexFormat returns the vertex attribute format of this Shader. Do not change it. +func (s *Shader) VertexFormat() AttrFormat { + return s.vertexFmt +} + +// UniformFormat returns the uniform attribute format of this Shader. Do not change it. +func (s *Shader) UniformFormat() AttrFormat { + return s.uniformFmt +} + +// SetUniformAttr sets the value of a uniform attribute of this Shader. The attribute is +// specified by the index in the Shader's uniform format. +// +// If the uniform attribute does not exist in the Shader, this method returns false. +// +// Supplied value must correspond to the type of the attribute. Correct types are these +// (right-hand is the type of the value): +// Attr{Type: Int}: int32 +// Attr{Type: Float}: float32 +// Attr{Type: Vec2}: mgl32.Vec2 +// Attr{Type: Vec3}: mgl32.Vec3 +// Attr{Type: Vec4}: mgl32.Vec4 +// Attr{Type: Mat2}: mgl32.Mat2 +// Attr{Type: Mat23}: mgl32.Mat2x3 +// Attr{Type: Mat24}: mgl32.Mat2x4 +// Attr{Type: Mat3}: mgl32.Mat3 +// Attr{Type: Mat32}: mgl32.Mat3x2 +// Attr{Type: Mat34}: mgl32.Mat3x4 +// Attr{Type: Mat4}: mgl32.Mat4 +// Attr{Type: Mat42}: mgl32.Mat4x2 +// Attr{Type: Mat43}: mgl32.Mat4x3 +// No other types are supported. +// +// The Shader must be bound before calling this method. +func (s *Shader) SetUniformAttr(uniform int, value interface{}) (ok bool) { + if s.uniformLoc[uniform] < 0 { + return false + } + + switch s.uniformFmt[uniform].Type { + case Int: + value := value.(int32) + gl.Uniform1iv(s.uniformLoc[uniform], 1, &value) + case Float: + value := value.(float32) + gl.Uniform1fv(s.uniformLoc[uniform], 1, &value) + case Vec2: + value := value.(mgl32.Vec2) + gl.Uniform2fv(s.uniformLoc[uniform], 1, &value[0]) + case Vec3: + value := value.(mgl32.Vec3) + gl.Uniform3fv(s.uniformLoc[uniform], 1, &value[0]) + case Vec4: + value := value.(mgl32.Vec4) + gl.Uniform4fv(s.uniformLoc[uniform], 1, &value[0]) + case Mat2: + value := value.(mgl32.Mat2) + gl.UniformMatrix2fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat23: + value := value.(mgl32.Mat2x3) + gl.UniformMatrix2x3fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat24: + value := value.(mgl32.Mat2x4) + gl.UniformMatrix2x4fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat3: + value := value.(mgl32.Mat3) + gl.UniformMatrix3fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat32: + value := value.(mgl32.Mat3x2) + gl.UniformMatrix3x2fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat34: + value := value.(mgl32.Mat3x4) + gl.UniformMatrix3x4fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat4: + value := value.(mgl32.Mat4) + gl.UniformMatrix4fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat42: + value := value.(mgl32.Mat4x2) + gl.UniformMatrix4x2fv(s.uniformLoc[uniform], 1, false, &value[0]) + case Mat43: + value := value.(mgl32.Mat4x3) + gl.UniformMatrix4x3fv(s.uniformLoc[uniform], 1, false, &value[0]) + default: + panic("set uniform attr: invalid attribute type") + } + + return true +} + +// Begin binds the Shader program. This is necessary before using the Shader. +func (s *Shader) Begin() { + s.program.bind() +} + +// End unbinds the Shader program and restores the previous one. +func (s *Shader) End() { + s.program.restore() +} diff --git a/vendor/github.com/faiface/glhf/texture.go b/vendor/github.com/faiface/glhf/texture.go new file mode 100644 index 0000000..041c9b5 --- /dev/null +++ b/vendor/github.com/faiface/glhf/texture.go @@ -0,0 +1,148 @@ +package glhf + +import ( + "runtime" + + "github.com/faiface/mainthread" + "github.com/go-gl/gl/v3.3-core/gl" + "github.com/go-gl/mathgl/mgl32" +) + +// Texture is an OpenGL texture. +type Texture struct { + tex binder + width, height int + smooth bool +} + +// NewTexture creates a new texture with the specified width and height with some initial +// pixel values. The pixels must be a sequence of RGBA values (one byte per component). +func NewTexture(width, height int, smooth bool, pixels []uint8) *Texture { + tex := &Texture{ + tex: binder{ + restoreLoc: gl.TEXTURE_BINDING_2D, + bindFunc: func(obj uint32) { + gl.BindTexture(gl.TEXTURE_2D, obj) + }, + }, + width: width, + height: height, + } + + gl.GenTextures(1, &tex.tex.obj) + + tex.Begin() + defer tex.End() + + // initial data + gl.TexImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + int32(width), + int32(height), + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + gl.Ptr(pixels), + ) + + borderColor := mgl32.Vec4{0, 0, 0, 0} + gl.TexParameterfv(gl.TEXTURE_2D, gl.TEXTURE_BORDER_COLOR, &borderColor[0]) + gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_BORDER) + gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_BORDER) + + tex.SetSmooth(smooth) + + runtime.SetFinalizer(tex, (*Texture).delete) + + return tex +} + +func (t *Texture) delete() { + mainthread.CallNonBlock(func() { + gl.DeleteTextures(1, &t.tex.obj) + }) +} + +// ID returns the OpenGL ID of this Texture. +func (t *Texture) ID() uint32 { + return t.tex.obj +} + +// Width returns the width of the Texture in pixels. +func (t *Texture) Width() int { + return t.width +} + +// Height returns the height of the Texture in pixels. +func (t *Texture) Height() int { + return t.height +} + +// SetPixels sets the content of a sub-region of the Texture. Pixels must be an RGBA byte sequence. +func (t *Texture) SetPixels(x, y, w, h int, pixels []uint8) { + if len(pixels) != w*h*4 { + panic("set pixels: wrong number of pixels") + } + gl.TexSubImage2D( + gl.TEXTURE_2D, + 0, + int32(x), + int32(y), + int32(w), + int32(h), + gl.RGBA, + gl.UNSIGNED_BYTE, + gl.Ptr(pixels), + ) +} + +// Pixels returns the content of a sub-region of the Texture as an RGBA byte sequence. +func (t *Texture) Pixels(x, y, w, h int) []uint8 { + pixels := make([]uint8, t.width*t.height*4) + gl.GetTexImage( + gl.TEXTURE_2D, + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + gl.Ptr(pixels), + ) + subPixels := make([]uint8, w*h*4) + for i := 0; i < h; i++ { + row := pixels[(i+y)*t.width*4+x*4 : (i+y)*t.width*4+(x+w)*4] + subRow := subPixels[i*w*4 : (i+1)*w*4] + copy(subRow, row) + } + return subPixels +} + +// SetSmooth sets whether the Texture should be drawn "smoothly" or "pixely". +// +// It affects how the Texture is drawn when zoomed. Smooth interpolates between the neighbour +// pixels, while pixely always chooses the nearest pixel. +func (t *Texture) SetSmooth(smooth bool) { + t.smooth = smooth + if smooth { + gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR) + gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR) + } else { + gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST) + gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST) + } +} + +// Smooth returns whether the Texture is set to be drawn "smooth" or "pixely". +func (t *Texture) Smooth() bool { + return t.smooth +} + +// Begin binds the Texture. This is necessary before using the Texture. +func (t *Texture) Begin() { + t.tex.bind() +} + +// End unbinds the Texture and restores the previous one. +func (t *Texture) End() { + t.tex.restore() +} diff --git a/vendor/github.com/faiface/glhf/util.go b/vendor/github.com/faiface/glhf/util.go new file mode 100644 index 0000000..725b55b --- /dev/null +++ b/vendor/github.com/faiface/glhf/util.go @@ -0,0 +1,31 @@ +package glhf + +import "github.com/go-gl/gl/v3.3-core/gl" + +type binder struct { + restoreLoc uint32 + bindFunc func(uint32) + + obj uint32 + + prev []uint32 +} + +func (b *binder) bind() *binder { + var prev int32 + gl.GetIntegerv(b.restoreLoc, &prev) + b.prev = append(b.prev, uint32(prev)) + + if b.prev[len(b.prev)-1] != b.obj { + b.bindFunc(b.obj) + } + return b +} + +func (b *binder) restore() *binder { + if b.prev[len(b.prev)-1] != b.obj { + b.bindFunc(b.prev[len(b.prev)-1]) + } + b.prev = b.prev[:len(b.prev)-1] + return b +} diff --git a/vendor/github.com/faiface/glhf/vertex.go b/vendor/github.com/faiface/glhf/vertex.go new file mode 100644 index 0000000..4268ffc --- /dev/null +++ b/vendor/github.com/faiface/glhf/vertex.go @@ -0,0 +1,285 @@ +package glhf + +import ( + "fmt" + "runtime" + + "github.com/faiface/mainthread" + "github.com/go-gl/gl/v3.3-core/gl" + "github.com/pkg/errors" +) + +// VertexSlice points to a portion of (or possibly whole) vertex array. It is used as a pointer, +// contrary to Go's builtin slices. This is, so that append can be 'in-place'. That's for the good, +// because Begin/End-ing a VertexSlice would become super confusing, if append returned a new +// VertexSlice. +// +// It also implements all basic slice-like operations: appending, sub-slicing, etc. +// +// Note that you need to Begin a VertexSlice before getting or updating it's elements or drawing it. +// After you're done with it, you need to End it. +type VertexSlice struct { + va *vertexArray + i, j int +} + +// MakeVertexSlice allocates a new vertex array with specified capacity and returns a VertexSlice +// that points to it's first len elements. +// +// Note, that a vertex array is specialized for a specific shader and can't be used with another +// shader. +func MakeVertexSlice(shader *Shader, len, cap int) *VertexSlice { + if len > cap { + panic("failed to make vertex slice: len > cap") + } + return &VertexSlice{ + va: newVertexArray(shader, cap), + i: 0, + j: len, + } +} + +// VertexFormat returns the format of vertex attributes inside the underlying vertex array of this +// VertexSlice. +func (vs *VertexSlice) VertexFormat() AttrFormat { + return vs.va.format +} + +// Stride returns the number of float32 elements occupied by one vertex. +func (vs *VertexSlice) Stride() int { + return vs.va.stride / 4 +} + +// Len returns the length of the VertexSlice (number of vertices). +func (vs *VertexSlice) Len() int { + return vs.j - vs.i +} + +// Cap returns the capacity of an underlying vertex array. +func (vs *VertexSlice) Cap() int { + return vs.va.cap - vs.i +} + +// SetLen resizes the VertexSlice to length len. +func (vs *VertexSlice) SetLen(len int) { + vs.End() // vs must have been Begin-ed before calling this method + *vs = vs.grow(len) + vs.Begin() +} + +// grow returns supplied vs with length changed to len. Allocates new underlying vertex array if +// necessary. The original content is preserved. +func (vs VertexSlice) grow(len int) VertexSlice { + if len <= vs.Cap() { + // capacity sufficient + return VertexSlice{ + va: vs.va, + i: vs.i, + j: vs.i + len, + } + } + + // grow the capacity + newCap := vs.Cap() + if newCap < 1024 { + newCap += newCap + } else { + newCap += newCap / 4 + } + if newCap < len { + newCap = len + } + newVs := VertexSlice{ + va: newVertexArray(vs.va.shader, newCap), + i: 0, + j: len, + } + // preserve the original content + newVs.Begin() + newVs.Slice(0, vs.Len()).SetVertexData(vs.VertexData()) + newVs.End() + return newVs +} + +// Slice returns a sub-slice of this VertexSlice covering the range [i, j) (relative to this +// VertexSlice). +// +// Note, that the returned VertexSlice shares an underlying vertex array with the original +// VertexSlice. Modifying the contents of one modifies corresponding contents of the other. +func (vs *VertexSlice) Slice(i, j int) *VertexSlice { + if i < 0 || j < i || j > vs.va.cap { + panic("failed to slice vertex slice: index out of range") + } + return &VertexSlice{ + va: vs.va, + i: vs.i + i, + j: vs.i + j, + } +} + +// SetVertexData sets the contents of the VertexSlice. +// +// The data is a slice of float32's, where each vertex attribute occupies a certain number of +// elements. Namely, Float occupies 1, Vec2 occupies 2, Vec3 occupies 3 and Vec4 occupies 4. The +// attribues in the data slice must be in the same order as in the vertex format of this Vertex +// Slice. +// +// If the length of vertices does not match the length of the VertexSlice, this methdo panics. +func (vs *VertexSlice) SetVertexData(data []float32) { + if len(data)/vs.Stride() != vs.Len() { + fmt.Println(len(data)/vs.Stride(), vs.Len()) + panic("set vertex data: wrong length of vertices") + } + vs.va.setVertexData(vs.i, vs.j, data) +} + +// VertexData returns the contents of the VertexSlice. +// +// The data is in the same format as with SetVertexData. +func (vs *VertexSlice) VertexData() []float32 { + return vs.va.vertexData(vs.i, vs.j) +} + +// Draw draws the content of the VertexSlice. +func (vs *VertexSlice) Draw() { + vs.va.draw(vs.i, vs.j) +} + +// Begin binds the underlying vertex array. Calling this method is necessary before using the VertexSlice. +func (vs *VertexSlice) Begin() { + vs.va.begin() +} + +// End unbinds the underlying vertex array. Call this method when you're done with VertexSlice. +func (vs *VertexSlice) End() { + vs.va.end() +} + +type vertexArray struct { + vao, vbo binder + cap int + format AttrFormat + stride int + offset []int + shader *Shader +} + +const vertexArrayMinCap = 4 + +func newVertexArray(shader *Shader, cap int) *vertexArray { + if cap < vertexArrayMinCap { + cap = vertexArrayMinCap + } + + va := &vertexArray{ + vao: binder{ + restoreLoc: gl.VERTEX_ARRAY_BINDING, + bindFunc: func(obj uint32) { + gl.BindVertexArray(obj) + }, + }, + vbo: binder{ + restoreLoc: gl.ARRAY_BUFFER_BINDING, + bindFunc: func(obj uint32) { + gl.BindBuffer(gl.ARRAY_BUFFER, obj) + }, + }, + cap: cap, + format: shader.VertexFormat(), + stride: shader.VertexFormat().Size(), + offset: make([]int, len(shader.VertexFormat())), + shader: shader, + } + + offset := 0 + for i, attr := range va.format { + switch attr.Type { + case Float, Vec2, Vec3, Vec4: + default: + panic(errors.New("failed to create vertex array: invalid attribute type")) + } + va.offset[i] = offset + offset += attr.Type.Size() + } + + gl.GenVertexArrays(1, &va.vao.obj) + + va.vao.bind() + + gl.GenBuffers(1, &va.vbo.obj) + defer va.vbo.bind().restore() + + emptyData := make([]byte, cap*va.stride) + gl.BufferData(gl.ARRAY_BUFFER, len(emptyData), gl.Ptr(emptyData), gl.DYNAMIC_DRAW) + + for i, attr := range va.format { + loc := gl.GetAttribLocation(shader.program.obj, gl.Str(attr.Name+"\x00")) + + var size int32 + switch attr.Type { + case Float: + size = 1 + case Vec2: + size = 2 + case Vec3: + size = 3 + case Vec4: + size = 4 + } + + gl.VertexAttribPointer( + uint32(loc), + size, + gl.FLOAT, + false, + int32(va.stride), + gl.PtrOffset(va.offset[i]), + ) + gl.EnableVertexAttribArray(uint32(loc)) + } + + va.vao.restore() + + runtime.SetFinalizer(va, (*vertexArray).delete) + + return va +} + +func (va *vertexArray) delete() { + mainthread.CallNonBlock(func() { + gl.DeleteVertexArrays(1, &va.vao.obj) + gl.DeleteBuffers(1, &va.vbo.obj) + }) +} + +func (va *vertexArray) begin() { + va.vao.bind() + va.vbo.bind() +} + +func (va *vertexArray) end() { + va.vbo.restore() + va.vao.restore() +} + +func (va *vertexArray) draw(i, j int) { + gl.DrawArrays(gl.TRIANGLES, int32(i), int32(i+j)) +} + +func (va *vertexArray) setVertexData(i, j int, data []float32) { + if j-i == 0 { + // avoid setting 0 bytes of buffer data + return + } + gl.BufferSubData(gl.ARRAY_BUFFER, i*va.stride, len(data)*4, gl.Ptr(data)) +} + +func (va *vertexArray) vertexData(i, j int) []float32 { + if j-i == 0 { + // avoid getting 0 bytes of buffer data + return nil + } + data := make([]float32, (j-i)*va.stride/4) + gl.GetBufferSubData(gl.ARRAY_BUFFER, i*va.stride, len(data)*4, gl.Ptr(data)) + return data +} diff --git a/vendor/github.com/faiface/mainthread/LICENSE b/vendor/github.com/faiface/mainthread/LICENSE new file mode 100644 index 0000000..b497e83 --- /dev/null +++ b/vendor/github.com/faiface/mainthread/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Michal Štrba + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/faiface/mainthread/README.md b/vendor/github.com/faiface/mainthread/README.md new file mode 100644 index 0000000..20c834f --- /dev/null +++ b/vendor/github.com/faiface/mainthread/README.md @@ -0,0 +1,71 @@ +# mainthread [![GoDoc](https://godoc.org/github.com/faiface/mainthread?status.svg)](http://godoc.org/github.com/faiface/mainthread) [![Report card](https://goreportcard.com/badge/github.com/faiface/mainthread)](https://goreportcard.com/report/github.com/faiface/mainthread) + +Package mainthread allows you to run code on the main operating system thread. + +`go get github.com/faiface/mainthread` + +Operating systems often require, that code which deals with windows and graphics has to run on the +main thread. This is however somehow challenging in Go due to Go's concurrent nature. + +This package makes it easily possible. + +All you need to do is put your main code into a separate function and call `mainthread.Run` from +your real main, like this: + +```go +package main + +import ( + "fmt" + + "github.com/faiface/mainthread" +) + +func run() { + // now we can run stuff on the main thread like this + mainthread.Call(func() { + fmt.Println("printing from the main thread") + }) + fmt.Println("printing from another thread") +} + +func main() { + mainthread.Run(run) // enables mainthread package and runs run in a separate goroutine +} +``` + +## More functions + +If you don't wish to wait until a function finishes running on the main thread, use +`mainthread.CallNonBlock`: + +```go +mainthread.CallNonBlock(func() { + fmt.Println("i'm in the main thread") +}) +fmt.Println("but imma be likely printed first, cuz i don't wait") +``` + +If you want to get some value returned from the main thread, you can use `mainthread.CallErr` or +`mainthread.CallVal`: + +```go +err := mainthread.CallErr(func() error { + return nil // i don't do nothing wrong +}) +val := mainthread.CallVal(func() interface{} { + return 42 // the meaning of life, universe and everything +}) +``` + +If `mainthread.CallErr` or `mainthread.CallVal` aren't sufficient for you, you can just assign +variables from within the main thread: + +```go +var x, y int +mainthread.Call(func() { + x, y = 1, 2 +}) +``` + +However, be careful with `mainthread.CallNonBlock` when dealing with local variables. diff --git a/vendor/github.com/faiface/mainthread/mainthread.go b/vendor/github.com/faiface/mainthread/mainthread.go new file mode 100644 index 0000000..7964520 --- /dev/null +++ b/vendor/github.com/faiface/mainthread/mainthread.go @@ -0,0 +1,87 @@ +package mainthread + +import ( + "errors" + "runtime" +) + +// CallQueueCap is the capacity of the call queue. This means how many calls to CallNonBlock will not +// block until some call finishes. +// +// The default value is 16 and should be good for 99% usecases. +var CallQueueCap = 16 + +var ( + callQueue chan func() +) + +func init() { + runtime.LockOSThread() +} + +func checkRun() { + if callQueue == nil { + panic(errors.New("mainthread: did not call Run")) + } +} + +// Run enables mainthread package functionality. To use mainthread package, put your main function +// code into the run function (the argument to Run) and simply call Run from the real main function. +// +// Run returns when run (argument) function finishes. +func Run(run func()) { + callQueue = make(chan func(), CallQueueCap) + + done := make(chan struct{}) + go func() { + run() + done <- struct{}{} + }() + + for { + select { + case f := <-callQueue: + f() + case <-done: + return + } + } +} + +// CallNonBlock queues function f on the main thread and returns immediately. Does not wait until f +// finishes. +func CallNonBlock(f func()) { + checkRun() + callQueue <- f +} + +// Call queues function f on the main thread and blocks until the function f finishes. +func Call(f func()) { + checkRun() + done := make(chan struct{}) + callQueue <- func() { + f() + done <- struct{}{} + } + <-done +} + +// CallErr queues function f on the main thread and returns an error returned by f. +func CallErr(f func() error) error { + checkRun() + errChan := make(chan error) + callQueue <- func() { + errChan <- f() + } + return <-errChan +} + +// CallVal queues function f on the main thread and returns a value returned by f. +func CallVal(f func() interface{}) interface{} { + checkRun() + respChan := make(chan interface{}) + callQueue <- func() { + respChan <- f() + } + return <-respChan +} diff --git a/vendor/github.com/faiface/pixel/.gitignore b/vendor/github.com/faiface/pixel/.gitignore new file mode 100644 index 0000000..eedaa3c --- /dev/null +++ b/vendor/github.com/faiface/pixel/.gitignore @@ -0,0 +1,2 @@ +test +.vscode \ No newline at end of file diff --git a/vendor/github.com/faiface/pixel/.travis.yml b/vendor/github.com/faiface/pixel/.travis.yml new file mode 100644 index 0000000..c24a7bc --- /dev/null +++ b/vendor/github.com/faiface/pixel/.travis.yml @@ -0,0 +1,23 @@ +language: go +sudo: false +addons: + apt: + packages: + - xorg-dev + - libx11-dev + - libxrandr-dev + - libxinerama-dev + - libxcursor-dev + - libxi-dev + - libopenal-dev + - libasound2-dev +go: +- 1.8 +- 1.7.4 +- tip +install: +- go get -t ./... +script: +- go test -i -race ./... +- go test -v -race ./... + diff --git a/vendor/github.com/faiface/pixel/CONTRIBUTING.md b/vendor/github.com/faiface/pixel/CONTRIBUTING.md new file mode 100644 index 0000000..2e5d481 --- /dev/null +++ b/vendor/github.com/faiface/pixel/CONTRIBUTING.md @@ -0,0 +1,14 @@ +# Contributing to Pixel + +:tada: Hi! I'm really glad you're considering contributing to Pixel! :tada: + +## Here are a few ways you can contribute + +1. **Make a community example** and place it inside the [examples/community](examples/community) folder. +2. **Add tests**. There only few tests in Pixel at the moment. Take a look at them and make some similar. +3. **Add a small feature or an improvement**. Feel like some small feature is missing? Just make a PR. Be ready that I might reject it, though, if I don't find it particularly appealing. +4. **Join the big development** by joining the discussion at the [Gitter](https://gitter.im/pixellib/Lobby), where we can discuss bigger changes and implement them after that. + +## How to make a pull request + +Go gives you a nice surprise when attempting to make a PR on Github. The thing is, that when user _xyz_ forks Pixel on Github, it ends up in _github.com/xyz/pixel_, which fucks up your import paths. Here's how you deal with that: https://www.reddit.com/r/golang/comments/2jdcw1/how_do_you_deal_with_github_forking/. diff --git a/vendor/github.com/faiface/pixel/LICENSE b/vendor/github.com/faiface/pixel/LICENSE new file mode 100644 index 0000000..683f9ea --- /dev/null +++ b/vendor/github.com/faiface/pixel/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Michal Štrba + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/faiface/pixel/README.md b/vendor/github.com/faiface/pixel/README.md new file mode 100644 index 0000000..cadaa9f --- /dev/null +++ b/vendor/github.com/faiface/pixel/README.md @@ -0,0 +1,160 @@ +# Pixel [![Build Status](https://travis-ci.org/faiface/pixel.svg?branch=master)](https://travis-ci.org/faiface/pixel) [![GoDoc](https://godoc.org/github.com/faiface/pixel?status.svg)](https://godoc.org/github.com/faiface/pixel) [![Go Report Card](https://goreportcard.com/badge/github.com/faiface/pixel)](https://goreportcard.com/report/github.com/faiface/pixel) [![Join the chat at https://gitter.im/pixellib/Lobby](https://badges.gitter.im/pixellib/Lobby.svg)](https://gitter.im/pixellib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + +A hand-crafted 2D game library in Go. Take a look into the [features](#features) to see what it can +do. + +``` +go get github.com/faiface/pixel +``` + +See [requirements](#requirements) for the list of libraries necessary for compilation. + +## Tutorial + +The [Wiki of this repo](https://github.com/faiface/pixel/wiki) contains an extensive tutorial +covering several topics of Pixel. Here's the content of the tutorial parts so far: + +- [Creating a Window](https://github.com/faiface/pixel/wiki/Creating-a-Window) +- [Drawing a Sprite](https://github.com/faiface/pixel/wiki/Drawing-a-Sprite) +- [Moving, scaling and rotating with Matrix](https://github.com/faiface/pixel/wiki/Moving,-scaling-and-rotating-with-Matrix) +- [Pressing keys and clicking mouse](https://github.com/faiface/pixel/wiki/Pressing-keys-and-clicking-mouse) +- [Drawing efficiently with Batch](https://github.com/faiface/pixel/wiki/Drawing-efficiently-with-Batch) +- [Drawing shapes with IMDraw](https://github.com/faiface/pixel/wiki/Drawing-shapes-with-IMDraw) +- [Typing text on the screen](https://github.com/faiface/pixel/wiki/Typing-text-on-the-screen) + +## Examples + +The [examples](https://github.com/faiface/pixel/tree/master/examples) directory contains a few +examples demonstrating Pixel's functionality. + +**To run an example**, navigate to it's directory, then `go run` the `main.go` file. For example: + +``` +$ cd examples/platformer +$ go run main.go +``` + +Here are some screenshots from the examples! + +| [Lights](examples/lights) | [Platformer](examples/platformer) | +| --- | --- | +| ![Lights](examples/lights/screenshot.png) | ![Platformer](examples/platformer/screenshot.png) | + +| [Smoke](examples/smoke) | [Typewriter](examples/typewriter) | +| --- | --- | +| ![Smoke](examples/smoke/screenshot.png) | ![Typewriter](examples/typewriter/screenshot.png) | + +| [Raycaster](examples/community/raycaster) | [Starfield](examples/community/starfield) | +| --- | --- | +| ![Raycaster](examples/community/raycaster/screenshot.png) | ![Starfield](examples/community/starfield/screenshot.png) | + +## Features + +Here's the list of the main features in Pixel. Although Pixel is still under heavy development, +**there should be no major breakage in the API.** This is not a 100% guarantee, though. + +- Fast 2D graphics + - Sprites + - Primitive shapes with immediate mode style + [IMDraw](https://github.com/faiface/pixel/wiki/Drawing-shapes-with-IMDraw) (circles, rectangles, + lines, ...) + - Optimized drawing with [Batch](https://github.com/faiface/pixel/wiki/Drawing-efficiently-with-Batch) + - Text drawing with [text](https://godoc.org/github.com/faiface/pixel/text) package +- Audio through a separate [Beep](https://github.com/faiface/beep) library. +- Simple and convenient API + - Drawing a sprite to a window is as simple as `sprite.Draw(window, matrix)` + - Wanna know where the center of a window is? `window.Bounds().Center()` + - [...](https://godoc.org/github.com/faiface/pixel) +- Full documentation and tutorial +- Works on Linux, macOS and Windows +- Window creation and manipulation (resizing, fullscreen, multiple windows, ...) +- Keyboard (key presses, text input) and mouse input without events +- Well integrated with the Go standard library + - Use `"image"` package for loading pictures + - Use `"time"` package for measuring delta time and FPS + - Use `"image/color"` for colors, or use Pixel's own `color.Color` format, which supports easy + multiplication and a few more features + - Pixel uses `float64` throughout the library, compatible with `"math"` package +- Geometry transformations with + [Matrix](https://github.com/faiface/pixel/wiki/Moving,-scaling-and-rotating-with-Matrix) + - Moving, scaling, rotating + - Easy camera implementation +- Off-screen drawing to Canvas or any other target (Batch, IMDraw, ...) +- Fully garbage collected, no `Close` or `Dispose` methods +- Full [Porter-Duff](http://ssp.impulsetrain.com/porterduff.html) composition, which enables + - 2D lighting + - Cutting holes into objects + - Much more... +- Pixel let's you draw stuff and do your job, it doesn't impose any particular style or paradigm +- Platform and backend independent [core](https://godoc.org/github.com/faiface/pixel) +- Core Target/Triangles/Picture pattern makes it easy to create new drawing targets that do + arbitrarily crazy stuff (e.g. graphical effects) +- Small codebase, ~5K lines of code, including the backend [glhf](https://github.com/faiface/glhf) + package + +## Missing features + +Pixel is in development and still missing few critical features. Here're the most critical ones. + +- ~~Audio~~ +- ~~Drawing text~~ +- Antialiasing (filtering is supported, though) +- ~~Advanced window manipulation (cursor hiding, window icon, ...)~~ +- Better support for Hi-DPI displays +- Mobile (and perhaps HTML5?) backend +- More advanced graphical effects (e.g. blur) +- Tests and benchmarks + +**Implementing these features will get us to the 1.0 release.** Contribute, so that it's as soon as +possible! + +## Requirements + +If you're using Windows and having trouble building Pixel, please check [this +guide](https://github.com/faiface/pixel/wiki/Building-Pixel-on-Windows) on the +[wiki](https://github.com/faiface/pixel/wiki). + +[PixelGL](https://godoc.org/github.com/faiface/pixel/pixelgl) backend uses OpenGL to render +graphics. Because of that, OpenGL development libraries are needed for compilation. The dependencies +are same as for [GLFW](https://github.com/go-gl/glfw). + +The OpenGL version used is **OpenGL 3.3**. + +- On macOS, you need Xcode or Command Line Tools for Xcode (`xcode-select --install`) for required + headers and libraries. +- On Ubuntu/Debian-like Linux distributions, you need `libgl1-mesa-dev` and `xorg-dev` packages. +- On CentOS/Fedora-like Linux distributions, you need `libX11-devel libXcursor-devel libXrandr-devel + libXinerama-devel mesa-libGL-devel libXi-devel` packages. +- See [here](http://www.glfw.org/docs/latest/compile.html#compile_deps) for full details. + +**The combination of Go 1.8, macOS and latest XCode seems to be problematic** as mentioned in issue +[#7](https://github.com/faiface/pixel/issues/7). This issue is probably not related to Pixel. +**Upgrading to Go 1.8.1 fixes the issue.** + +## Contributing + +Pixel is in, let's say, mid-stage of development. Many of the important features are here, some are +missing. That's why **contributions are very important and welcome!** All alone, I will be able to +finish the library, but it'll take a lot of time. With your help, it'll take much less. I encourage +everyone to contribute, even with just an idea. Especially welcome are **issues** and **pull +requests**. + +**However, I won't accept everything. Pixel is being developed with thought and care.** Each +component was designed and re-designed multiple times. Code and API quality is very important here. +API is focused on simplicity and expressiveness. + +When contributing, keep these goals in mind. It doesn't mean that I'll only accept perfect pull +requests. It just means that I might not like your idea. Or that your pull requests could need some +rewriting. That's perfectly fine, don't let it put you off. In the end, we'll just end up with a +better result. + +Take a look at [CONTRIBUTING.md](CONTRIBUTING.md) for further information. + +For any kind of discussion, feel free to use our +[Gitter](https://gitter.im/pixellib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +community. + +## License + +[MIT](LICENSE) diff --git a/vendor/github.com/faiface/pixel/batch.go b/vendor/github.com/faiface/pixel/batch.go new file mode 100644 index 0000000..b1b0ec7 --- /dev/null +++ b/vendor/github.com/faiface/pixel/batch.go @@ -0,0 +1,163 @@ +package pixel + +import ( + "fmt" + "image/color" +) + +// Batch is a Target that allows for efficient drawing of many objects with the same Picture. +// +// To put an object into a Batch, just draw it onto it: +// object.Draw(batch) +type Batch struct { + cont Drawer + + mat Matrix + col RGBA +} + +var _ BasicTarget = (*Batch)(nil) + +// NewBatch creates an empty Batch with the specified Picture and container. +// +// The container is where objects get accumulated. Batch will support precisely those Triangles +// properties, that the supplied container supports. If you retain access to the container and +// change it, call Dirty to notify Batch about the change. +// +// Note, that if the container does not support TrianglesColor, color masking will not work. +func NewBatch(container Triangles, pic Picture) *Batch { + b := &Batch{cont: Drawer{Triangles: container, Picture: pic}} + b.SetMatrix(IM) + b.SetColorMask(Alpha(1)) + return b +} + +// Dirty notifies Batch about an external modification of it's container. If you retain access to +// the Batch's container and change it, call Dirty to notify Batch about the change. +// +// container := &pixel.TrianglesData{} +// batch := pixel.NewBatch(container, nil) +// container.SetLen(10) // container changed from outside of Batch +// batch.Dirty() // notify Batch about the change +func (b *Batch) Dirty() { + b.cont.Dirty() +} + +// Clear removes all objects from the Batch. +func (b *Batch) Clear() { + b.cont.Triangles.SetLen(0) + b.cont.Dirty() +} + +// Draw draws all objects that are currently in the Batch onto another Target. +func (b *Batch) Draw(t Target) { + b.cont.Draw(t) +} + +// SetMatrix sets a Matrix that every point will be projected by. +func (b *Batch) SetMatrix(m Matrix) { + b.mat = m +} + +// SetColorMask sets a mask color used in the following draws onto the Batch. +func (b *Batch) SetColorMask(c color.Color) { + if c == nil { + b.col = Alpha(1) + return + } + b.col = ToRGBA(c) +} + +// MakeTriangles returns a specialized copy of the provided Triangles that draws onto this Batch. +func (b *Batch) MakeTriangles(t Triangles) TargetTriangles { + bt := &batchTriangles{ + tri: t.Copy(), + tmp: MakeTrianglesData(t.Len()), + dst: b, + } + return bt +} + +// MakePicture returns a specialized copy of the provided Picture that draws onto this Batch. +func (b *Batch) MakePicture(p Picture) TargetPicture { + if p != b.cont.Picture { + panic(fmt.Errorf("(%T).MakePicture: Picture is not the Batch's Picture", b)) + } + bp := &batchPicture{ + pic: p, + dst: b, + } + return bp +} + +type batchTriangles struct { + tri Triangles + tmp *TrianglesData + dst *Batch +} + +func (bt *batchTriangles) Len() int { + return bt.tri.Len() +} + +func (bt *batchTriangles) SetLen(len int) { + bt.tri.SetLen(len) + bt.tmp.SetLen(len) +} + +func (bt *batchTriangles) Slice(i, j int) Triangles { + return &batchTriangles{ + tri: bt.tri.Slice(i, j), + tmp: bt.tmp.Slice(i, j).(*TrianglesData), + dst: bt.dst, + } +} + +func (bt *batchTriangles) Update(t Triangles) { + bt.tri.Update(t) +} + +func (bt *batchTriangles) Copy() Triangles { + return &batchTriangles{ + tri: bt.tri.Copy(), + tmp: bt.tmp.Copy().(*TrianglesData), + dst: bt.dst, + } +} + +func (bt *batchTriangles) draw(bp *batchPicture) { + bt.tmp.Update(bt.tri) + + for i := range *bt.tmp { + (*bt.tmp)[i].Position = bt.dst.mat.Project((*bt.tmp)[i].Position) + (*bt.tmp)[i].Color = bt.dst.col.Mul((*bt.tmp)[i].Color) + } + + cont := bt.dst.cont.Triangles + cont.SetLen(cont.Len() + bt.tri.Len()) + added := cont.Slice(cont.Len()-bt.tri.Len(), cont.Len()) + added.Update(bt.tri) + added.Update(bt.tmp) + bt.dst.cont.Dirty() +} + +func (bt *batchTriangles) Draw() { + bt.draw(nil) +} + +type batchPicture struct { + pic Picture + dst *Batch +} + +func (bp *batchPicture) Bounds() Rect { + return bp.pic.Bounds() +} + +func (bp *batchPicture) Draw(t TargetTriangles) { + bt := t.(*batchTriangles) + if bp.dst != bt.dst { + panic(fmt.Errorf("(%T).Draw: TargetTriangles generated by different Batch", bp)) + } + bt.draw(bp) +} diff --git a/vendor/github.com/faiface/pixel/color.go b/vendor/github.com/faiface/pixel/color.go new file mode 100644 index 0000000..4b41af3 --- /dev/null +++ b/vendor/github.com/faiface/pixel/color.go @@ -0,0 +1,97 @@ +package pixel + +import "image/color" + +// RGBA represents an alpha-premultiplied RGBA color with components within range [0, 1]. +// +// The difference between color.RGBA is that the value range is [0, 1] and the values are floats. +type RGBA struct { + R, G, B, A float64 +} + +// RGB returns a fully opaque RGBA color with the given RGB values. +// +// A common way to construct a transparent color is to create one with RGB constructor, then +// multiply it by a color obtained from the Alpha constructor. +func RGB(r, g, b float64) RGBA { + return RGBA{r, g, b, 1} +} + +// Alpha returns a white RGBA color with the given alpha component. +func Alpha(a float64) RGBA { + return RGBA{a, a, a, a} +} + +// Add adds color d to color c component-wise and returns the result (the components are not +// clamped). +func (c RGBA) Add(d RGBA) RGBA { + return RGBA{ + R: c.R + d.R, + G: c.G + d.G, + B: c.B + d.B, + A: c.A + d.A, + } +} + +// Sub subtracts color d from color c component-wise and returns the result (the components +// are not clamped). +func (c RGBA) Sub(d RGBA) RGBA { + return RGBA{ + R: c.R - d.R, + G: c.G - d.G, + B: c.B - d.B, + A: c.A - d.A, + } +} + +// Mul multiplies color c by color d component-wise (the components are not clamped). +func (c RGBA) Mul(d RGBA) RGBA { + return RGBA{ + R: c.R * d.R, + G: c.G * d.G, + B: c.B * d.B, + A: c.A * d.A, + } +} + +// Scaled multiplies each component of color c by scale and returns the result (the components +// are not clamped). +func (c RGBA) Scaled(scale float64) RGBA { + return RGBA{ + R: c.R * scale, + G: c.G * scale, + B: c.B * scale, + A: c.A * scale, + } +} + +// RGBA returns alpha-premultiplied red, green, blue and alpha components of the RGBA color. +func (c RGBA) RGBA() (r, g, b, a uint32) { + r = uint32(0xffff * c.R) + g = uint32(0xffff * c.G) + b = uint32(0xffff * c.B) + a = uint32(0xffff * c.A) + return +} + +// ToRGBA converts a color to RGBA format. Using this function is preferred to using RGBAModel, for +// performance (using RGBAModel introduces additional unnecessary allocations). +func ToRGBA(c color.Color) RGBA { + if c, ok := c.(RGBA); ok { + return c + } + r, g, b, a := c.RGBA() + return RGBA{ + float64(r) / 0xffff, + float64(g) / 0xffff, + float64(b) / 0xffff, + float64(a) / 0xffff, + } +} + +// RGBAModel converts colors to RGBA format. +var RGBAModel = color.ModelFunc(rgbaModel) + +func rgbaModel(c color.Color) color.Color { + return ToRGBA(c) +} diff --git a/vendor/github.com/faiface/pixel/compose.go b/vendor/github.com/faiface/pixel/compose.go new file mode 100644 index 0000000..a4a8783 --- /dev/null +++ b/vendor/github.com/faiface/pixel/compose.go @@ -0,0 +1,65 @@ +package pixel + +import "errors" + +// ComposeTarget is a BasicTarget capable of Porter-Duff composition. +type ComposeTarget interface { + BasicTarget + + // SetComposeMethod sets a Porter-Duff composition method to be used. + SetComposeMethod(ComposeMethod) +} + +// ComposeMethod is a Porter-Duff composition method. +type ComposeMethod int + +// Here's the list of all available Porter-Duff composition methods. Use ComposeOver for the basic +// alpha blending. +const ( + ComposeOver ComposeMethod = iota + ComposeIn + ComposeOut + ComposeAtop + ComposeRover + ComposeRin + ComposeRout + ComposeRatop + ComposeXor + ComposePlus + ComposeCopy +) + +// Compose composes two colors together according to the ComposeMethod. A is the foreground, B is +// the background. +func (cm ComposeMethod) Compose(a, b RGBA) RGBA { + var fa, fb float64 + + switch cm { + case ComposeOver: + fa, fb = 1, 1-a.A + case ComposeIn: + fa, fb = b.A, 0 + case ComposeOut: + fa, fb = 1-b.A, 0 + case ComposeAtop: + fa, fb = b.A, 1-a.A + case ComposeRover: + fa, fb = 1-b.A, 1 + case ComposeRin: + fa, fb = 0, a.A + case ComposeRout: + fa, fb = 0, 1-a.A + case ComposeRatop: + fa, fb = 1-b.A, a.A + case ComposeXor: + fa, fb = 1-b.A, 1-a.A + case ComposePlus: + fa, fb = 1, 1 + case ComposeCopy: + fa, fb = 1, 0 + default: + panic(errors.New("Compose: invalid ComposeMethod")) + } + + return a.Mul(Alpha(fa)).Add(b.Mul(Alpha(fb))) +} diff --git a/vendor/github.com/faiface/pixel/data.go b/vendor/github.com/faiface/pixel/data.go new file mode 100644 index 0000000..c941241 --- /dev/null +++ b/vendor/github.com/faiface/pixel/data.go @@ -0,0 +1,276 @@ +package pixel + +import ( + "fmt" + "image" + "image/color" + "image/draw" + "math" +) + +// TrianglesData specifies a list of Triangles vertices with three common properties: +// TrianglesPosition, TrianglesColor and TrianglesPicture. +type TrianglesData []struct { + Position Vec + Color RGBA + Picture Vec + Intensity float64 +} + +// MakeTrianglesData creates TrianglesData of length len initialized with default property values. +// +// Prefer this function to make(TrianglesData, len), because make zeros them, while this function +// does the correct intialization. +func MakeTrianglesData(len int) *TrianglesData { + td := &TrianglesData{} + td.SetLen(len) + return td +} + +// Len returns the number of vertices in TrianglesData. +func (td *TrianglesData) Len() int { + return len(*td) +} + +// SetLen resizes TrianglesData to len, while keeping the original content. +// +// If len is greater than TrianglesData's current length, the new data is filled with default +// values ((0, 0), white, (0, 0), 0). +func (td *TrianglesData) SetLen(len int) { + if len > td.Len() { + needAppend := len - td.Len() + for i := 0; i < needAppend; i++ { + *td = append(*td, struct { + Position Vec + Color RGBA + Picture Vec + Intensity float64 + }{Color: RGBA{1, 1, 1, 1}}) + } + } + if len < td.Len() { + *td = (*td)[:len] + } +} + +// Slice returns a sub-Triangles of this TrianglesData. +func (td *TrianglesData) Slice(i, j int) Triangles { + s := TrianglesData((*td)[i:j]) + return &s +} + +func (td *TrianglesData) updateData(t Triangles) { + // fast path optimization + if t, ok := t.(*TrianglesData); ok { + copy(*td, *t) + return + } + + // slow path manual copy + if t, ok := t.(TrianglesPosition); ok { + for i := range *td { + (*td)[i].Position = t.Position(i) + } + } + if t, ok := t.(TrianglesColor); ok { + for i := range *td { + (*td)[i].Color = t.Color(i) + } + } + if t, ok := t.(TrianglesPicture); ok { + for i := range *td { + (*td)[i].Picture, (*td)[i].Intensity = t.Picture(i) + } + } +} + +// Update copies vertex properties from the supplied Triangles into this TrianglesData. +// +// TrianglesPosition, TrianglesColor and TrianglesTexture are supported. +func (td *TrianglesData) Update(t Triangles) { + if td.Len() != t.Len() { + panic(fmt.Errorf("(%T).Update: invalid triangles length", td)) + } + td.updateData(t) +} + +// Copy returns an exact independent copy of this TrianglesData. +func (td *TrianglesData) Copy() Triangles { + copyTd := TrianglesData{} + copyTd.SetLen(td.Len()) + copyTd.Update(td) + return ©Td +} + +// Position returns the position property of i-th vertex. +func (td *TrianglesData) Position(i int) Vec { + return (*td)[i].Position +} + +// Color returns the color property of i-th vertex. +func (td *TrianglesData) Color(i int) RGBA { + return (*td)[i].Color +} + +// Picture returns the picture property of i-th vertex. +func (td *TrianglesData) Picture(i int) (pic Vec, intensity float64) { + return (*td)[i].Picture, (*td)[i].Intensity +} + +// PictureData specifies an in-memory rectangular area of pixels and implements Picture and +// PictureColor. +// +// Pixels are small rectangles of unit size of form (x, y, x+1, y+1), where x and y are integers. +// PictureData contains and assigns a color to all pixels that are at least partially contained +// within it's Bounds (Rect). +// +// The struct's innards are exposed for convenience, manual modification is at your own risk. +// +// The format of the pixels is color.RGBA and not pixel.RGBA for a very serious reason: +// pixel.RGBA takes up 8x more memory than color.RGBA. +type PictureData struct { + Pix []color.RGBA + Stride int + Rect Rect +} + +// MakePictureData creates a zero-initialized PictureData covering the given rectangle. +func MakePictureData(rect Rect) *PictureData { + w := int(math.Ceil(rect.Max.X)) - int(math.Floor(rect.Min.X)) + h := int(math.Ceil(rect.Max.Y)) - int(math.Floor(rect.Min.Y)) + pd := &PictureData{ + Stride: w, + Rect: rect, + } + pd.Pix = make([]color.RGBA, w*h) + return pd +} + +func verticalFlip(rgba *image.RGBA) { + bounds := rgba.Bounds() + width := bounds.Dx() + + tmpRow := make([]uint8, width*4) + for i, j := 0, bounds.Dy()-1; i < j; i, j = i+1, j-1 { + iRow := rgba.Pix[i*rgba.Stride : i*rgba.Stride+width*4] + jRow := rgba.Pix[j*rgba.Stride : j*rgba.Stride+width*4] + + copy(tmpRow, iRow) + copy(iRow, jRow) + copy(jRow, tmpRow) + } +} + +// PictureDataFromImage converts an image.Image into PictureData. +// +// The resulting PictureData's Bounds will be the equivalent of the supplied image.Image's Bounds. +func PictureDataFromImage(img image.Image) *PictureData { + var rgba *image.RGBA + if rgbaImg, ok := img.(*image.RGBA); ok { + rgba = rgbaImg + } else { + rgba = image.NewRGBA(img.Bounds()) + draw.Draw(rgba, rgba.Bounds(), img, img.Bounds().Min, draw.Src) + } + + verticalFlip(rgba) + + pd := MakePictureData(R( + float64(rgba.Bounds().Min.X), + float64(rgba.Bounds().Min.Y), + float64(rgba.Bounds().Max.X), + float64(rgba.Bounds().Max.Y), + )) + + for i := range pd.Pix { + pd.Pix[i].R = rgba.Pix[i*4+0] + pd.Pix[i].G = rgba.Pix[i*4+1] + pd.Pix[i].B = rgba.Pix[i*4+2] + pd.Pix[i].A = rgba.Pix[i*4+3] + } + + return pd +} + +// PictureDataFromPicture converts an arbitrary Picture into PictureData (the conversion may be +// lossy, because PictureData works with unit-sized pixels). +// +// Bounds are preserved. +func PictureDataFromPicture(pic Picture) *PictureData { + if pd, ok := pic.(*PictureData); ok { + return pd + } + + bounds := pic.Bounds() + pd := MakePictureData(bounds) + + if pic, ok := pic.(PictureColor); ok { + for y := math.Floor(bounds.Min.Y); y < bounds.Max.Y; y++ { + for x := math.Floor(bounds.Min.X); x < bounds.Max.X; x++ { + // this together with the Floor is a trick to get all of the pixels + at := V( + math.Max(x, bounds.Min.X), + math.Max(y, bounds.Min.Y), + ) + col := pic.Color(at) + pd.Pix[pd.Index(at)] = color.RGBA{ + R: uint8(col.R * 255), + G: uint8(col.G * 255), + B: uint8(col.B * 255), + A: uint8(col.A * 255), + } + } + } + } + + return pd +} + +// Image converts PictureData into an image.RGBA. +// +// The resulting image.RGBA's Bounds will be equivalent of the PictureData's Bounds. +func (pd *PictureData) Image() *image.RGBA { + bounds := image.Rect( + int(math.Floor(pd.Rect.Min.X)), + int(math.Floor(pd.Rect.Min.Y)), + int(math.Ceil(pd.Rect.Max.X)), + int(math.Ceil(pd.Rect.Max.Y)), + ) + rgba := image.NewRGBA(bounds) + + i := 0 + for y := bounds.Min.Y; y < bounds.Max.Y; y++ { + for x := bounds.Min.X; x < bounds.Max.X; x++ { + off := pd.Index(V(float64(x), float64(y))) + rgba.Pix[i*4+0] = pd.Pix[off].R + rgba.Pix[i*4+1] = pd.Pix[off].G + rgba.Pix[i*4+2] = pd.Pix[off].B + rgba.Pix[i*4+3] = pd.Pix[off].A + i++ + } + } + + verticalFlip(rgba) + + return rgba +} + +// Index returns the index of the pixel at the specified position inside the Pix slice. +func (pd *PictureData) Index(at Vec) int { + at = at.Sub(pd.Rect.Min.Map(math.Floor)) + x, y := int(at.X), int(at.Y) + return y*pd.Stride + x +} + +// Bounds returns the bounds of this PictureData. +func (pd *PictureData) Bounds() Rect { + return pd.Rect +} + +// Color returns the color located at the given position. +func (pd *PictureData) Color(at Vec) RGBA { + if !pd.Rect.Contains(at) { + return RGBA{0, 0, 0, 0} + } + return ToRGBA(pd.Pix[pd.Index(at)]) +} diff --git a/vendor/github.com/faiface/pixel/doc.go b/vendor/github.com/faiface/pixel/doc.go new file mode 100644 index 0000000..fe85605 --- /dev/null +++ b/vendor/github.com/faiface/pixel/doc.go @@ -0,0 +1,7 @@ +// Package pixel implements platform and backend agnostic core of the Pixel game development +// library. +// +// It specifies the core Target, Triangles, Picture pattern and implements standard elements, such +// as Sprite, Batch, Vec, Matrix and RGBA in addition to the basic Triangles and Picture +// implementations: TrianglesData and PictureData. +package pixel diff --git a/vendor/github.com/faiface/pixel/drawer.go b/vendor/github.com/faiface/pixel/drawer.go new file mode 100644 index 0000000..1836266 --- /dev/null +++ b/vendor/github.com/faiface/pixel/drawer.go @@ -0,0 +1,96 @@ +package pixel + +// Drawer glues all the fundamental interfaces (Target, Triangles, Picture) into a coherent and the +// only intended usage pattern. +// +// Drawer makes it possible to draw any combination of Triangles and Picture onto any Target +// efficiently. +// +// To create a Drawer, just assign it's Triangles and Picture fields: +// +// d := pixel.Drawer{Triangles: t, Picture: p} +// +// If Triangles is nil, nothing will be drawn. If Picture is nil, Triangles will be drawn without a +// Picture. +// +// Whenever you change the Triangles, call Dirty to notify Drawer that Triangles changed. You don't +// need to notify Drawer about a change of the Picture. +// +// Note, that Drawer caches the results of MakePicture from Targets it's drawn to for each Picture +// it's set to. What it means is that using a Drawer with an unbounded number of Pictures leads to a +// memory leak, since Drawer caches them and never forgets. In such a situation, create a new Drawer +// for each Picture. +type Drawer struct { + Triangles Triangles + Picture Picture + + targets map[Target]*drawerTarget + inited bool +} + +type drawerTarget struct { + tris TargetTriangles + pics map[Picture]TargetPicture + clean bool +} + +func (d *Drawer) lazyInit() { + if !d.inited { + d.targets = make(map[Target]*drawerTarget) + d.inited = true + } +} + +// Dirty marks the Triangles of this Drawer as changed. If not called, changes will not be visible +// when drawing. +func (d *Drawer) Dirty() { + d.lazyInit() + + for _, t := range d.targets { + t.clean = false + } +} + +// Draw efficiently draws Triangles with Picture onto the provided Target. +// +// If Triangles is nil, nothing will be drawn. If Picture is nil, Triangles will be drawn without a +// Picture. +func (d *Drawer) Draw(t Target) { + d.lazyInit() + + if d.Triangles == nil { + return + } + + dt := d.targets[t] + if dt == nil { + dt = &drawerTarget{ + pics: make(map[Picture]TargetPicture), + } + d.targets[t] = dt + } + + if dt.tris == nil { + dt.tris = t.MakeTriangles(d.Triangles) + dt.clean = true + } + + if !dt.clean { + dt.tris.SetLen(d.Triangles.Len()) + dt.tris.Update(d.Triangles) + dt.clean = true + } + + if d.Picture == nil { + dt.tris.Draw() + return + } + + pic := dt.pics[d.Picture] + if pic == nil { + pic = t.MakePicture(d.Picture) + dt.pics[d.Picture] = pic + } + + pic.Draw(dt.tris) +} diff --git a/vendor/github.com/faiface/pixel/examples/community/maze/LICENSE b/vendor/github.com/faiface/pixel/examples/community/maze/LICENSE new file mode 100644 index 0000000..1326e36 --- /dev/null +++ b/vendor/github.com/faiface/pixel/examples/community/maze/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 stephen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/faiface/pixel/geometry.go b/vendor/github.com/faiface/pixel/geometry.go new file mode 100644 index 0000000..0cb1436 --- /dev/null +++ b/vendor/github.com/faiface/pixel/geometry.go @@ -0,0 +1,405 @@ +package pixel + +import ( + "fmt" + "math" +) + +// Clamp returns x clamped to the interval [min, max]. +// +// If x is less than min, min is returned. If x is more than max, max is returned. Otherwise, x is +// returned. +func Clamp(x, min, max float64) float64 { + if x < min { + return min + } + if x > max { + return max + } + return x +} + +// Vec is a 2D vector type with X and Y coordinates. +// +// Create vectors with the V constructor: +// +// u := pixel.V(1, 2) +// v := pixel.V(8, -3) +// +// Use various methods to manipulate them: +// +// w := u.Add(v) +// fmt.Println(w) // Vec(9, -1) +// fmt.Println(u.Sub(v)) // Vec(-7, 5) +// u = pixel.V(2, 3) +// v = pixel.V(8, 1) +// if u.X < 0 { +// fmt.Println("this won't happen") +// } +// x := u.Unit().Dot(v.Unit()) +type Vec struct { + X, Y float64 +} + +// ZV is a zero vector. +var ZV = Vec{0, 0} + +// V returns a new 2D vector with the given coordinates. +func V(x, y float64) Vec { + return Vec{x, y} +} + +// Unit returns a vector of length 1 facing the given angle. +func Unit(angle float64) Vec { + return Vec{1, 0}.Rotated(angle) +} + +// String returns the string representation of the vector u. +// +// u := pixel.V(4.5, -1.3) +// u.String() // returns "Vec(4.5, -1.3)" +// fmt.Println(u) // Vec(4.5, -1.3) +func (u Vec) String() string { + return fmt.Sprintf("Vec(%v, %v)", u.X, u.Y) +} + +// XY returns the components of the vector in two return values. +func (u Vec) XY() (x, y float64) { + return u.X, u.Y +} + +// Add returns the sum of vectors u and v. +func (u Vec) Add(v Vec) Vec { + return Vec{ + u.X + v.X, + u.Y + v.Y, + } +} + +// Sub returns the difference betweeen vectors u and v. +func (u Vec) Sub(v Vec) Vec { + return Vec{ + u.X - v.X, + u.Y - v.Y, + } +} + +// To returns the vector from u to v. Equivalent to v.Sub(u). +func (u Vec) To(v Vec) Vec { + return Vec{ + v.X - u.X, + v.Y - u.Y, + } +} + +// Scaled returns the vector u multiplied by c. +func (u Vec) Scaled(c float64) Vec { + return Vec{u.X * c, u.Y * c} +} + +// ScaledXY returns the vector u multiplied by the vector v component-wise. +func (u Vec) ScaledXY(v Vec) Vec { + return Vec{u.X * v.X, u.Y * v.Y} +} + +// Len returns the length of the vector u. +func (u Vec) Len() float64 { + return math.Hypot(u.X, u.Y) +} + +// Angle returns the angle between the vector u and the x-axis. The result is in range [-Pi, Pi]. +func (u Vec) Angle() float64 { + return math.Atan2(u.Y, u.X) +} + +// Unit returns a vector of length 1 facing the direction of u (has the same angle). +func (u Vec) Unit() Vec { + if u.X == 0 && u.Y == 0 { + return Vec{1, 0} + } + return u.Scaled(1 / u.Len()) +} + +// Rotated returns the vector u rotated by the given angle in radians. +func (u Vec) Rotated(angle float64) Vec { + sin, cos := math.Sincos(angle) + return Vec{ + u.X*cos - u.Y*sin, + u.X*sin + u.Y*cos, + } +} + +// Normal returns a vector normal to u. Equivalent to u.Rotated(math.Pi / 2), but faster. +func (u Vec) Normal() Vec { + return Vec{-u.Y, u.X} +} + +// Dot returns the dot product of vectors u and v. +func (u Vec) Dot(v Vec) float64 { + return u.X*v.X + u.Y*v.Y +} + +// Cross return the cross product of vectors u and v. +func (u Vec) Cross(v Vec) float64 { + return u.X*v.Y - v.X*u.Y +} + +// Project returns a projection (or component) of vector u in the direction of vector v. +// +// Behaviour is undefined if v is a zero vector. +func (u Vec) Project(v Vec) Vec { + len := u.Dot(v) / v.Len() + return v.Unit().Scaled(len) +} + +// Map applies the function f to both x and y components of the vector u and returns the modified +// vector. +// +// u := pixel.V(10.5, -1.5) +// v := u.Map(math.Floor) // v is Vec(10, -2), both components of u floored +func (u Vec) Map(f func(float64) float64) Vec { + return Vec{ + f(u.X), + f(u.Y), + } +} + +// Lerp returns a linear interpolation between vectors a and b. +// +// This function basically returns a point along the line between a and b and t chooses which one. +// If t is 0, then a will be returned, if t is 1, b will be returned. Anything between 0 and 1 will +// return the appropriate point between a and b and so on. +func Lerp(a, b Vec, t float64) Vec { + return a.Scaled(1 - t).Add(b.Scaled(t)) +} + +// Rect is a 2D rectangle aligned with the axes of the coordinate system. It is defined by two +// points, Min and Max. +// +// The invariant should hold, that Max's components are greater or equal than Min's components +// respectively. +type Rect struct { + Min, Max Vec +} + +// R returns a new Rect with given the Min and Max coordinates. +// +// Note that the returned rectangle is not automatically normalized. +func R(minX, minY, maxX, maxY float64) Rect { + return Rect{ + Min: Vec{minX, minY}, + Max: Vec{maxX, maxY}, + } +} + +// String returns the string representation of the Rect. +// +// r := pixel.R(100, 50, 200, 300) +// r.String() // returns "Rect(100, 50, 200, 300)" +// fmt.Println(r) // Rect(100, 50, 200, 300) +func (r Rect) String() string { + return fmt.Sprintf("Rect(%v, %v, %v, %v)", r.Min.X, r.Min.Y, r.Max.X, r.Max.Y) +} + +// Norm returns the Rect in normal form, such that Max is component-wise greater or equal than Min. +func (r Rect) Norm() Rect { + return Rect{ + Min: Vec{ + math.Min(r.Min.X, r.Max.X), + math.Min(r.Min.Y, r.Max.Y), + }, + Max: Vec{ + math.Max(r.Min.X, r.Max.X), + math.Max(r.Min.Y, r.Max.Y), + }, + } +} + +// W returns the width of the Rect. +func (r Rect) W() float64 { + return r.Max.X - r.Min.X +} + +// H returns the height of the Rect. +func (r Rect) H() float64 { + return r.Max.Y - r.Min.Y +} + +// Size returns the vector of width and height of the Rect. +func (r Rect) Size() Vec { + return V(r.W(), r.H()) +} + +// Area returns the area of r. If r is not normalized, area may be negative. +func (r Rect) Area() float64 { + return r.W() * r.H() +} + +// Center returns the position of the center of the Rect. +func (r Rect) Center() Vec { + return Lerp(r.Min, r.Max, 0.5) +} + +// Moved returns the Rect moved (both Min and Max) by the given vector delta. +func (r Rect) Moved(delta Vec) Rect { + return Rect{ + Min: r.Min.Add(delta), + Max: r.Max.Add(delta), + } +} + +// Resized returns the Rect resized to the given size while keeping the position of the given +// anchor. +// +// r.Resized(r.Min, size) // resizes while keeping the position of the lower-left corner +// r.Resized(r.Max, size) // same with the top-right corner +// r.Resized(r.Center(), size) // resizes around the center +// +// This function does not make sense for resizing a rectangle of zero area and will panic. Use +// ResizedMin in the case of zero area. +func (r Rect) Resized(anchor, size Vec) Rect { + if r.W()*r.H() == 0 { + panic(fmt.Errorf("(%T).Resize: zero area", r)) + } + fraction := Vec{size.X / r.W(), size.Y / r.H()} + return Rect{ + Min: anchor.Add(r.Min.Sub(anchor).ScaledXY(fraction)), + Max: anchor.Add(r.Max.Sub(anchor).ScaledXY(fraction)), + } +} + +// ResizedMin returns the Rect resized to the given size while keeping the position of the Rect's +// Min. +// +// Sizes of zero area are safe here. +func (r Rect) ResizedMin(size Vec) Rect { + return Rect{ + Min: r.Min, + Max: r.Min.Add(size), + } +} + +// Contains checks whether a vector u is contained within this Rect (including it's borders). +func (r Rect) Contains(u Vec) bool { + return r.Min.X <= u.X && u.X <= r.Max.X && r.Min.Y <= u.Y && u.Y <= r.Max.Y +} + +// Union returns the minimal Rect which covers both r and s. Rects r and s must be normalized. +func (r Rect) Union(s Rect) Rect { + return R( + math.Min(r.Min.X, s.Min.X), + math.Min(r.Min.Y, s.Min.Y), + math.Max(r.Max.X, s.Max.X), + math.Max(r.Max.Y, s.Max.Y), + ) +} + +// Intersect returns the maximal Rect which is covered by both r and s. Rects r and s must be normalized. +// +// If r and s don't overlap, this function returns R(0, 0, 0, 0). +func (r Rect) Intersect(s Rect) Rect { + t := R( + math.Max(r.Min.X, s.Min.X), + math.Max(r.Min.Y, s.Min.Y), + math.Min(r.Max.X, s.Max.X), + math.Min(r.Max.Y, s.Max.Y), + ) + if t.Min.X >= t.Max.X || t.Min.Y >= t.Max.Y { + return Rect{} + } + return t +} + +// Matrix is a 3x2 affine matrix that can be used for all kinds of spatial transforms, such +// as movement, scaling and rotations. +// +// Matrix has a handful of useful methods, each of which adds a transformation to the matrix. For +// example: +// +// pixel.IM.Moved(pixel.V(100, 200)).Rotated(pixel.ZV, math.Pi/2) +// +// This code creates a Matrix that first moves everything by 100 units horizontally and 200 units +// vertically and then rotates everything by 90 degrees around the origin. +// +// Layout is: +// [0] [2] [4] +// [1] [3] [5] +// 0 0 1 (implicit row) +type Matrix [6]float64 + +// IM stands for identity matrix. Does nothing, no transformation. +var IM = Matrix{1, 0, 0, 1, 0, 0} + +// String returns a string representation of the Matrix. +// +// m := pixel.IM +// fmt.Println(m) // Matrix(1 0 0 | 0 1 0) +func (m Matrix) String() string { + return fmt.Sprintf( + "Matrix(%v %v %v | %v %v %v)", + m[0], m[2], m[4], + m[1], m[3], m[5], + ) +} + +// Moved moves everything by the delta vector. +func (m Matrix) Moved(delta Vec) Matrix { + m[4], m[5] = m[4]+delta.X, m[5]+delta.Y + return m +} + +// ScaledXY scales everything around a given point by the scale factor in each axis respectively. +func (m Matrix) ScaledXY(around Vec, scale Vec) Matrix { + m[4], m[5] = m[4]-around.X, m[5]-around.Y + m[0], m[2], m[4] = m[0]*scale.X, m[2]*scale.X, m[4]*scale.X + m[1], m[3], m[5] = m[1]*scale.Y, m[3]*scale.Y, m[5]*scale.Y + m[4], m[5] = m[4]+around.X, m[5]+around.Y + return m +} + +// Scaled scales everything around a given point by the scale factor. +func (m Matrix) Scaled(around Vec, scale float64) Matrix { + return m.ScaledXY(around, V(scale, scale)) +} + +// Rotated rotates everything around a given point by the given angle in radians. +func (m Matrix) Rotated(around Vec, angle float64) Matrix { + sint, cost := math.Sincos(angle) + m[4], m[5] = m[4]-around.X, m[5]-around.Y + m = m.Chained(Matrix{cost, sint, -sint, cost, 0, 0}) + m[4], m[5] = m[4]+around.X, m[5]+around.Y + return m +} + +// Chained adds another Matrix to this one. All tranformations by the next Matrix will be applied +// after the transformations of this Matrix. +func (m Matrix) Chained(next Matrix) Matrix { + return Matrix{ + next[0]*m[0] + next[2]*m[1], + next[1]*m[0] + next[3]*m[1], + next[0]*m[2] + next[2]*m[3], + next[1]*m[2] + next[3]*m[3], + next[0]*m[4] + next[2]*m[5] + next[4], + next[1]*m[4] + next[3]*m[5] + next[5], + } +} + +// Project applies all transformations added to the Matrix to a vector u and returns the result. +// +// Time complexity is O(1). +func (m Matrix) Project(u Vec) Vec { + return Vec{m[0]*u.X + m[2]*u.Y + m[4], m[1]*u.X + m[3]*u.Y + m[5]} +} + +// Unproject does the inverse operation to Project. +// +// It turns out that multiplying a vector by the inverse matrix of m can be nearly-accomplished by +// subtracting the translate part of the matrix and multplying by the inverse of the top-left 2x2 +// matrix, and the inverse of a 2x2 matrix is simple enough to just be inlined in the computation. +// +// Time complexity is O(1). +func (m Matrix) Unproject(u Vec) Vec { + d := (m[0] * m[3]) - (m[1] * m[2]) + u.X, u.Y = (u.X-m[4])/d, (u.Y-m[5])/d + return Vec{u.X*m[3] - u.Y*m[1], u.Y*m[0] - u.X*m[2]} +} diff --git a/vendor/github.com/faiface/pixel/imdraw/imdraw.go b/vendor/github.com/faiface/pixel/imdraw/imdraw.go new file mode 100644 index 0000000..e616c39 --- /dev/null +++ b/vendor/github.com/faiface/pixel/imdraw/imdraw.go @@ -0,0 +1,627 @@ +// Package imdraw implements a basic primitive geometry shape and pictured polygon drawing for Pixel +// with a nice immediate-mode-like API. +package imdraw + +import ( + "image/color" + "math" + + "github.com/faiface/pixel" +) + +// IMDraw is an immediate-mode-like shape drawer and BasicTarget. IMDraw supports TrianglesPosition, +// TrianglesColor, TrianglesPicture and PictureColor. +// +// IMDraw, other than a regular BasicTarget, is used to draw shapes. To draw shapes, you first need +// to Push some points to IMDraw: +// +// imd := pixel.NewIMDraw(pic) // use nil pic if you only want to draw primitive shapes +// imd.Push(pixel.V(100, 100)) +// imd.Push(pixel.V(500, 100)) +// +// Once you have Pushed some points, you can use them to draw a shape, such as a line: +// +// imd.Line(20) // draws a 20 units thick line +// +// Set exported fields to change properties of Pushed points: +// +// imd.Color = pixel.RGB(1, 0, 0) +// imd.Push(pixel.V(200, 200)) +// imd.Circle(400, 0) +// +// Here is the list of all available point properties (need to be set before Pushing a point): +// - Color - applies to all +// - Picture - coordinates, only applies to filled polygons +// - Intensity - picture intensity, only applies to filled polygons +// - Precision - curve drawing precision, only applies to circles and ellipses +// - EndShape - shape of the end of a line, only applies to lines and outlines +// +// And here's the list of all shapes that can be drawn (all, except for line, can be filled or +// outlined): +// - Line +// - Polygon +// - Circle +// - Circle arc +// - Ellipse +// - Ellipse arc +type IMDraw struct { + Color color.Color + Picture pixel.Vec + Intensity float64 + Precision int + EndShape EndShape + + points []point + pool [][]point + matrix pixel.Matrix + mask pixel.RGBA + + tri *pixel.TrianglesData + batch *pixel.Batch +} + +var _ pixel.BasicTarget = (*IMDraw)(nil) + +type point struct { + pos pixel.Vec + col pixel.RGBA + pic pixel.Vec + in float64 + precision int + endshape EndShape +} + +// EndShape specifies the shape of an end of a line or a curve. +type EndShape int + +const ( + // NoEndShape leaves a line point with no special end shape. + NoEndShape EndShape = iota + + // SharpEndShape is a sharp triangular end shape. + SharpEndShape + + // RoundEndShape is a circular end shape. + RoundEndShape +) + +// New creates a new empty IMDraw. An optional Picture can be used to draw with a Picture. +// +// If you just want to draw primitive shapes, pass nil as the Picture. +func New(pic pixel.Picture) *IMDraw { + tri := &pixel.TrianglesData{} + im := &IMDraw{ + tri: tri, + batch: pixel.NewBatch(tri, pic), + } + im.SetMatrix(pixel.IM) + im.SetColorMask(pixel.Alpha(1)) + im.Reset() + return im +} + +// Clear removes all drawn shapes from the IM. This does not remove Pushed points. +func (imd *IMDraw) Clear() { + imd.tri.SetLen(0) + imd.batch.Dirty() +} + +// Reset restores all point properties to defaults and removes all Pushed points. +// +// This does not affect matrix and color mask set by SetMatrix and SetColorMask. +func (imd *IMDraw) Reset() { + imd.points = imd.points[:0] + imd.Color = pixel.Alpha(1) + imd.Picture = pixel.ZV + imd.Intensity = 0 + imd.Precision = 64 + imd.EndShape = NoEndShape +} + +// Draw draws all currently drawn shapes inside the IM onto another Target. +// +// Note, that IMDraw's matrix and color mask have no effect here. +func (imd *IMDraw) Draw(t pixel.Target) { + imd.batch.Draw(t) +} + +// Push adds some points to the IM queue. All Pushed points will have the same properties except for +// the position. +func (imd *IMDraw) Push(pts ...pixel.Vec) { + if _, ok := imd.Color.(pixel.RGBA); !ok { + imd.Color = pixel.ToRGBA(imd.Color) + } + opts := point{ + col: imd.Color.(pixel.RGBA), + pic: imd.Picture, + in: imd.Intensity, + precision: imd.Precision, + endshape: imd.EndShape, + } + for _, pt := range pts { + imd.pushPt(pt, opts) + } +} + +func (imd *IMDraw) pushPt(pos pixel.Vec, pt point) { + pt.pos = pos + imd.points = append(imd.points, pt) +} + +// SetMatrix sets a Matrix that all further points will be transformed by. +func (imd *IMDraw) SetMatrix(m pixel.Matrix) { + imd.matrix = m + imd.batch.SetMatrix(imd.matrix) +} + +// SetColorMask sets a color that all further point's color will be multiplied by. +func (imd *IMDraw) SetColorMask(color color.Color) { + imd.mask = pixel.ToRGBA(color) + imd.batch.SetColorMask(imd.mask) +} + +// MakeTriangles returns a specialized copy of the provided Triangles that draws onto this IMDraw. +func (imd *IMDraw) MakeTriangles(t pixel.Triangles) pixel.TargetTriangles { + return imd.batch.MakeTriangles(t) +} + +// MakePicture returns a specialized copy of the provided Picture that draws onto this IMDraw. +func (imd *IMDraw) MakePicture(p pixel.Picture) pixel.TargetPicture { + return imd.batch.MakePicture(p) +} + +// Line draws a polyline of the specified thickness between the Pushed points. +func (imd *IMDraw) Line(thickness float64) { + imd.polyline(thickness, false) +} + +// Rectangle draws a rectangle between each two subsequent Pushed points. Drawing a rectangle +// between two points means drawing a rectangle with sides parallel to the axes of the coordinate +// system, where the two points specify it's two opposite corners. +// +// If the thickness is 0, rectangles will be filled, otherwise will be outlined with the given +// thickness. +func (imd *IMDraw) Rectangle(thickness float64) { + if thickness == 0 { + imd.fillRectangle() + } else { + imd.outlineRectangle(thickness) + } +} + +// Polygon draws a polygon from the Pushed points. If the thickness is 0, the convex polygon will be +// filled. Otherwise, an outline of the specified thickness will be drawn. The outline does not have +// to be convex. +// +// Note, that the filled polygon does not have to be strictly convex. The way it's drawn is that a +// triangle is drawn between each two adjacent points and the first Pushed point. You can use this +// property to draw certain kinds of concave polygons. +func (imd *IMDraw) Polygon(thickness float64) { + if thickness == 0 { + imd.fillPolygon() + } else { + imd.polyline(thickness, true) + } +} + +// Circle draws a circle of the specified radius around each Pushed point. If the thickness is 0, +// the circle will be filled, otherwise a circle outline of the specified thickness will be drawn. +func (imd *IMDraw) Circle(radius, thickness float64) { + if thickness == 0 { + imd.fillEllipseArc(pixel.V(radius, radius), 0, 2*math.Pi) + } else { + imd.outlineEllipseArc(pixel.V(radius, radius), 0, 2*math.Pi, thickness, false) + } +} + +// CircleArc draws a circle arc of the specified radius around each Pushed point. If the thickness +// is 0, the arc will be filled, otherwise will be outlined. The arc starts at the low angle and +// continues to the high angle. If low 0 { + pos := len(imd.pool) - 1 + imd.points = imd.pool[pos][:0] + imd.pool = imd.pool[:pos] + } else { + imd.points = nil + } + return points +} + +func (imd *IMDraw) restorePoints(points []point) { + imd.pool = append(imd.pool, imd.points) + imd.points = points[:0] +} + +func (imd *IMDraw) applyMatrixAndMask(off int) { + for i := range (*imd.tri)[off:] { + (*imd.tri)[off+i].Position = imd.matrix.Project((*imd.tri)[off+i].Position) + (*imd.tri)[off+i].Color = imd.mask.Mul((*imd.tri)[off+i].Color) + } +} + +func (imd *IMDraw) fillRectangle() { + points := imd.getAndClearPoints() + + if len(points) < 2 { + imd.restorePoints(points) + return + } + + off := imd.tri.Len() + imd.tri.SetLen(imd.tri.Len() + 6*(len(points)-1)) + + for i, j := 0, off; i+1 < len(points); i, j = i+1, j+6 { + a, b := points[i], points[i+1] + c := point{ + pos: pixel.V(a.pos.X, b.pos.Y), + col: a.col.Add(b.col).Mul(pixel.Alpha(0.5)), + pic: pixel.V(a.pic.X, b.pic.Y), + in: (a.in + b.in) / 2, + } + d := point{ + pos: pixel.V(b.pos.X, a.pos.Y), + col: a.col.Add(b.col).Mul(pixel.Alpha(0.5)), + pic: pixel.V(b.pic.X, a.pic.Y), + in: (a.in + b.in) / 2, + } + + for k, p := range [...]point{a, b, c, a, b, d} { + (*imd.tri)[j+k].Position = p.pos + (*imd.tri)[j+k].Color = p.col + (*imd.tri)[j+k].Picture = p.pic + (*imd.tri)[j+k].Intensity = p.in + } + } + + imd.applyMatrixAndMask(off) + imd.batch.Dirty() + + imd.restorePoints(points) +} + +func (imd *IMDraw) outlineRectangle(thickness float64) { + points := imd.getAndClearPoints() + + if len(points) < 2 { + imd.restorePoints(points) + return + } + + for i := 0; i+1 < len(points); i++ { + a, b := points[i], points[i+1] + mid := a + mid.col = a.col.Add(b.col).Mul(pixel.Alpha(0.5)) + mid.in = (a.in + b.in) / 2 + + imd.pushPt(a.pos, a) + imd.pushPt(pixel.V(a.pos.X, b.pos.Y), mid) + imd.pushPt(b.pos, b) + imd.pushPt(pixel.V(b.pos.X, a.pos.Y), mid) + imd.polyline(thickness, true) + } + + imd.restorePoints(points) +} + +func (imd *IMDraw) fillPolygon() { + points := imd.getAndClearPoints() + + if len(points) < 3 { + imd.restorePoints(points) + return + } + + off := imd.tri.Len() + imd.tri.SetLen(imd.tri.Len() + 3*(len(points)-2)) + + for i, j := 1, off; i+1 < len(points); i, j = i+1, j+3 { + for k, p := range [...]int{0, i, i + 1} { + tri := &(*imd.tri)[j+k] + tri.Position = points[p].pos + tri.Color = points[p].col + tri.Picture = points[p].pic + tri.Intensity = points[p].in + } + } + + imd.applyMatrixAndMask(off) + imd.batch.Dirty() + + imd.restorePoints(points) +} + +func (imd *IMDraw) fillEllipseArc(radius pixel.Vec, low, high float64) { + points := imd.getAndClearPoints() + + for _, pt := range points { + num := math.Ceil(math.Abs(high-low) / (2 * math.Pi) * float64(pt.precision)) + delta := (high - low) / num + + off := imd.tri.Len() + imd.tri.SetLen(imd.tri.Len() + 3*int(num)) + + for i := range (*imd.tri)[off:] { + (*imd.tri)[off+i].Color = pt.col + (*imd.tri)[off+i].Picture = pixel.ZV + (*imd.tri)[off+i].Intensity = 0 + } + + for i, j := 0.0, off; i < num; i, j = i+1, j+3 { + angle := low + i*delta + sin, cos := math.Sincos(angle) + a := pt.pos.Add(pixel.V( + radius.X*cos, + radius.Y*sin, + )) + + angle = low + (i+1)*delta + sin, cos = math.Sincos(angle) + b := pt.pos.Add(pixel.V( + radius.X*cos, + radius.Y*sin, + )) + + (*imd.tri)[j+0].Position = pt.pos + (*imd.tri)[j+1].Position = a + (*imd.tri)[j+2].Position = b + } + + imd.applyMatrixAndMask(off) + imd.batch.Dirty() + } + + imd.restorePoints(points) +} + +func (imd *IMDraw) outlineEllipseArc(radius pixel.Vec, low, high, thickness float64, doEndShape bool) { + points := imd.getAndClearPoints() + + for _, pt := range points { + num := math.Ceil(math.Abs(high-low) / (2 * math.Pi) * float64(pt.precision)) + delta := (high - low) / num + + off := imd.tri.Len() + imd.tri.SetLen(imd.tri.Len() + 6*int(num)) + + for i := range (*imd.tri)[off:] { + (*imd.tri)[off+i].Color = pt.col + (*imd.tri)[off+i].Picture = pixel.ZV + (*imd.tri)[off+i].Intensity = 0 + } + + for i, j := 0.0, off; i < num; i, j = i+1, j+6 { + angle := low + i*delta + sin, cos := math.Sincos(angle) + normalSin, normalCos := pixel.V(sin, cos).ScaledXY(radius).Unit().XY() + a := pt.pos.Add(pixel.V( + radius.X*cos-thickness/2*normalCos, + radius.Y*sin-thickness/2*normalSin, + )) + b := pt.pos.Add(pixel.V( + radius.X*cos+thickness/2*normalCos, + radius.Y*sin+thickness/2*normalSin, + )) + + angle = low + (i+1)*delta + sin, cos = math.Sincos(angle) + normalSin, normalCos = pixel.V(sin, cos).ScaledXY(radius).Unit().XY() + c := pt.pos.Add(pixel.V( + radius.X*cos-thickness/2*normalCos, + radius.Y*sin-thickness/2*normalSin, + )) + d := pt.pos.Add(pixel.V( + radius.X*cos+thickness/2*normalCos, + radius.Y*sin+thickness/2*normalSin, + )) + + (*imd.tri)[j+0].Position = a + (*imd.tri)[j+1].Position = b + (*imd.tri)[j+2].Position = c + (*imd.tri)[j+3].Position = c + (*imd.tri)[j+4].Position = b + (*imd.tri)[j+5].Position = d + } + + imd.applyMatrixAndMask(off) + imd.batch.Dirty() + + if doEndShape { + lowSin, lowCos := math.Sincos(low) + lowCenter := pt.pos.Add(pixel.V( + radius.X*lowCos, + radius.Y*lowSin, + )) + normalLowSin, normalLowCos := pixel.V(lowSin, lowCos).ScaledXY(radius).Unit().XY() + normalLow := pixel.V(normalLowCos, normalLowSin).Angle() + + highSin, highCos := math.Sincos(high) + highCenter := pt.pos.Add(pixel.V( + radius.X*highCos, + radius.Y*highSin, + )) + normalHighSin, normalHighCos := pixel.V(highSin, highCos).ScaledXY(radius).Unit().XY() + normalHigh := pixel.V(normalHighCos, normalHighSin).Angle() + + orientation := 1.0 + if low > high { + orientation = -1.0 + } + + switch pt.endshape { + case NoEndShape: + // nothing + case SharpEndShape: + thick := pixel.V(thickness/2, 0).Rotated(normalLow) + imd.pushPt(lowCenter.Add(thick), pt) + imd.pushPt(lowCenter.Sub(thick), pt) + imd.pushPt(lowCenter.Sub(thick.Normal().Scaled(orientation)), pt) + imd.fillPolygon() + thick = pixel.V(thickness/2, 0).Rotated(normalHigh) + imd.pushPt(highCenter.Add(thick), pt) + imd.pushPt(highCenter.Sub(thick), pt) + imd.pushPt(highCenter.Add(thick.Normal().Scaled(orientation)), pt) + imd.fillPolygon() + case RoundEndShape: + imd.pushPt(lowCenter, pt) + imd.fillEllipseArc(pixel.V(thickness/2, thickness/2), normalLow, normalLow-math.Pi*orientation) + imd.pushPt(highCenter, pt) + imd.fillEllipseArc(pixel.V(thickness/2, thickness/2), normalHigh, normalHigh+math.Pi*orientation) + } + } + } + + imd.restorePoints(points) +} + +func (imd *IMDraw) polyline(thickness float64, closed bool) { + points := imd.getAndClearPoints() + + if len(points) == 0 { + imd.restorePoints(points) + return + } + if len(points) == 1 { + // one point special case + points = append(points, points[0]) + } + + // first point + j, i := 0, 1 + ijNormal := points[0].pos.To(points[1].pos).Normal().Unit().Scaled(thickness / 2) + + if !closed { + switch points[j].endshape { + case NoEndShape: + // nothing + case SharpEndShape: + imd.pushPt(points[j].pos.Add(ijNormal), points[j]) + imd.pushPt(points[j].pos.Sub(ijNormal), points[j]) + imd.pushPt(points[j].pos.Add(ijNormal.Normal()), points[j]) + imd.fillPolygon() + case RoundEndShape: + imd.pushPt(points[j].pos, points[j]) + imd.fillEllipseArc(pixel.V(thickness/2, thickness/2), ijNormal.Angle(), ijNormal.Angle()+math.Pi) + } + } + + imd.pushPt(points[j].pos.Add(ijNormal), points[j]) + imd.pushPt(points[j].pos.Sub(ijNormal), points[j]) + + // middle points + for i := 0; i < len(points); i++ { + j, k := i+1, i+2 + + closing := false + if j >= len(points) { + j %= len(points) + closing = true + } + if k >= len(points) { + if !closed { + break + } + k %= len(points) + } + + jkNormal := points[j].pos.To(points[k].pos).Normal().Unit().Scaled(thickness / 2) + + orientation := 1.0 + if ijNormal.Cross(jkNormal) > 0 { + orientation = -1.0 + } + + imd.pushPt(points[j].pos.Sub(ijNormal), points[j]) + imd.pushPt(points[j].pos.Add(ijNormal), points[j]) + imd.fillPolygon() + + switch points[j].endshape { + case NoEndShape: + // nothing + case SharpEndShape: + imd.pushPt(points[j].pos, points[j]) + imd.pushPt(points[j].pos.Add(ijNormal.Scaled(orientation)), points[j]) + imd.pushPt(points[j].pos.Add(jkNormal.Scaled(orientation)), points[j]) + imd.fillPolygon() + case RoundEndShape: + imd.pushPt(points[j].pos, points[j]) + imd.fillEllipseArc(pixel.V(thickness/2, thickness/2), ijNormal.Angle(), ijNormal.Angle()-math.Pi) + imd.pushPt(points[j].pos, points[j]) + imd.fillEllipseArc(pixel.V(thickness/2, thickness/2), jkNormal.Angle(), jkNormal.Angle()+math.Pi) + } + + if !closing { + imd.pushPt(points[j].pos.Add(jkNormal), points[j]) + imd.pushPt(points[j].pos.Sub(jkNormal), points[j]) + } + // "next" normal becomes previous normal + ijNormal = jkNormal + } + + // last point + i, j = len(points)-2, len(points)-1 + ijNormal = points[i].pos.To(points[j].pos).Normal().Unit().Scaled(thickness / 2) + + imd.pushPt(points[j].pos.Sub(ijNormal), points[j]) + imd.pushPt(points[j].pos.Add(ijNormal), points[j]) + imd.fillPolygon() + + if !closed { + switch points[j].endshape { + case NoEndShape: + // nothing + case SharpEndShape: + imd.pushPt(points[j].pos.Add(ijNormal), points[j]) + imd.pushPt(points[j].pos.Sub(ijNormal), points[j]) + imd.pushPt(points[j].pos.Add(ijNormal.Normal().Scaled(-1)), points[j]) + imd.fillPolygon() + case RoundEndShape: + imd.pushPt(points[j].pos, points[j]) + imd.fillEllipseArc(pixel.V(thickness/2, thickness/2), ijNormal.Angle(), ijNormal.Angle()-math.Pi) + } + } + + imd.restorePoints(points) +} diff --git a/vendor/github.com/faiface/pixel/interface.go b/vendor/github.com/faiface/pixel/interface.go new file mode 100644 index 0000000..9aa5f2e --- /dev/null +++ b/vendor/github.com/faiface/pixel/interface.go @@ -0,0 +1,133 @@ +package pixel + +import "image/color" + +// Target is something that can be drawn onto, such as a window, a canvas, and so on. +// +// You can notice, that there are no "drawing" methods in a Target. That's because all drawing +// happens indirectly through Triangles and Picture instances generated via MakeTriangles and +// MakePicture method. +type Target interface { + // MakeTriangles generates a specialized copy of the provided Triangles. + // + // When calling Draw method on the returned TargetTriangles, the TargetTriangles will be + // drawn onto the Target that generated them. + // + // Note, that not every Target has to recognize all possible types of Triangles. Some may + // only recognize TrianglesPosition and TrianglesColor and ignore all other properties (if + // present) when making new TargetTriangles. This varies from Target to Target. + MakeTriangles(Triangles) TargetTriangles + + // MakePicture generates a specialized copy of the provided Picture. + // + // When calling Draw method on the returned TargetPicture, the TargetPicture will be drawn + // onto the Target that generated it together with the TargetTriangles supplied to the Draw + // method. + MakePicture(Picture) TargetPicture +} + +// BasicTarget is a Target with additional basic adjustment methods. +type BasicTarget interface { + Target + + // SetMatrix sets a Matrix that every point will be projected by. + SetMatrix(Matrix) + + // SetColorMask sets a color that will be multiplied with the TrianglesColor property of all + // Triangles. + SetColorMask(color.Color) +} + +// Triangles represents a list of vertices, where each three vertices form a triangle. (First, +// second and third is the first triangle, fourth, fifth and sixth is the second triangle, etc.) +type Triangles interface { + // Len returns the number of vertices. The number of triangles is the number of vertices + // divided by 3. + Len() int + + // SetLen resizes Triangles to len vertices. If Triangles B were obtained by calling Slice + // method on Triangles A, the relationship between A and B is undefined after calling SetLen + // on either one of them. + SetLen(len int) + + // Slice returns a sub-Triangles of this Triangles, covering vertices in range [i, j). + // + // If Triangles B were obtained by calling Slice(4, 9) on Triangles A, then A and B must + // share the same underlying data. Modifying B must change the contents of A in range + // [4, 9). The vertex with index 0 at B is the vertex with index 4 in A, and so on. + // + // Returned Triangles must have the same underlying type. + Slice(i, j int) Triangles + + // Update copies vertex properties from the supplied Triangles into this Triangles. + // + // Properies not supported by these Triangles should be ignored. Properties not supported by + // the supplied Triangles should be left untouched. + // + // The two Triangles must have the same Len. + Update(Triangles) + + // Copy creates an exact independent copy of this Triangles (with the same underlying type). + Copy() Triangles +} + +// TargetTriangles are Triangles generated by a Target with MakeTriangles method. They can be drawn +// onto that (no other) Target. +type TargetTriangles interface { + Triangles + + // Draw draws Triangles onto an associated Target. + Draw() +} + +// TrianglesPosition specifies Triangles with Position property. +type TrianglesPosition interface { + Triangles + Position(i int) Vec +} + +// TrianglesColor specifies Triangles with Color property. +type TrianglesColor interface { + Triangles + Color(i int) RGBA +} + +// TrianglesPicture specifies Triangles with Picture propery. +// +// The first value returned from Picture method is Picture coordinates. The second one specifies the +// weight of the Picture. Value of 0 means, that Picture should be completely ignored, 1 means that +// is should be fully included and anything in between means anything in between. +type TrianglesPicture interface { + Triangles + Picture(i int) (pic Vec, intensity float64) +} + +// Picture represents a rectangular area of raster data, such as a color. It has Bounds which +// specify the rectangle where data is located. +type Picture interface { + // Bounds returns the rectangle of the Picture. All data is located witih this rectangle. + // Querying properties outside the rectangle should return default value of that property. + Bounds() Rect +} + +// TargetPicture is a Picture generated by a Target using MakePicture method. This Picture can be drawn onto +// that (no other) Target together with a TargetTriangles generated by the same Target. +// +// The TargetTriangles specify where, shape and how the Picture should be drawn. +type TargetPicture interface { + Picture + + // Draw draws the supplied TargetTriangles (which must be generated by the same Target as + // this TargetPicture) with this TargetPicture. The TargetTriangles should utilize the data + // from this TargetPicture in some way. + Draw(TargetTriangles) +} + +// PictureColor specifies Picture with Color property, so that every position inside the Picture's +// Bounds has a color. +// +// Positions outside the Picture's Bounds must return full transparent (Alpha(0)). +type PictureColor interface { + Picture + Color(at Vec) RGBA +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/canvas.go b/vendor/github.com/faiface/pixel/pixelgl/canvas.go new file mode 100644 index 0000000..b8e4057 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/canvas.go @@ -0,0 +1,431 @@ +package pixelgl + +import ( + "fmt" + "image/color" + + "github.com/faiface/glhf" + "github.com/faiface/mainthread" + "github.com/faiface/pixel" + "github.com/go-gl/mathgl/mgl32" + "github.com/pkg/errors" +) + +// Canvas is an off-screen rectangular BasicTarget and Picture at the same time, that you can draw +// onto. +// +// It supports TrianglesPosition, TrianglesColor, TrianglesPicture and PictureColor. +type Canvas struct { + gf *GLFrame + shader *glhf.Shader + + cmp pixel.ComposeMethod + mat mgl32.Mat3 + col mgl32.Vec4 + smooth bool + + sprite *pixel.Sprite +} + +var _ pixel.ComposeTarget = (*Canvas)(nil) + +// NewCanvas creates a new empty, fully transparent Canvas with given bounds. +func NewCanvas(bounds pixel.Rect) *Canvas { + c := &Canvas{ + gf: NewGLFrame(bounds), + mat: mgl32.Ident3(), + col: mgl32.Vec4{1, 1, 1, 1}, + } + + c.SetBounds(bounds) + + var shader *glhf.Shader + mainthread.Call(func() { + var err error + shader, err = glhf.NewShader( + canvasVertexFormat, + canvasUniformFormat, + canvasVertexShader, + canvasFragmentShader, + ) + if err != nil { + panic(errors.Wrap(err, "failed to create Canvas, there's a bug in the shader")) + } + }) + c.shader = shader + + return c +} + +// MakeTriangles creates a specialized copy of the supplied Triangles that draws onto this Canvas. +// +// TrianglesPosition, TrianglesColor and TrianglesPicture are supported. +func (c *Canvas) MakeTriangles(t pixel.Triangles) pixel.TargetTriangles { + return &canvasTriangles{ + GLTriangles: NewGLTriangles(c.shader, t), + dst: c, + } +} + +// MakePicture create a specialized copy of the supplied Picture that draws onto this Canvas. +// +// PictureColor is supported. +func (c *Canvas) MakePicture(p pixel.Picture) pixel.TargetPicture { + if cp, ok := p.(*canvasPicture); ok { + return &canvasPicture{ + GLPicture: cp.GLPicture, + dst: c, + } + } + if gp, ok := p.(GLPicture); ok { + return &canvasPicture{ + GLPicture: gp, + dst: c, + } + } + return &canvasPicture{ + GLPicture: NewGLPicture(p), + dst: c, + } +} + +// SetMatrix sets a Matrix that every point will be projected by. +func (c *Canvas) SetMatrix(m pixel.Matrix) { + // pixel.Matrix is 3x2 with an implicit 0, 0, 1 row after it. So + // [0] [2] [4] [0] [3] [6] + // [1] [3] [5] => [1] [4] [7] + // 0 0 1 0 0 1 + // since all matrix ops are affine, the last row never changes, and we don't need to copy it + for i, j := range [...]int{0, 1, 3, 4, 6, 7} { + c.mat[j] = float32(m[i]) + } +} + +// SetColorMask sets a color that every color in triangles or a picture will be multiplied by. +func (c *Canvas) SetColorMask(col color.Color) { + rgba := pixel.Alpha(1) + if col != nil { + rgba = pixel.ToRGBA(col) + } + c.col = mgl32.Vec4{ + float32(rgba.R), + float32(rgba.G), + float32(rgba.B), + float32(rgba.A), + } +} + +// SetComposeMethod sets a Porter-Duff composition method to be used in the following draws onto +// this Canvas. +func (c *Canvas) SetComposeMethod(cmp pixel.ComposeMethod) { + c.cmp = cmp +} + +// SetBounds resizes the Canvas to the new bounds. Old content will be preserved. +func (c *Canvas) SetBounds(bounds pixel.Rect) { + c.gf.SetBounds(bounds) + if c.sprite == nil { + c.sprite = pixel.NewSprite(nil, pixel.Rect{}) + } + c.sprite.Set(c, c.Bounds()) + //c.sprite.SetMatrix(pixel.IM.Moved(c.Bounds().Center())) +} + +// Bounds returns the rectangular bounds of the Canvas. +func (c *Canvas) Bounds() pixel.Rect { + return c.gf.Bounds() +} + +// SetSmooth sets whether stretched Pictures drawn onto this Canvas should be drawn smooth or +// pixely. +func (c *Canvas) SetSmooth(smooth bool) { + c.smooth = smooth +} + +// Smooth returns whether stretched Pictures drawn onto this Canvas are set to be drawn smooth or +// pixely. +func (c *Canvas) Smooth() bool { + return c.smooth +} + +// must be manually called inside mainthread +func (c *Canvas) setGlhfBounds() { + _, _, bw, bh := intBounds(c.gf.Bounds()) + glhf.Bounds(0, 0, bw, bh) +} + +// must be manually called inside mainthread +func setBlendFunc(cmp pixel.ComposeMethod) { + switch cmp { + case pixel.ComposeOver: + glhf.BlendFunc(glhf.One, glhf.OneMinusSrcAlpha) + case pixel.ComposeIn: + glhf.BlendFunc(glhf.DstAlpha, glhf.Zero) + case pixel.ComposeOut: + glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.Zero) + case pixel.ComposeAtop: + glhf.BlendFunc(glhf.DstAlpha, glhf.OneMinusSrcAlpha) + case pixel.ComposeRover: + glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.One) + case pixel.ComposeRin: + glhf.BlendFunc(glhf.Zero, glhf.SrcAlpha) + case pixel.ComposeRout: + glhf.BlendFunc(glhf.Zero, glhf.OneMinusSrcAlpha) + case pixel.ComposeRatop: + glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.SrcAlpha) + case pixel.ComposeXor: + glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.OneMinusSrcAlpha) + case pixel.ComposePlus: + glhf.BlendFunc(glhf.One, glhf.One) + case pixel.ComposeCopy: + glhf.BlendFunc(glhf.One, glhf.Zero) + default: + panic(errors.New("Canvas: invalid compose method")) + } +} + +// Clear fills the whole Canvas with a single color. +func (c *Canvas) Clear(color color.Color) { + c.gf.Dirty() + + rgba := pixel.ToRGBA(color) + + // color masking + rgba = rgba.Mul(pixel.RGBA{ + R: float64(c.col[0]), + G: float64(c.col[1]), + B: float64(c.col[2]), + A: float64(c.col[3]), + }) + + mainthread.CallNonBlock(func() { + c.setGlhfBounds() + c.gf.Frame().Begin() + glhf.Clear( + float32(rgba.R), + float32(rgba.G), + float32(rgba.B), + float32(rgba.A), + ) + c.gf.Frame().End() + }) +} + +// Color returns the color of the pixel over the given position inside the Canvas. +func (c *Canvas) Color(at pixel.Vec) pixel.RGBA { + return c.gf.Color(at) +} + +// Texture returns the underlying OpenGL Texture of this Canvas. +// +// Implements GLPicture interface. +func (c *Canvas) Texture() *glhf.Texture { + return c.gf.Texture() +} + +// Frame returns the underlying OpenGL Frame of this Canvas. +func (c *Canvas) Frame() *glhf.Frame { + return c.gf.frame +} + +// SetPixels replaces the content of the Canvas with the provided pixels. The provided slice must be +// an alpha-premultiplied RGBA sequence of correct length (4 * width * height). +func (c *Canvas) SetPixels(pixels []uint8) { + c.gf.Dirty() + + mainthread.Call(func() { + tex := c.Texture() + tex.Begin() + tex.SetPixels(0, 0, tex.Width(), tex.Height(), pixels) + tex.End() + }) +} + +// Pixels returns an alpha-premultiplied RGBA sequence of the content of the Canvas. +func (c *Canvas) Pixels() []uint8 { + var pixels []uint8 + + mainthread.Call(func() { + tex := c.Texture() + tex.Begin() + pixels = tex.Pixels(0, 0, tex.Width(), tex.Height()) + tex.End() + }) + + return pixels +} + +// Draw draws the content of the Canvas onto another Target, transformed by the given Matrix, just +// like if it was a Sprite containing the whole Canvas. +func (c *Canvas) Draw(t pixel.Target, matrix pixel.Matrix) { + c.sprite.Draw(t, matrix) +} + +// DrawColorMask draws the content of the Canvas onto another Target, transformed by the given +// Matrix and multiplied by the given mask, just like if it was a Sprite containing the whole Canvas. +// +// If the color mask is nil, a fully opaque white mask will be used causing no effect. +func (c *Canvas) DrawColorMask(t pixel.Target, matrix pixel.Matrix, mask color.Color) { + c.sprite.DrawColorMask(t, matrix, mask) +} + +type canvasTriangles struct { + *GLTriangles + dst *Canvas +} + +func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) { + ct.dst.gf.Dirty() + + // save the current state vars to avoid race condition + cmp := ct.dst.cmp + mat := ct.dst.mat + col := ct.dst.col + smt := ct.dst.smooth + + mainthread.CallNonBlock(func() { + ct.dst.setGlhfBounds() + setBlendFunc(cmp) + + frame := ct.dst.gf.Frame() + shader := ct.dst.shader + + frame.Begin() + shader.Begin() + + dstBounds := ct.dst.Bounds() + shader.SetUniformAttr(canvasBounds, mgl32.Vec4{ + float32(dstBounds.Min.X), + float32(dstBounds.Min.Y), + float32(dstBounds.W()), + float32(dstBounds.H()), + }) + shader.SetUniformAttr(canvasTransform, mat) + shader.SetUniformAttr(canvasColorMask, col) + + if tex == nil { + ct.vs.Begin() + ct.vs.Draw() + ct.vs.End() + } else { + tex.Begin() + + bx, by, bw, bh := intBounds(bounds) + shader.SetUniformAttr(canvasTexBounds, mgl32.Vec4{ + float32(bx), + float32(by), + float32(bw), + float32(bh), + }) + + if tex.Smooth() != smt { + tex.SetSmooth(smt) + } + + ct.vs.Begin() + ct.vs.Draw() + ct.vs.End() + + tex.End() + } + + shader.End() + frame.End() + }) +} + +func (ct *canvasTriangles) Draw() { + ct.draw(nil, pixel.Rect{}) +} + +type canvasPicture struct { + GLPicture + dst *Canvas +} + +func (cp *canvasPicture) Draw(t pixel.TargetTriangles) { + ct := t.(*canvasTriangles) + if cp.dst != ct.dst { + panic(fmt.Errorf("(%T).Draw: TargetTriangles generated by different Canvas", cp)) + } + ct.draw(cp.GLPicture.Texture(), cp.GLPicture.Bounds()) +} + +const ( + canvasPosition int = iota + canvasColor + canvasTexCoords + canvasIntensity +) + +var canvasVertexFormat = glhf.AttrFormat{ + canvasPosition: {Name: "position", Type: glhf.Vec2}, + canvasColor: {Name: "color", Type: glhf.Vec4}, + canvasTexCoords: {Name: "texCoords", Type: glhf.Vec2}, + canvasIntensity: {Name: "intensity", Type: glhf.Float}, +} + +const ( + canvasTransform int = iota + canvasColorMask + canvasBounds + canvasTexBounds +) + +var canvasUniformFormat = glhf.AttrFormat{ + canvasTransform: {Name: "transform", Type: glhf.Mat3}, + canvasColorMask: {Name: "colorMask", Type: glhf.Vec4}, + canvasBounds: {Name: "bounds", Type: glhf.Vec4}, + canvasTexBounds: {Name: "texBounds", Type: glhf.Vec4}, +} + +var canvasVertexShader = ` +#version 330 core + +in vec2 position; +in vec4 color; +in vec2 texCoords; +in float intensity; + +out vec4 Color; +out vec2 TexCoords; +out float Intensity; + +uniform mat3 transform; +uniform vec4 bounds; + +void main() { + vec2 transPos = (transform * vec3(position, 1.0)).xy; + vec2 normPos = (transPos - bounds.xy) / bounds.zw * 2 - vec2(1, 1); + gl_Position = vec4(normPos, 0.0, 1.0); + Color = color; + TexCoords = texCoords; + Intensity = intensity; +} +` + +var canvasFragmentShader = ` +#version 330 core + +in vec4 Color; +in vec2 TexCoords; +in float Intensity; + +out vec4 color; + +uniform vec4 colorMask; +uniform vec4 texBounds; +uniform sampler2D tex; + +void main() { + if (Intensity == 0) { + color = colorMask * Color; + } else { + color = vec4(0, 0, 0, 0); + color += (1 - Intensity) * Color; + vec2 t = (TexCoords - texBounds.xy) / texBounds.zw; + color += Intensity * Color * texture(tex, t); + color *= colorMask; + } +} +` diff --git a/vendor/github.com/faiface/pixel/pixelgl/doc.go b/vendor/github.com/faiface/pixel/pixelgl/doc.go new file mode 100644 index 0000000..c8acbbc --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/doc.go @@ -0,0 +1,5 @@ +// Package pixelgl implements efficient OpenGL targets and utilities for the Pixel game development +// library, specifically Window and Canvas. +// +// It also contains a few additional utilities to help extend Pixel with OpenGL graphical effects. +package pixelgl diff --git a/vendor/github.com/faiface/pixel/pixelgl/glframe.go b/vendor/github.com/faiface/pixel/pixelgl/glframe.go new file mode 100644 index 0000000..a6ef881 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/glframe.go @@ -0,0 +1,105 @@ +package pixelgl + +import ( + "github.com/faiface/glhf" + "github.com/faiface/mainthread" + "github.com/faiface/pixel" +) + +// GLFrame is a type that helps implementing OpenGL Targets. It implements most common methods to +// avoid code redundancy. It contains an glhf.Frame that you can draw on. +type GLFrame struct { + frame *glhf.Frame + bounds pixel.Rect + pixels []uint8 + dirty bool +} + +// NewGLFrame creates a new GLFrame with the given bounds. +func NewGLFrame(bounds pixel.Rect) *GLFrame { + gf := new(GLFrame) + gf.SetBounds(bounds) + return gf +} + +// SetBounds resizes the GLFrame to the new bounds. +func (gf *GLFrame) SetBounds(bounds pixel.Rect) { + if bounds == gf.Bounds() { + return + } + + mainthread.Call(func() { + oldF := gf.frame + + _, _, w, h := intBounds(bounds) + if w <= 0 { + w = 1 + } + if h <= 0 { + h = 1 + } + gf.frame = glhf.NewFrame(w, h, false) + + // preserve old content + if oldF != nil { + ox, oy, ow, oh := intBounds(bounds) + oldF.Blit( + gf.frame, + ox, oy, ox+ow, oy+oh, + ox, oy, ox+ow, oy+oh, + ) + } + }) + + gf.bounds = bounds + gf.pixels = nil + gf.dirty = true +} + +// Bounds returns the current GLFrame's bounds. +func (gf *GLFrame) Bounds() pixel.Rect { + return gf.bounds +} + +// Color returns the color of the pixel under the specified position. +func (gf *GLFrame) Color(at pixel.Vec) pixel.RGBA { + if gf.dirty { + mainthread.Call(func() { + tex := gf.frame.Texture() + tex.Begin() + gf.pixels = tex.Pixels(0, 0, tex.Width(), tex.Height()) + tex.End() + }) + gf.dirty = false + } + if !gf.bounds.Contains(at) { + return pixel.Alpha(0) + } + bx, by, bw, _ := intBounds(gf.bounds) + x, y := int(at.X)-bx, int(at.Y)-by + off := y*bw + x + return pixel.RGBA{ + R: float64(gf.pixels[off*4+0]) / 255, + G: float64(gf.pixels[off*4+1]) / 255, + B: float64(gf.pixels[off*4+2]) / 255, + A: float64(gf.pixels[off*4+3]) / 255, + } +} + +// Frame returns the GLFrame's Frame that you can draw on. +func (gf *GLFrame) Frame() *glhf.Frame { + return gf.frame +} + +// Texture returns the underlying Texture of the GLFrame's Frame. +// +// Implements GLPicture interface. +func (gf *GLFrame) Texture() *glhf.Texture { + return gf.frame.Texture() +} + +// Dirty marks the GLFrame as changed. Always call this method when you draw onto the GLFrame's +// Frame. +func (gf *GLFrame) Dirty() { + gf.dirty = true +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/glpicture.go b/vendor/github.com/faiface/pixel/pixelgl/glpicture.go new file mode 100644 index 0000000..659f014 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/glpicture.go @@ -0,0 +1,98 @@ +package pixelgl + +import ( + "math" + + "github.com/faiface/glhf" + "github.com/faiface/mainthread" + "github.com/faiface/pixel" +) + +// GLPicture is a pixel.PictureColor with a Texture. All OpenGL Targets should implement and accept +// this interface, because it enables seamless drawing of one to another. +// +// Implementing this interface on an OpenGL Target enables other OpenGL Targets to efficiently draw +// that Target onto them. +type GLPicture interface { + pixel.PictureColor + Texture() *glhf.Texture +} + +// NewGLPicture creates a new GLPicture with it's own static OpenGL texture. This function always +// allocates a new texture that cannot (shouldn't) be further modified. +func NewGLPicture(p pixel.Picture) GLPicture { + bounds := p.Bounds() + bx, by, bw, bh := intBounds(bounds) + + pixels := make([]uint8, 4*bw*bh) + + if pd, ok := p.(*pixel.PictureData); ok { + // PictureData short path + for y := 0; y < bh; y++ { + for x := 0; x < bw; x++ { + rgba := pd.Pix[y*pd.Stride+x] + off := (y*bw + x) * 4 + pixels[off+0] = rgba.R + pixels[off+1] = rgba.G + pixels[off+2] = rgba.B + pixels[off+3] = rgba.A + } + } + } else if p, ok := p.(pixel.PictureColor); ok { + for y := 0; y < bh; y++ { + for x := 0; x < bw; x++ { + at := pixel.V( + math.Max(float64(bx+x), bounds.Min.X), + math.Max(float64(by+y), bounds.Min.Y), + ) + color := p.Color(at) + off := (y*bw + x) * 4 + pixels[off+0] = uint8(color.R * 255) + pixels[off+1] = uint8(color.G * 255) + pixels[off+2] = uint8(color.B * 255) + pixels[off+3] = uint8(color.A * 255) + } + } + } + + var tex *glhf.Texture + mainthread.Call(func() { + tex = glhf.NewTexture(bw, bh, false, pixels) + }) + + gp := &glPicture{ + bounds: bounds, + tex: tex, + pixels: pixels, + } + return gp +} + +type glPicture struct { + bounds pixel.Rect + tex *glhf.Texture + pixels []uint8 +} + +func (gp *glPicture) Bounds() pixel.Rect { + return gp.bounds +} + +func (gp *glPicture) Texture() *glhf.Texture { + return gp.tex +} + +func (gp *glPicture) Color(at pixel.Vec) pixel.RGBA { + if !gp.bounds.Contains(at) { + return pixel.Alpha(0) + } + bx, by, bw, _ := intBounds(gp.bounds) + x, y := int(at.X)-bx, int(at.Y)-by + off := y*bw + x + return pixel.RGBA{ + R: float64(gp.pixels[off*4+0]) / 255, + G: float64(gp.pixels[off*4+1]) / 255, + B: float64(gp.pixels[off*4+2]) / 255, + A: float64(gp.pixels[off*4+3]) / 255, + } +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/gltriangles.go b/vendor/github.com/faiface/pixel/pixelgl/gltriangles.go new file mode 100644 index 0000000..52ed0c9 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/gltriangles.go @@ -0,0 +1,215 @@ +package pixelgl + +import ( + "fmt" + + "github.com/faiface/glhf" + "github.com/faiface/mainthread" + "github.com/faiface/pixel" +) + +// GLTriangles are OpenGL triangles implemented using glhf.VertexSlice. +// +// Triangles returned from this function support TrianglesPosition, TrianglesColor and +// TrianglesPicture. If you need to support more, you can "override" SetLen and Update methods. +type GLTriangles struct { + vs *glhf.VertexSlice + data []float32 + shader *glhf.Shader +} + +var ( + _ pixel.TrianglesPosition = (*GLTriangles)(nil) + _ pixel.TrianglesColor = (*GLTriangles)(nil) + _ pixel.TrianglesPicture = (*GLTriangles)(nil) +) + +// NewGLTriangles returns GLTriangles initialized with the data from the supplied Triangles. +// +// Only draw the Triangles using the provided Shader. +func NewGLTriangles(shader *glhf.Shader, t pixel.Triangles) *GLTriangles { + var gt *GLTriangles + mainthread.Call(func() { + gt = &GLTriangles{ + vs: glhf.MakeVertexSlice(shader, 0, t.Len()), + shader: shader, + } + }) + gt.SetLen(t.Len()) + gt.Update(t) + return gt +} + +// VertexSlice returns the VertexSlice of this GLTriangles. +// +// You can use it to draw them. +func (gt *GLTriangles) VertexSlice() *glhf.VertexSlice { + return gt.vs +} + +// Shader returns the GLTriangles's associated shader. +func (gt *GLTriangles) Shader() *glhf.Shader { + return gt.shader +} + +// Len returns the number of vertices. +func (gt *GLTriangles) Len() int { + return len(gt.data) / gt.vs.Stride() +} + +// SetLen efficiently resizes GLTriangles to len. +// +// Time complexity is amortized O(1). +func (gt *GLTriangles) SetLen(length int) { + switch { + case length > gt.Len(): + needAppend := length - gt.Len() + for i := 0; i < needAppend; i++ { + gt.data = append(gt.data, + 0, 0, + 1, 1, 1, 1, + 0, 0, + 0, + ) + } + case length < gt.Len(): + gt.data = gt.data[:length*gt.vs.Stride()] + default: + return + } + mainthread.CallNonBlock(func() { + gt.vs.Begin() + gt.vs.SetLen(length) + gt.vs.End() + }) +} + +// Slice returns a sub-Triangles of this GLTriangles in range [i, j). +func (gt *GLTriangles) Slice(i, j int) pixel.Triangles { + return &GLTriangles{ + vs: gt.vs.Slice(i, j), + data: gt.data[i*gt.vs.Stride() : j*gt.vs.Stride()], + shader: gt.shader, + } +} + +func (gt *GLTriangles) updateData(t pixel.Triangles) { + // glTriangles short path + if t, ok := t.(*GLTriangles); ok { + copy(gt.data, t.data) + return + } + + // TrianglesData short path + stride := gt.vs.Stride() + length := gt.Len() + if t, ok := t.(*pixel.TrianglesData); ok { + for i := 0; i < length; i++ { + var ( + px, py = (*t)[i].Position.XY() + col = (*t)[i].Color + tx, ty = (*t)[i].Picture.XY() + in = (*t)[i].Intensity + ) + d := gt.data[i*stride : i*stride+9] + d[0] = float32(px) + d[1] = float32(py) + d[2] = float32(col.R) + d[3] = float32(col.G) + d[4] = float32(col.B) + d[5] = float32(col.A) + d[6] = float32(tx) + d[7] = float32(ty) + d[8] = float32(in) + } + return + } + + if t, ok := t.(pixel.TrianglesPosition); ok { + for i := 0; i < length; i++ { + px, py := t.Position(i).XY() + gt.data[i*stride+0] = float32(px) + gt.data[i*stride+1] = float32(py) + } + } + if t, ok := t.(pixel.TrianglesColor); ok { + for i := 0; i < length; i++ { + col := t.Color(i) + gt.data[i*stride+2] = float32(col.R) + gt.data[i*stride+3] = float32(col.G) + gt.data[i*stride+4] = float32(col.B) + gt.data[i*stride+5] = float32(col.A) + } + } + if t, ok := t.(pixel.TrianglesPicture); ok { + for i := 0; i < length; i++ { + pic, intensity := t.Picture(i) + gt.data[i*stride+6] = float32(pic.X) + gt.data[i*stride+7] = float32(pic.Y) + gt.data[i*stride+8] = float32(intensity) + } + } +} + +// Update copies vertex properties from the supplied Triangles into this GLTriangles. +// +// The two Triangles (gt and t) must be of the same len. +func (gt *GLTriangles) Update(t pixel.Triangles) { + if gt.Len() != t.Len() { + panic(fmt.Errorf("(%T).Update: invalid triangles len", gt)) + } + gt.updateData(t) + + // this code is supposed to copy the vertex data and CallNonBlock the update if + // the data is small enough, otherwise it'll block and not copy the data + if len(gt.data) < 256 { // arbitrary heurestic constant + data := append([]float32{}, gt.data...) + mainthread.CallNonBlock(func() { + gt.vs.Begin() + gt.vs.SetVertexData(data) + gt.vs.End() + }) + } else { + mainthread.Call(func() { + gt.vs.Begin() + gt.vs.SetVertexData(gt.data) + gt.vs.End() + }) + } +} + +// Copy returns an independent copy of this GLTriangles. +// +// The returned Triangles are *GLTriangles as the underlying type. +func (gt *GLTriangles) Copy() pixel.Triangles { + return NewGLTriangles(gt.shader, gt) +} + +// Position returns the Position property of the i-th vertex. +func (gt *GLTriangles) Position(i int) pixel.Vec { + px := gt.data[i*gt.vs.Stride()+0] + py := gt.data[i*gt.vs.Stride()+1] + return pixel.V(float64(px), float64(py)) +} + +// Color returns the Color property of the i-th vertex. +func (gt *GLTriangles) Color(i int) pixel.RGBA { + r := gt.data[i*gt.vs.Stride()+2] + g := gt.data[i*gt.vs.Stride()+3] + b := gt.data[i*gt.vs.Stride()+4] + a := gt.data[i*gt.vs.Stride()+5] + return pixel.RGBA{ + R: float64(r), + G: float64(g), + B: float64(b), + A: float64(a), + } +} + +// Picture returns the Picture property of the i-th vertex. +func (gt *GLTriangles) Picture(i int) (pic pixel.Vec, intensity float64) { + tx := gt.data[i*gt.vs.Stride()+6] + ty := gt.data[i*gt.vs.Stride()+7] + intensity = float64(gt.data[i*gt.vs.Stride()+8]) + return pixel.V(float64(tx), float64(ty)), intensity +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/input.go b/vendor/github.com/faiface/pixel/pixelgl/input.go new file mode 100644 index 0000000..2eedb0d --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/input.go @@ -0,0 +1,388 @@ +package pixelgl + +import ( + "github.com/faiface/mainthread" + "github.com/faiface/pixel" + "github.com/go-gl/glfw/v3.2/glfw" +) + +// Pressed returns whether the Button is currently pressed down. +func (w *Window) Pressed(button Button) bool { + return w.currInp.buttons[button] +} + +// JustPressed returns whether the Button has just been pressed down. +func (w *Window) JustPressed(button Button) bool { + return w.currInp.buttons[button] && !w.prevInp.buttons[button] +} + +// JustReleased returns whether the Button has just been released up. +func (w *Window) JustReleased(button Button) bool { + return !w.currInp.buttons[button] && w.prevInp.buttons[button] +} + +// Repeated returns whether a repeat event has been triggered on button. +// +// Repeat event occurs repeatedly when a button is held down for some time. +func (w *Window) Repeated(button Button) bool { + return w.currInp.repeat[button] +} + +// MousePosition returns the current mouse position in the Window's Bounds. +func (w *Window) MousePosition() pixel.Vec { + return w.currInp.mouse +} + +// MouseScroll returns the mouse scroll amount (in both axes) since the last call to Window.Update. +func (w *Window) MouseScroll() pixel.Vec { + return w.currInp.scroll +} + +// Typed returns the text typed on the keyboard since the last call to Window.Update. +func (w *Window) Typed() string { + return w.currInp.typed +} + +// Button is a keyboard or mouse button. Why distinguish? +type Button int + +// List of all mouse buttons. +const ( + MouseButton1 = Button(glfw.MouseButton1) + MouseButton2 = Button(glfw.MouseButton2) + MouseButton3 = Button(glfw.MouseButton3) + MouseButton4 = Button(glfw.MouseButton4) + MouseButton5 = Button(glfw.MouseButton5) + MouseButton6 = Button(glfw.MouseButton6) + MouseButton7 = Button(glfw.MouseButton7) + MouseButton8 = Button(glfw.MouseButton8) + MouseButtonLast = Button(glfw.MouseButtonLast) + MouseButtonLeft = Button(glfw.MouseButtonLeft) + MouseButtonRight = Button(glfw.MouseButtonRight) + MouseButtonMiddle = Button(glfw.MouseButtonMiddle) +) + +// List of all keyboard buttons. +const ( + KeyUnknown = Button(glfw.KeyUnknown) + KeySpace = Button(glfw.KeySpace) + KeyApostrophe = Button(glfw.KeyApostrophe) + KeyComma = Button(glfw.KeyComma) + KeyMinus = Button(glfw.KeyMinus) + KeyPeriod = Button(glfw.KeyPeriod) + KeySlash = Button(glfw.KeySlash) + Key0 = Button(glfw.Key0) + Key1 = Button(glfw.Key1) + Key2 = Button(glfw.Key2) + Key3 = Button(glfw.Key3) + Key4 = Button(glfw.Key4) + Key5 = Button(glfw.Key5) + Key6 = Button(glfw.Key6) + Key7 = Button(glfw.Key7) + Key8 = Button(glfw.Key8) + Key9 = Button(glfw.Key9) + KeySemicolon = Button(glfw.KeySemicolon) + KeyEqual = Button(glfw.KeyEqual) + KeyA = Button(glfw.KeyA) + KeyB = Button(glfw.KeyB) + KeyC = Button(glfw.KeyC) + KeyD = Button(glfw.KeyD) + KeyE = Button(glfw.KeyE) + KeyF = Button(glfw.KeyF) + KeyG = Button(glfw.KeyG) + KeyH = Button(glfw.KeyH) + KeyI = Button(glfw.KeyI) + KeyJ = Button(glfw.KeyJ) + KeyK = Button(glfw.KeyK) + KeyL = Button(glfw.KeyL) + KeyM = Button(glfw.KeyM) + KeyN = Button(glfw.KeyN) + KeyO = Button(glfw.KeyO) + KeyP = Button(glfw.KeyP) + KeyQ = Button(glfw.KeyQ) + KeyR = Button(glfw.KeyR) + KeyS = Button(glfw.KeyS) + KeyT = Button(glfw.KeyT) + KeyU = Button(glfw.KeyU) + KeyV = Button(glfw.KeyV) + KeyW = Button(glfw.KeyW) + KeyX = Button(glfw.KeyX) + KeyY = Button(glfw.KeyY) + KeyZ = Button(glfw.KeyZ) + KeyLeftBracket = Button(glfw.KeyLeftBracket) + KeyBackslash = Button(glfw.KeyBackslash) + KeyRightBracket = Button(glfw.KeyRightBracket) + KeyGraveAccent = Button(glfw.KeyGraveAccent) + KeyWorld1 = Button(glfw.KeyWorld1) + KeyWorld2 = Button(glfw.KeyWorld2) + KeyEscape = Button(glfw.KeyEscape) + KeyEnter = Button(glfw.KeyEnter) + KeyTab = Button(glfw.KeyTab) + KeyBackspace = Button(glfw.KeyBackspace) + KeyInsert = Button(glfw.KeyInsert) + KeyDelete = Button(glfw.KeyDelete) + KeyRight = Button(glfw.KeyRight) + KeyLeft = Button(glfw.KeyLeft) + KeyDown = Button(glfw.KeyDown) + KeyUp = Button(glfw.KeyUp) + KeyPageUp = Button(glfw.KeyPageUp) + KeyPageDown = Button(glfw.KeyPageDown) + KeyHome = Button(glfw.KeyHome) + KeyEnd = Button(glfw.KeyEnd) + KeyCapsLock = Button(glfw.KeyCapsLock) + KeyScrollLock = Button(glfw.KeyScrollLock) + KeyNumLock = Button(glfw.KeyNumLock) + KeyPrintScreen = Button(glfw.KeyPrintScreen) + KeyPause = Button(glfw.KeyPause) + KeyF1 = Button(glfw.KeyF1) + KeyF2 = Button(glfw.KeyF2) + KeyF3 = Button(glfw.KeyF3) + KeyF4 = Button(glfw.KeyF4) + KeyF5 = Button(glfw.KeyF5) + KeyF6 = Button(glfw.KeyF6) + KeyF7 = Button(glfw.KeyF7) + KeyF8 = Button(glfw.KeyF8) + KeyF9 = Button(glfw.KeyF9) + KeyF10 = Button(glfw.KeyF10) + KeyF11 = Button(glfw.KeyF11) + KeyF12 = Button(glfw.KeyF12) + KeyF13 = Button(glfw.KeyF13) + KeyF14 = Button(glfw.KeyF14) + KeyF15 = Button(glfw.KeyF15) + KeyF16 = Button(glfw.KeyF16) + KeyF17 = Button(glfw.KeyF17) + KeyF18 = Button(glfw.KeyF18) + KeyF19 = Button(glfw.KeyF19) + KeyF20 = Button(glfw.KeyF20) + KeyF21 = Button(glfw.KeyF21) + KeyF22 = Button(glfw.KeyF22) + KeyF23 = Button(glfw.KeyF23) + KeyF24 = Button(glfw.KeyF24) + KeyF25 = Button(glfw.KeyF25) + KeyKP0 = Button(glfw.KeyKP0) + KeyKP1 = Button(glfw.KeyKP1) + KeyKP2 = Button(glfw.KeyKP2) + KeyKP3 = Button(glfw.KeyKP3) + KeyKP4 = Button(glfw.KeyKP4) + KeyKP5 = Button(glfw.KeyKP5) + KeyKP6 = Button(glfw.KeyKP6) + KeyKP7 = Button(glfw.KeyKP7) + KeyKP8 = Button(glfw.KeyKP8) + KeyKP9 = Button(glfw.KeyKP9) + KeyKPDecimal = Button(glfw.KeyKPDecimal) + KeyKPDivide = Button(glfw.KeyKPDivide) + KeyKPMultiply = Button(glfw.KeyKPMultiply) + KeyKPSubtract = Button(glfw.KeyKPSubtract) + KeyKPAdd = Button(glfw.KeyKPAdd) + KeyKPEnter = Button(glfw.KeyKPEnter) + KeyKPEqual = Button(glfw.KeyKPEqual) + KeyLeftShift = Button(glfw.KeyLeftShift) + KeyLeftControl = Button(glfw.KeyLeftControl) + KeyLeftAlt = Button(glfw.KeyLeftAlt) + KeyLeftSuper = Button(glfw.KeyLeftSuper) + KeyRightShift = Button(glfw.KeyRightShift) + KeyRightControl = Button(glfw.KeyRightControl) + KeyRightAlt = Button(glfw.KeyRightAlt) + KeyRightSuper = Button(glfw.KeyRightSuper) + KeyMenu = Button(glfw.KeyMenu) + KeyLast = Button(glfw.KeyLast) +) + +// String returns a human-readable string describing the Button. +func (b Button) String() string { + name, ok := buttonNames[b] + if !ok { + return "Invalid" + } + return name +} + +var buttonNames = map[Button]string{ + MouseButton4: "MouseButton4", + MouseButton5: "MouseButton5", + MouseButton6: "MouseButton6", + MouseButton7: "MouseButton7", + MouseButton8: "MouseButton8", + MouseButtonLeft: "MouseButtonLeft", + MouseButtonRight: "MouseButtonRight", + MouseButtonMiddle: "MouseButtonMiddle", + KeyUnknown: "Unknown", + KeySpace: "Space", + KeyApostrophe: "Apostrophe", + KeyComma: "Comma", + KeyMinus: "Minus", + KeyPeriod: "Period", + KeySlash: "Slash", + Key0: "0", + Key1: "1", + Key2: "2", + Key3: "3", + Key4: "4", + Key5: "5", + Key6: "6", + Key7: "7", + Key8: "8", + Key9: "9", + KeySemicolon: "Semicolon", + KeyEqual: "Equal", + KeyA: "A", + KeyB: "B", + KeyC: "C", + KeyD: "D", + KeyE: "E", + KeyF: "F", + KeyG: "G", + KeyH: "H", + KeyI: "I", + KeyJ: "J", + KeyK: "K", + KeyL: "L", + KeyM: "M", + KeyN: "N", + KeyO: "O", + KeyP: "P", + KeyQ: "Q", + KeyR: "R", + KeyS: "S", + KeyT: "T", + KeyU: "U", + KeyV: "V", + KeyW: "W", + KeyX: "X", + KeyY: "Y", + KeyZ: "Z", + KeyLeftBracket: "LeftBracket", + KeyBackslash: "Backslash", + KeyRightBracket: "RightBracket", + KeyGraveAccent: "GraveAccent", + KeyWorld1: "World1", + KeyWorld2: "World2", + KeyEscape: "Escape", + KeyEnter: "Enter", + KeyTab: "Tab", + KeyBackspace: "Backspace", + KeyInsert: "Insert", + KeyDelete: "Delete", + KeyRight: "Right", + KeyLeft: "Left", + KeyDown: "Down", + KeyUp: "Up", + KeyPageUp: "PageUp", + KeyPageDown: "PageDown", + KeyHome: "Home", + KeyEnd: "End", + KeyCapsLock: "CapsLock", + KeyScrollLock: "ScrollLock", + KeyNumLock: "NumLock", + KeyPrintScreen: "PrintScreen", + KeyPause: "Pause", + KeyF1: "F1", + KeyF2: "F2", + KeyF3: "F3", + KeyF4: "F4", + KeyF5: "F5", + KeyF6: "F6", + KeyF7: "F7", + KeyF8: "F8", + KeyF9: "F9", + KeyF10: "F10", + KeyF11: "F11", + KeyF12: "F12", + KeyF13: "F13", + KeyF14: "F14", + KeyF15: "F15", + KeyF16: "F16", + KeyF17: "F17", + KeyF18: "F18", + KeyF19: "F19", + KeyF20: "F20", + KeyF21: "F21", + KeyF22: "F22", + KeyF23: "F23", + KeyF24: "F24", + KeyF25: "F25", + KeyKP0: "KP0", + KeyKP1: "KP1", + KeyKP2: "KP2", + KeyKP3: "KP3", + KeyKP4: "KP4", + KeyKP5: "KP5", + KeyKP6: "KP6", + KeyKP7: "KP7", + KeyKP8: "KP8", + KeyKP9: "KP9", + KeyKPDecimal: "KPDecimal", + KeyKPDivide: "KPDivide", + KeyKPMultiply: "KPMultiply", + KeyKPSubtract: "KPSubtract", + KeyKPAdd: "KPAdd", + KeyKPEnter: "KPEnter", + KeyKPEqual: "KPEqual", + KeyLeftShift: "LeftShift", + KeyLeftControl: "LeftControl", + KeyLeftAlt: "LeftAlt", + KeyLeftSuper: "LeftSuper", + KeyRightShift: "RightShift", + KeyRightControl: "RightControl", + KeyRightAlt: "RightAlt", + KeyRightSuper: "RightSuper", + KeyMenu: "Menu", +} + +func (w *Window) initInput() { + mainthread.Call(func() { + w.window.SetMouseButtonCallback(func(_ *glfw.Window, button glfw.MouseButton, action glfw.Action, mod glfw.ModifierKey) { + switch action { + case glfw.Press: + w.tempInp.buttons[Button(button)] = true + case glfw.Release: + w.tempInp.buttons[Button(button)] = false + } + }) + + w.window.SetKeyCallback(func(_ *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey) { + if key == glfw.KeyUnknown { + return + } + switch action { + case glfw.Press: + w.tempInp.buttons[Button(key)] = true + case glfw.Release: + w.tempInp.buttons[Button(key)] = false + case glfw.Repeat: + w.tempInp.repeat[Button(key)] = true + } + }) + + w.window.SetCursorPosCallback(func(_ *glfw.Window, x, y float64) { + w.tempInp.mouse = pixel.V( + x+w.bounds.Min.X, + (w.bounds.H()-y)+w.bounds.Min.Y, + ) + }) + + w.window.SetScrollCallback(func(_ *glfw.Window, xoff, yoff float64) { + w.tempInp.scroll.X += xoff + w.tempInp.scroll.Y += yoff + }) + + w.window.SetCharCallback(func(_ *glfw.Window, r rune) { + w.tempInp.typed += string(r) + }) + }) +} + +// UpdateInput polls window events. Call this function to poll window events +// without swapping buffers. Note that the Update method invokes UpdateInput. +func (w *Window) UpdateInput() { + mainthread.Call(func() { + glfw.PollEvents() + }) + + w.prevInp = w.currInp + w.currInp = w.tempInp + + w.tempInp.repeat = [KeyLast + 1]bool{} + w.tempInp.scroll = pixel.ZV + w.tempInp.typed = "" +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/monitor.go b/vendor/github.com/faiface/pixel/pixelgl/monitor.go new file mode 100644 index 0000000..7cf73a9 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/monitor.go @@ -0,0 +1,97 @@ +package pixelgl + +import ( + "github.com/faiface/mainthread" + "github.com/go-gl/glfw/v3.2/glfw" +) + +// Monitor represents a physical display attached to your computer. +type Monitor struct { + monitor *glfw.Monitor +} + +// PrimaryMonitor returns the main monitor (usually the one with the taskbar and stuff). +func PrimaryMonitor() *Monitor { + var monitor *glfw.Monitor + mainthread.Call(func() { + monitor = glfw.GetPrimaryMonitor() + }) + return &Monitor{ + monitor: monitor, + } +} + +// Monitors returns a slice of all currently available monitors. +func Monitors() []*Monitor { + var monitors []*Monitor + mainthread.Call(func() { + for _, monitor := range glfw.GetMonitors() { + monitors = append(monitors, &Monitor{monitor: monitor}) + } + }) + return monitors +} + +// Name returns a human-readable name of the Monitor. +func (m *Monitor) Name() string { + var name string + mainthread.Call(func() { + name = m.monitor.GetName() + }) + return name +} + +// PhysicalSize returns the size of the display area of the Monitor in millimeters. +func (m *Monitor) PhysicalSize() (width, height float64) { + var wi, hi int + mainthread.Call(func() { + wi, hi = m.monitor.GetPhysicalSize() + }) + width = float64(wi) + height = float64(hi) + return +} + +// Position returns the position of the upper-left corner of the Monitor in screen coordinates. +func (m *Monitor) Position() (x, y float64) { + var xi, yi int + mainthread.Call(func() { + xi, yi = m.monitor.GetPos() + }) + x = float64(xi) + y = float64(yi) + return +} + +// Size returns the resolution of the Monitor in pixels. +func (m *Monitor) Size() (width, height float64) { + var mode *glfw.VidMode + mainthread.Call(func() { + mode = m.monitor.GetVideoMode() + }) + width = float64(mode.Width) + height = float64(mode.Height) + return +} + +// BitDepth returns the number of bits per color of the Monitor. +func (m *Monitor) BitDepth() (red, green, blue int) { + var mode *glfw.VidMode + mainthread.Call(func() { + mode = m.monitor.GetVideoMode() + }) + red = mode.RedBits + green = mode.GreenBits + blue = mode.BlueBits + return +} + +// RefreshRate returns the refresh frequency of the Monitor in Hz (refreshes/second). +func (m *Monitor) RefreshRate() (rate float64) { + var mode *glfw.VidMode + mainthread.Call(func() { + mode = m.monitor.GetVideoMode() + }) + rate = float64(mode.RefreshRate) + return +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/run.go b/vendor/github.com/faiface/pixel/pixelgl/run.go new file mode 100644 index 0000000..94e89c2 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/run.go @@ -0,0 +1,33 @@ +package pixelgl + +import ( + "github.com/faiface/mainthread" + "github.com/go-gl/glfw/v3.2/glfw" + "github.com/pkg/errors" +) + +// Run is essentially the main function of PixelGL. It exists mainly due to the technical +// limitations of OpenGL and operating systems. In short, all graphics and window manipulating calls +// must be done from the main thread. Run makes this possible. +// +// Call this function from the main function of your application. This is necessary, so that Run +// runs on the main thread. +// +// func run() { +// // interact with Pixel and PixelGL from here (even concurrently) +// } +// +// func main() { +// pixel.Run(run) +// } +// +// You can spawn any number of goroutines from your run function and interact with PixelGL +// concurrently. The only condition is that the Run function is called from your main function. +func Run(run func()) { + err := glfw.Init() + if err != nil { + panic(errors.Wrap(err, "failed to initialize GLFW")) + } + defer glfw.Terminate() + mainthread.Run(run) +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/util.go b/vendor/github.com/faiface/pixel/pixelgl/util.go new file mode 100644 index 0000000..c11ea3c --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/util.go @@ -0,0 +1,15 @@ +package pixelgl + +import ( + "math" + + "github.com/faiface/pixel" +) + +func intBounds(bounds pixel.Rect) (x, y, w, h int) { + x0 := int(math.Floor(bounds.Min.X)) + y0 := int(math.Floor(bounds.Min.Y)) + x1 := int(math.Ceil(bounds.Max.X)) + y1 := int(math.Ceil(bounds.Max.Y)) + return x0, y0, x1 - x0, y1 - y0 +} diff --git a/vendor/github.com/faiface/pixel/pixelgl/window.go b/vendor/github.com/faiface/pixel/pixelgl/window.go new file mode 100644 index 0000000..e501cc5 --- /dev/null +++ b/vendor/github.com/faiface/pixel/pixelgl/window.go @@ -0,0 +1,426 @@ +package pixelgl + +import ( + "image" + "image/color" + "runtime" + + "github.com/faiface/glhf" + "github.com/faiface/mainthread" + "github.com/faiface/pixel" + "github.com/go-gl/glfw/v3.2/glfw" + "github.com/pkg/errors" +) + +// WindowConfig is a structure for specifying all possible properties of a Window. Properties are +// chosen in such a way, that you usually only need to set a few of them - defaults (zeros) should +// usually be sensible. +// +// Note that you always need to set the Bounds of a Window. +type WindowConfig struct { + // Title at the top of the Window. + Title string + + // Icon specifies the icon images available to be used by the window. This is usually + // displayed in the top bar of the window or in the task bar of the desktop environment. + // + // If passed one image, it will use that image, if passed an array of images those of or + // closest to the sizes desired by the system are selected. The desired image sizes varies + // depending on platform and system settings. The selected images will be rescaled as + // needed. Good sizes include 16x16, 32x32 and 48x48. + // + // Note: Setting this value doesn't have an effect on OSX. You'll need to set the icon when + // bundling your application for release. + Icon []pixel.Picture + + // Bounds specify the bounds of the Window in pixels. + Bounds pixel.Rect + + // If set to nil, the Window will be windowed. Otherwise it will be fullscreen on the + // specified Monitor. + Monitor *Monitor + + // Whether the Window is resizable. + Resizable bool + + // Undecorated Window ommits the borders and decorations (close button, etc.). + Undecorated bool + + // VSync (vertical synchronization) synchronizes Window's framerate with the framerate of + // the monitor. + VSync bool +} + +// Window is a window handler. Use this type to manipulate a window (input, drawing, etc.). +type Window struct { + window *glfw.Window + + bounds pixel.Rect + canvas *Canvas + vsync bool + cursorVisible bool + + // need to save these to correctly restore a fullscreen window + restore struct { + xpos, ypos, width, height int + } + + prevInp, currInp, tempInp struct { + mouse pixel.Vec + buttons [KeyLast + 1]bool + repeat [KeyLast + 1]bool + scroll pixel.Vec + typed string + } +} + +var currWin *Window + +// NewWindow creates a new Window with it's properties specified in the provided config. +// +// If Window creation fails, an error is returned (e.g. due to unavailable graphics device). +func NewWindow(cfg WindowConfig) (*Window, error) { + bool2int := map[bool]int{ + true: glfw.True, + false: glfw.False, + } + + w := &Window{bounds: cfg.Bounds, cursorVisible: true} + + err := mainthread.CallErr(func() error { + var err error + + glfw.WindowHint(glfw.ContextVersionMajor, 3) + glfw.WindowHint(glfw.ContextVersionMinor, 3) + glfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile) + glfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True) + + glfw.WindowHint(glfw.Resizable, bool2int[cfg.Resizable]) + glfw.WindowHint(glfw.Decorated, bool2int[!cfg.Undecorated]) + + var share *glfw.Window + if currWin != nil { + share = currWin.window + } + _, _, width, height := intBounds(cfg.Bounds) + w.window, err = glfw.CreateWindow( + width, + height, + cfg.Title, + nil, + share, + ) + if err != nil { + return err + } + + // enter the OpenGL context + w.begin() + w.end() + + return nil + }) + if err != nil { + return nil, errors.Wrap(err, "creating window failed") + } + + if len(cfg.Icon) > 0 { + imgs := make([]image.Image, len(cfg.Icon)) + for i, icon := range cfg.Icon { + pic := pixel.PictureDataFromPicture(icon) + imgs[i] = pic.Image() + } + mainthread.Call(func() { + w.window.SetIcon(imgs) + }) + } + + w.SetVSync(cfg.VSync) + + w.initInput() + w.SetMonitor(cfg.Monitor) + + w.canvas = NewCanvas(cfg.Bounds) + w.Update() + + runtime.SetFinalizer(w, (*Window).Destroy) + + return w, nil +} + +// Destroy destroys the Window. The Window can't be used any further. +func (w *Window) Destroy() { + mainthread.Call(func() { + w.window.Destroy() + }) +} + +// Update swaps buffers and polls events. Call this method at the end of each frame. +func (w *Window) Update() { + mainthread.Call(func() { + _, _, oldW, oldH := intBounds(w.bounds) + newW, newH := w.window.GetSize() + w.bounds = w.bounds.ResizedMin(w.bounds.Size().Add(pixel.V( + float64(newW-oldW), + float64(newH-oldH), + ))) + }) + + w.canvas.SetBounds(w.bounds) + + mainthread.Call(func() { + w.begin() + + framebufferWidth, framebufferHeight := w.window.GetFramebufferSize() + glhf.Bounds(0, 0, framebufferWidth, framebufferHeight) + + glhf.Clear(0, 0, 0, 0) + w.canvas.gf.Frame().Begin() + w.canvas.gf.Frame().Blit( + nil, + 0, 0, w.canvas.Texture().Width(), w.canvas.Texture().Height(), + 0, 0, framebufferWidth, framebufferHeight, + ) + w.canvas.gf.Frame().End() + + if w.vsync { + glfw.SwapInterval(1) + } else { + glfw.SwapInterval(0) + } + w.window.SwapBuffers() + w.end() + }) + + w.UpdateInput() +} + +// SetClosed sets the closed flag of the Window. +// +// This is useful when overriding the user's attempt to close the Window, or just to close the +// Window from within the program. +func (w *Window) SetClosed(closed bool) { + mainthread.Call(func() { + w.window.SetShouldClose(closed) + }) +} + +// Closed returns the closed flag of the Window, which reports whether the Window should be closed. +// +// The closed flag is automatically set when a user attempts to close the Window. +func (w *Window) Closed() bool { + var closed bool + mainthread.Call(func() { + closed = w.window.ShouldClose() + }) + return closed +} + +// SetTitle changes the title of the Window. +func (w *Window) SetTitle(title string) { + mainthread.Call(func() { + w.window.SetTitle(title) + }) +} + +// SetBounds sets the bounds of the Window in pixels. Bounds can be fractional, but the actual size +// of the window will be rounded to integers. +func (w *Window) SetBounds(bounds pixel.Rect) { + w.bounds = bounds + mainthread.Call(func() { + _, _, width, height := intBounds(bounds) + w.window.SetSize(width, height) + }) +} + +// SetPos sets the position, in screen coordinates, of the upper-left corner +// of the client area of the window. Position can be fractional, but the actual position +// of the window will be rounded to integers. +// +// If it is a full screen window, this function does nothing. +func (w *Window) SetPos(pos pixel.Vec) { + mainthread.Call(func() { + left, top := int(pos.X), int(pos.Y) + w.window.SetPos(left, top) + }) +} + +// GetPos gets the position, in screen coordinates, of the upper-left corner +// of the client area of the window. The position is rounded to integers. +func (w *Window) GetPos() pixel.Vec { + var v pixel.Vec + mainthread.Call(func() { + x, y := w.window.GetPos() + v = pixel.V(float64(x), float64(y)) + }) + return v +} + +// Bounds returns the current bounds of the Window. +func (w *Window) Bounds() pixel.Rect { + return w.bounds +} + +func (w *Window) setFullscreen(monitor *Monitor) { + mainthread.Call(func() { + w.restore.xpos, w.restore.ypos = w.window.GetPos() + w.restore.width, w.restore.height = w.window.GetSize() + + mode := monitor.monitor.GetVideoMode() + + w.window.SetMonitor( + monitor.monitor, + 0, + 0, + mode.Width, + mode.Height, + mode.RefreshRate, + ) + }) +} + +func (w *Window) setWindowed() { + mainthread.Call(func() { + w.window.SetMonitor( + nil, + w.restore.xpos, + w.restore.ypos, + w.restore.width, + w.restore.height, + 0, + ) + }) +} + +// SetMonitor sets the Window fullscreen on the given Monitor. If the Monitor is nil, the Window +// will be restored to windowed state instead. +// +// The Window will be automatically set to the Monitor's resolution. If you want a different +// resolution, you will need to set it manually with SetBounds method. +func (w *Window) SetMonitor(monitor *Monitor) { + if w.Monitor() != monitor { + if monitor != nil { + w.setFullscreen(monitor) + } else { + w.setWindowed() + } + } +} + +// Monitor returns a monitor the Window is fullscreen on. If the Window is not fullscreen, this +// function returns nil. +func (w *Window) Monitor() *Monitor { + var monitor *glfw.Monitor + mainthread.Call(func() { + monitor = w.window.GetMonitor() + }) + if monitor == nil { + return nil + } + return &Monitor{ + monitor: monitor, + } +} + +// Focused returns true if the Window has input focus. +func (w *Window) Focused() bool { + var focused bool + mainthread.Call(func() { + focused = w.window.GetAttrib(glfw.Focused) == glfw.True + }) + return focused +} + +// SetVSync sets whether the Window's Update should synchronize with the monitor refresh rate. +func (w *Window) SetVSync(vsync bool) { + w.vsync = vsync +} + +// VSync returns whether the Window is set to synchronize with the monitor refresh rate. +func (w *Window) VSync() bool { + return w.vsync +} + +// SetCursorVisible sets the visibility of the mouse cursor inside the Window client area. +func (w *Window) SetCursorVisible(visible bool) { + w.cursorVisible = visible + mainthread.Call(func() { + if visible { + w.window.SetInputMode(glfw.CursorMode, glfw.CursorNormal) + } else { + w.window.SetInputMode(glfw.CursorMode, glfw.CursorHidden) + } + }) +} + +// CursorVisible returns the visibility status of the mouse cursor. +func (w *Window) CursorVisible() bool { + return w.cursorVisible +} + +// Note: must be called inside the main thread. +func (w *Window) begin() { + if currWin != w { + w.window.MakeContextCurrent() + glhf.Init() + currWin = w + } +} + +// Note: must be called inside the main thread. +func (w *Window) end() { + // nothing, really +} + +// MakeTriangles generates a specialized copy of the supplied Triangles that will draw onto this +// Window. +// +// Window supports TrianglesPosition, TrianglesColor and TrianglesPicture. +func (w *Window) MakeTriangles(t pixel.Triangles) pixel.TargetTriangles { + return w.canvas.MakeTriangles(t) +} + +// MakePicture generates a specialized copy of the supplied Picture that will draw onto this Window. +// +// Window supports PictureColor. +func (w *Window) MakePicture(p pixel.Picture) pixel.TargetPicture { + return w.canvas.MakePicture(p) +} + +// SetMatrix sets a Matrix that every point will be projected by. +func (w *Window) SetMatrix(m pixel.Matrix) { + w.canvas.SetMatrix(m) +} + +// SetColorMask sets a global color mask for the Window. +func (w *Window) SetColorMask(c color.Color) { + w.canvas.SetColorMask(c) +} + +// SetComposeMethod sets a Porter-Duff composition method to be used in the following draws onto +// this Window. +func (w *Window) SetComposeMethod(cmp pixel.ComposeMethod) { + w.canvas.SetComposeMethod(cmp) +} + +// SetSmooth sets whether the stretched Pictures drawn onto this Window should be drawn smooth or +// pixely. +func (w *Window) SetSmooth(smooth bool) { + w.canvas.SetSmooth(smooth) +} + +// Smooth returns whether the stretched Pictures drawn onto this Window are set to be drawn smooth +// or pixely. +func (w *Window) Smooth() bool { + return w.canvas.Smooth() +} + +// Clear clears the Window with a single color. +func (w *Window) Clear(c color.Color) { + w.canvas.Clear(c) +} + +// Color returns the color of the pixel over the given position inside the Window. +func (w *Window) Color(at pixel.Vec) pixel.RGBA { + return w.canvas.Color(at) +} diff --git a/vendor/github.com/faiface/pixel/sprite.go b/vendor/github.com/faiface/pixel/sprite.go new file mode 100644 index 0000000..0808759 --- /dev/null +++ b/vendor/github.com/faiface/pixel/sprite.go @@ -0,0 +1,117 @@ +package pixel + +import "image/color" + +// Sprite is a drawable frame of a Picture. It's anchored by the center of it's Picture's frame. +// +// Frame specifies a rectangular portion of the Picture that will be drawn. For example, this +// creates a Sprite that draws the whole Picture: +// +// sprite := pixel.NewSprite(pic, pic.Bounds()) +// +// Note, that Sprite caches the results of MakePicture from Targets it's drawn to for each Picture +// it's set to. What it means is that using a Sprite with an unbounded number of Pictures leads to a +// memory leak, since Sprite caches them and never forgets. In such a situation, create a new Sprite +// for each Picture. +type Sprite struct { + tri *TrianglesData + frame Rect + d Drawer + + matrix Matrix + mask RGBA +} + +// NewSprite creates a Sprite from the supplied frame of a Picture. +func NewSprite(pic Picture, frame Rect) *Sprite { + tri := MakeTrianglesData(6) + s := &Sprite{ + tri: tri, + d: Drawer{Triangles: tri}, + } + s.matrix = IM + s.mask = Alpha(1) + s.Set(pic, frame) + return s +} + +// Set sets a new frame of a Picture for this Sprite. +func (s *Sprite) Set(pic Picture, frame Rect) { + s.d.Picture = pic + if frame != s.frame { + s.frame = frame + s.calcData() + } +} + +// Picture returns the current Sprite's Picture. +func (s *Sprite) Picture() Picture { + return s.d.Picture +} + +// Frame returns the current Sprite's frame. +func (s *Sprite) Frame() Rect { + return s.frame +} + +// Draw draws the Sprite onto the provided Target. The Sprite will be transformed by the given Matrix. +// +// This method is equivalent to calling DrawColorMask with nil color mask. +func (s *Sprite) Draw(t Target, matrix Matrix) { + s.DrawColorMask(t, matrix, nil) +} + +// DrawColorMask draws the Sprite onto the provided Target. The Sprite will be transformed by the +// given Matrix and all of it's color will be multiplied by the given mask. +// +// If the mask is nil, a fully opaque white mask will be used, which causes no effect. +func (s *Sprite) DrawColorMask(t Target, matrix Matrix, mask color.Color) { + dirty := false + if matrix != s.matrix { + s.matrix = matrix + dirty = true + } + if mask == nil { + mask = Alpha(1) + } + rgba := ToRGBA(mask) + if rgba != s.mask { + s.mask = rgba + dirty = true + } + + if dirty { + s.calcData() + } + + s.d.Draw(t) +} + +func (s *Sprite) calcData() { + var ( + center = s.frame.Center() + horizontal = V(s.frame.W()/2, 0) + vertical = V(0, s.frame.H()/2) + ) + + (*s.tri)[0].Position = Vec{}.Sub(horizontal).Sub(vertical) + (*s.tri)[1].Position = Vec{}.Add(horizontal).Sub(vertical) + (*s.tri)[2].Position = Vec{}.Add(horizontal).Add(vertical) + (*s.tri)[3].Position = Vec{}.Sub(horizontal).Sub(vertical) + (*s.tri)[4].Position = Vec{}.Add(horizontal).Add(vertical) + (*s.tri)[5].Position = Vec{}.Sub(horizontal).Add(vertical) + + for i := range *s.tri { + (*s.tri)[i].Color = s.mask + (*s.tri)[i].Picture = center.Add((*s.tri)[i].Position) + (*s.tri)[i].Intensity = 1 + } + + // matrix and mask + for i := range *s.tri { + (*s.tri)[i].Position = s.matrix.Project((*s.tri)[i].Position) + (*s.tri)[i].Color = s.mask + } + + s.d.Dirty() +} diff --git a/vendor/github.com/go-gl/gl/LICENSE b/vendor/github.com/go-gl/gl/LICENSE new file mode 100644 index 0000000..bac95ec --- /dev/null +++ b/vendor/github.com/go-gl/gl/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Eric Woroshow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go b/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go new file mode 100644 index 0000000..866fcd4 --- /dev/null +++ b/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go @@ -0,0 +1,109 @@ +// Glow automatically generated OpenGL binding: http://github.com/go-gl/glow + +package gl + +import ( + "fmt" + "reflect" + "strings" + "unsafe" +) + +// #include +import "C" + +// Ptr takes a slice or pointer (to a singular scalar value or the first +// element of an array or slice) and returns its GL-compatible address. +// +// For example: +// +// var data []uint8 +// ... +// gl.TexImage2D(gl.TEXTURE_2D, ..., gl.UNSIGNED_BYTE, gl.Ptr(&data[0])) +func Ptr(data interface{}) unsafe.Pointer { + if data == nil { + return unsafe.Pointer(nil) + } + var addr unsafe.Pointer + v := reflect.ValueOf(data) + switch v.Type().Kind() { + case reflect.Ptr: + e := v.Elem() + switch e.Kind() { + case + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Float32, reflect.Float64: + addr = unsafe.Pointer(e.UnsafeAddr()) + default: + panic(fmt.Errorf("unsupported pointer to type %s; must be a slice or pointer to a singular scalar value or the first element of an array or slice", e.Kind())) + } + case reflect.Uintptr: + addr = unsafe.Pointer(v.Pointer()) + case reflect.Slice: + addr = unsafe.Pointer(v.Index(0).UnsafeAddr()) + default: + panic(fmt.Errorf("unsupported type %s; must be a slice or pointer to a singular scalar value or the first element of an array or slice", v.Type())) + } + return addr +} + +// PtrOffset takes a pointer offset and returns a GL-compatible pointer. +// Useful for functions such as glVertexAttribPointer that take pointer +// parameters indicating an offset rather than an absolute memory address. +func PtrOffset(offset int) unsafe.Pointer { + return unsafe.Pointer(uintptr(offset)) +} + +// Str takes a null-terminated Go string and returns its GL-compatible address. +// This function reaches into Go string storage in an unsafe way so the caller +// must ensure the string is not garbage collected. +func Str(str string) *uint8 { + if !strings.HasSuffix(str, "\x00") { + panic("str argument missing null terminator: " + str) + } + header := (*reflect.StringHeader)(unsafe.Pointer(&str)) + return (*uint8)(unsafe.Pointer(header.Data)) +} + +// GoStr takes a null-terminated string returned by OpenGL and constructs a +// corresponding Go string. +func GoStr(cstr *uint8) string { + return C.GoString((*C.char)(unsafe.Pointer(cstr))) +} + +// Strs takes a list of Go strings (with or without null-termination) and +// returns their C counterpart. +// +// The returned free function must be called once you are done using the strings +// in order to free the memory. +// +// If no strings are provided as a parameter this function will panic. +func Strs(strs ...string) (cstrs **uint8, free func()) { + if len(strs) == 0 { + panic("Strs: expected at least 1 string") + } + + // Allocate a contiguous array large enough to hold all the strings' contents. + n := 0 + for i := range strs { + n += len(strs[i]) + } + data := C.malloc(C.size_t(n)) + + // Copy all the strings into data. + dataSlice := *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ + Data: uintptr(data), + Len: n, + Cap: n, + })) + css := make([]*uint8, len(strs)) // Populated with pointers to each string. + offset := 0 + for i := range strs { + copy(dataSlice[offset:offset+len(strs[i])], strs[i][:]) // Copy strs[i] into proper data location. + css[i] = (*uint8)(unsafe.Pointer(&dataSlice[offset])) // Set a pointer to it. + offset += len(strs[i]) + } + + return (**uint8)(&css[0]), func() { C.free(data) } +} diff --git a/vendor/github.com/go-gl/gl/v3.3-core/gl/debug.go b/vendor/github.com/go-gl/gl/v3.3-core/gl/debug.go new file mode 100644 index 0000000..ce4aee3 --- /dev/null +++ b/vendor/github.com/go-gl/gl/v3.3-core/gl/debug.go @@ -0,0 +1,31 @@ +// Glow automatically generated OpenGL binding: http://github.com/go-gl/glow + +package gl + +import "C" +import "unsafe" + +type DebugProc func( + source uint32, + gltype uint32, + id uint32, + severity uint32, + length int32, + message string, + userParam unsafe.Pointer) + +var userDebugCallback DebugProc + +//export glowDebugCallback_glcore33 +func glowDebugCallback_glcore33( + source uint32, + gltype uint32, + id uint32, + severity uint32, + length int32, + message *uint8, + userParam unsafe.Pointer) { + if userDebugCallback != nil { + userDebugCallback(source, gltype, id, severity, length, GoStr(message), userParam) + } +} diff --git a/vendor/github.com/go-gl/gl/v3.3-core/gl/package.go b/vendor/github.com/go-gl/gl/v3.3-core/gl/package.go new file mode 100644 index 0000000..84979c8 --- /dev/null +++ b/vendor/github.com/go-gl/gl/v3.3-core/gl/package.go @@ -0,0 +1,9882 @@ +// Copyright (c) 2010 Khronos Group. +// This material may be distributed subject to the terms and conditions +// set forth in the Open Publication License, v 1.0, 8 June 1999. +// http://opencontent.org/openpub/. +// +// Copyright (c) 1991-2006 Silicon Graphics, Inc. +// This document is licensed under the SGI Free Software B License. +// For details, see http://oss.sgi.com/projects/FreeB. + +// Package gl implements Go bindings to OpenGL. +// +// This package was automatically generated using Glow: +// http://github.com/go-gl/glow +// +// Generated based on the OpenGL XML specification: +// SVN revision 27695 +package gl + +// #cgo darwin LDFLAGS: -framework OpenGL +// #cgo linux freebsd LDFLAGS: -lGL +// #cgo windows LDFLAGS: -lopengl32 +// #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +// #ifndef WIN32_LEAN_AND_MEAN +// #define WIN32_LEAN_AND_MEAN 1 +// #endif +// #include +// #endif +// #ifndef APIENTRY +// #define APIENTRY +// #endif +// #ifndef APIENTRYP +// #define APIENTRYP APIENTRY * +// #endif +// #ifndef GLAPI +// #define GLAPI extern +// #endif +// #include +// #ifndef GLEXT_64_TYPES_DEFINED +// /* This code block is duplicated in glxext.h, so must be protected */ +// #define GLEXT_64_TYPES_DEFINED +// /* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +// /* (as used in the GL_EXT_timer_query extension). */ +// #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +// #include +// #elif defined(__sun__) || defined(__digital__) +// #include +// #if defined(__STDC__) +// #if defined(__arch64__) || defined(_LP64) +// typedef long int int64_t; +// typedef unsigned long int uint64_t; +// #else +// typedef long long int int64_t; +// typedef unsigned long long int uint64_t; +// #endif /* __arch64__ */ +// #endif /* __STDC__ */ +// #elif defined( __VMS ) || defined(__sgi) +// #include +// #elif defined(__SCO__) || defined(__USLC__) +// #include +// #elif defined(__UNIXOS2__) || defined(__SOL64__) +// typedef long int int32_t; +// typedef long long int int64_t; +// typedef unsigned long long int uint64_t; +// #elif defined(_WIN32) && defined(__GNUC__) +// #include +// #elif defined(_WIN32) +// typedef __int32 int32_t; +// typedef __int64 int64_t; +// typedef unsigned __int64 uint64_t; +// #else +// /* Fallback if nothing above works */ +// #include +// #endif +// #endif +// typedef unsigned int GLenum; +// typedef unsigned char GLboolean; +// typedef unsigned int GLbitfield; +// typedef signed char GLbyte; +// typedef short GLshort; +// typedef int GLint; +// typedef unsigned char GLubyte; +// typedef unsigned short GLushort; +// typedef unsigned int GLuint; +// typedef int GLsizei; +// typedef float GLfloat; +// typedef double GLdouble; +// typedef char GLchar; +// typedef ptrdiff_t GLintptr; +// typedef ptrdiff_t GLsizeiptr; +// typedef int64_t GLint64; +// typedef uint64_t GLuint64; +// typedef uint64_t GLuint64EXT; +// typedef struct __GLsync *GLsync; +// struct _cl_context; +// struct _cl_event; +// typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +// typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +// typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +// extern void glowDebugCallback_glcore33(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); +// static void APIENTRY glowCDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) { +// glowDebugCallback_glcore33(source, type, id, severity, length, message, userParam); +// } +// typedef void (APIENTRYP GPACTIVESHADERPROGRAM)(GLuint pipeline, GLuint program); +// typedef void (APIENTRYP GPACTIVETEXTURE)(GLenum texture); +// typedef void (APIENTRYP GPATTACHSHADER)(GLuint program, GLuint shader); +// typedef void (APIENTRYP GPBEGINCONDITIONALRENDER)(GLuint id, GLenum mode); +// typedef void (APIENTRYP GPBEGINQUERY)(GLenum target, GLuint id); +// typedef void (APIENTRYP GPBEGINQUERYINDEXED)(GLenum target, GLuint index, GLuint id); +// typedef void (APIENTRYP GPBEGINTRANSFORMFEEDBACK)(GLenum primitiveMode); +// typedef void (APIENTRYP GPBINDATTRIBLOCATION)(GLuint program, GLuint index, const GLchar * name); +// typedef void (APIENTRYP GPBINDBUFFER)(GLenum target, GLuint buffer); +// typedef void (APIENTRYP GPBINDBUFFERBASE)(GLenum target, GLuint index, GLuint buffer); +// typedef void (APIENTRYP GPBINDBUFFERRANGE)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +// typedef void (APIENTRYP GPBINDBUFFERSBASE)(GLenum target, GLuint first, GLsizei count, const GLuint * buffers); +// typedef void (APIENTRYP GPBINDBUFFERSRANGE)(GLenum target, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizeiptr * sizes); +// typedef void (APIENTRYP GPBINDFRAGDATALOCATION)(GLuint program, GLuint color, const GLchar * name); +// typedef void (APIENTRYP GPBINDFRAGDATALOCATIONINDEXED)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +// typedef void (APIENTRYP GPBINDFRAMEBUFFER)(GLenum target, GLuint framebuffer); +// typedef void (APIENTRYP GPBINDIMAGETEXTURE)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +// typedef void (APIENTRYP GPBINDIMAGETEXTURES)(GLuint first, GLsizei count, const GLuint * textures); +// typedef void (APIENTRYP GPBINDPROGRAMPIPELINE)(GLuint pipeline); +// typedef void (APIENTRYP GPBINDRENDERBUFFER)(GLenum target, GLuint renderbuffer); +// typedef void (APIENTRYP GPBINDSAMPLER)(GLuint unit, GLuint sampler); +// typedef void (APIENTRYP GPBINDSAMPLERS)(GLuint first, GLsizei count, const GLuint * samplers); +// typedef void (APIENTRYP GPBINDTEXTURE)(GLenum target, GLuint texture); +// typedef void (APIENTRYP GPBINDTEXTUREUNIT)(GLuint unit, GLuint texture); +// typedef void (APIENTRYP GPBINDTEXTURES)(GLuint first, GLsizei count, const GLuint * textures); +// typedef void (APIENTRYP GPBINDTRANSFORMFEEDBACK)(GLenum target, GLuint id); +// typedef void (APIENTRYP GPBINDVERTEXARRAY)(GLuint array); +// typedef void (APIENTRYP GPBINDVERTEXBUFFER)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +// typedef void (APIENTRYP GPBINDVERTEXBUFFERS)(GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides); +// typedef void (APIENTRYP GPBLENDCOLOR)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +// typedef void (APIENTRYP GPBLENDEQUATION)(GLenum mode); +// typedef void (APIENTRYP GPBLENDEQUATIONSEPARATE)(GLenum modeRGB, GLenum modeAlpha); +// typedef void (APIENTRYP GPBLENDEQUATIONSEPARATEIARB)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); +// typedef void (APIENTRYP GPBLENDEQUATIONIARB)(GLuint buf, GLenum mode); +// typedef void (APIENTRYP GPBLENDFUNC)(GLenum sfactor, GLenum dfactor); +// typedef void (APIENTRYP GPBLENDFUNCSEPARATE)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +// typedef void (APIENTRYP GPBLENDFUNCSEPARATEIARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +// typedef void (APIENTRYP GPBLENDFUNCIARB)(GLuint buf, GLenum src, GLenum dst); +// typedef void (APIENTRYP GPBLITFRAMEBUFFER)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +// typedef void (APIENTRYP GPBLITNAMEDFRAMEBUFFER)(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +// typedef void (APIENTRYP GPBUFFERDATA)(GLenum target, GLsizeiptr size, const void * data, GLenum usage); +// typedef void (APIENTRYP GPBUFFERPAGECOMMITMENTARB)(GLenum target, GLintptr offset, GLsizei size, GLboolean commit); +// typedef void (APIENTRYP GPBUFFERSTORAGE)(GLenum target, GLsizeiptr size, const void * data, GLbitfield flags); +// typedef void (APIENTRYP GPBUFFERSUBDATA)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data); +// typedef GLenum (APIENTRYP GPCHECKFRAMEBUFFERSTATUS)(GLenum target); +// typedef GLenum (APIENTRYP GPCHECKNAMEDFRAMEBUFFERSTATUS)(GLuint framebuffer, GLenum target); +// typedef void (APIENTRYP GPCLAMPCOLOR)(GLenum target, GLenum clamp); +// typedef void (APIENTRYP GPCLEAR)(GLbitfield mask); +// typedef void (APIENTRYP GPCLEARBUFFERDATA)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void * data); +// typedef void (APIENTRYP GPCLEARBUFFERSUBDATA)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data); +// typedef void (APIENTRYP GPCLEARBUFFERFI)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +// typedef void (APIENTRYP GPCLEARBUFFERFV)(GLenum buffer, GLint drawbuffer, const GLfloat * value); +// typedef void (APIENTRYP GPCLEARBUFFERIV)(GLenum buffer, GLint drawbuffer, const GLint * value); +// typedef void (APIENTRYP GPCLEARBUFFERUIV)(GLenum buffer, GLint drawbuffer, const GLuint * value); +// typedef void (APIENTRYP GPCLEARCOLOR)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +// typedef void (APIENTRYP GPCLEARDEPTH)(GLdouble depth); +// typedef void (APIENTRYP GPCLEARDEPTHF)(GLfloat d); +// typedef void (APIENTRYP GPCLEARNAMEDBUFFERDATA)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void * data); +// typedef void (APIENTRYP GPCLEARNAMEDBUFFERSUBDATA)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void * data); +// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERFI)(GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil); +// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERFV)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat * value); +// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERIV)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint * value); +// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERUIV)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint * value); +// typedef void (APIENTRYP GPCLEARSTENCIL)(GLint s); +// typedef void (APIENTRYP GPCLEARTEXIMAGE)(GLuint texture, GLint level, GLenum format, GLenum type, const void * data); +// typedef void (APIENTRYP GPCLEARTEXSUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data); +// typedef GLenum (APIENTRYP GPCLIENTWAITSYNC)(GLsync sync, GLbitfield flags, GLuint64 timeout); +// typedef void (APIENTRYP GPCLIPCONTROL)(GLenum origin, GLenum depth); +// typedef void (APIENTRYP GPCOLORMASK)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +// typedef void (APIENTRYP GPCOLORMASKI)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +// typedef void (APIENTRYP GPCOMPILESHADER)(GLuint shader); +// typedef void (APIENTRYP GPCOMPILESHADERINCLUDEARB)(GLuint shader, GLsizei count, const GLchar *const* path, const GLint * length); +// typedef void (APIENTRYP GPCOMPRESSEDTEXIMAGE1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXIMAGE2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXIMAGE3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXSUBIMAGE1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXSUBIMAGE3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE1D)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data); +// typedef void (APIENTRYP GPCOPYBUFFERSUBDATA)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +// typedef void (APIENTRYP GPCOPYIMAGESUBDATA)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +// typedef void (APIENTRYP GPCOPYNAMEDBUFFERSUBDATA)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size); +// typedef void (APIENTRYP GPCOPYTEXIMAGE1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +// typedef void (APIENTRYP GPCOPYTEXIMAGE2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +// typedef void (APIENTRYP GPCOPYTEXSUBIMAGE1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +// typedef void (APIENTRYP GPCOPYTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPCOPYTEXSUBIMAGE3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE1D)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPCREATEBUFFERS)(GLsizei n, GLuint * buffers); +// typedef void (APIENTRYP GPCREATEFRAMEBUFFERS)(GLsizei n, GLuint * framebuffers); +// typedef GLuint (APIENTRYP GPCREATEPROGRAM)(); +// typedef void (APIENTRYP GPCREATEPROGRAMPIPELINES)(GLsizei n, GLuint * pipelines); +// typedef void (APIENTRYP GPCREATEQUERIES)(GLenum target, GLsizei n, GLuint * ids); +// typedef void (APIENTRYP GPCREATERENDERBUFFERS)(GLsizei n, GLuint * renderbuffers); +// typedef void (APIENTRYP GPCREATESAMPLERS)(GLsizei n, GLuint * samplers); +// typedef GLuint (APIENTRYP GPCREATESHADER)(GLenum type); +// typedef GLuint (APIENTRYP GPCREATESHADERPROGRAMV)(GLenum type, GLsizei count, const GLchar *const* strings); +// typedef GLsync (APIENTRYP GPCREATESYNCFROMCLEVENTARB)(struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +// typedef void (APIENTRYP GPCREATETEXTURES)(GLenum target, GLsizei n, GLuint * textures); +// typedef void (APIENTRYP GPCREATETRANSFORMFEEDBACKS)(GLsizei n, GLuint * ids); +// typedef void (APIENTRYP GPCREATEVERTEXARRAYS)(GLsizei n, GLuint * arrays); +// typedef void (APIENTRYP GPCULLFACE)(GLenum mode); +// typedef void (APIENTRYP GPDEBUGMESSAGECALLBACK)(GLDEBUGPROC callback, const void * userParam); +// typedef void (APIENTRYP GPDEBUGMESSAGECALLBACKARB)(GLDEBUGPROCARB callback, const void * userParam); +// typedef void (APIENTRYP GPDEBUGMESSAGECALLBACKKHR)(GLDEBUGPROCKHR callback, const void * userParam); +// typedef void (APIENTRYP GPDEBUGMESSAGECONTROL)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled); +// typedef void (APIENTRYP GPDEBUGMESSAGECONTROLARB)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled); +// typedef void (APIENTRYP GPDEBUGMESSAGECONTROLKHR)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled); +// typedef void (APIENTRYP GPDEBUGMESSAGEINSERT)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf); +// typedef void (APIENTRYP GPDEBUGMESSAGEINSERTARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf); +// typedef void (APIENTRYP GPDEBUGMESSAGEINSERTKHR)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf); +// typedef void (APIENTRYP GPDELETEBUFFERS)(GLsizei n, const GLuint * buffers); +// typedef void (APIENTRYP GPDELETEFRAMEBUFFERS)(GLsizei n, const GLuint * framebuffers); +// typedef void (APIENTRYP GPDELETENAMEDSTRINGARB)(GLint namelen, const GLchar * name); +// typedef void (APIENTRYP GPDELETEPROGRAM)(GLuint program); +// typedef void (APIENTRYP GPDELETEPROGRAMPIPELINES)(GLsizei n, const GLuint * pipelines); +// typedef void (APIENTRYP GPDELETEQUERIES)(GLsizei n, const GLuint * ids); +// typedef void (APIENTRYP GPDELETERENDERBUFFERS)(GLsizei n, const GLuint * renderbuffers); +// typedef void (APIENTRYP GPDELETESAMPLERS)(GLsizei count, const GLuint * samplers); +// typedef void (APIENTRYP GPDELETESHADER)(GLuint shader); +// typedef void (APIENTRYP GPDELETESYNC)(GLsync sync); +// typedef void (APIENTRYP GPDELETETEXTURES)(GLsizei n, const GLuint * textures); +// typedef void (APIENTRYP GPDELETETRANSFORMFEEDBACKS)(GLsizei n, const GLuint * ids); +// typedef void (APIENTRYP GPDELETEVERTEXARRAYS)(GLsizei n, const GLuint * arrays); +// typedef void (APIENTRYP GPDEPTHFUNC)(GLenum func); +// typedef void (APIENTRYP GPDEPTHMASK)(GLboolean flag); +// typedef void (APIENTRYP GPDEPTHRANGE)(GLdouble xnear, GLdouble xfar); +// typedef void (APIENTRYP GPDEPTHRANGEARRAYV)(GLuint first, GLsizei count, const GLdouble * v); +// typedef void (APIENTRYP GPDEPTHRANGEINDEXED)(GLuint index, GLdouble n, GLdouble f); +// typedef void (APIENTRYP GPDEPTHRANGEF)(GLfloat n, GLfloat f); +// typedef void (APIENTRYP GPDETACHSHADER)(GLuint program, GLuint shader); +// typedef void (APIENTRYP GPDISABLE)(GLenum cap); +// typedef void (APIENTRYP GPDISABLEVERTEXARRAYATTRIB)(GLuint vaobj, GLuint index); +// typedef void (APIENTRYP GPDISABLEVERTEXATTRIBARRAY)(GLuint index); +// typedef void (APIENTRYP GPDISABLEI)(GLenum target, GLuint index); +// typedef void (APIENTRYP GPDISPATCHCOMPUTE)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +// typedef void (APIENTRYP GPDISPATCHCOMPUTEGROUPSIZEARB)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +// typedef void (APIENTRYP GPDISPATCHCOMPUTEINDIRECT)(GLintptr indirect); +// typedef void (APIENTRYP GPDRAWARRAYS)(GLenum mode, GLint first, GLsizei count); +// typedef void (APIENTRYP GPDRAWARRAYSINDIRECT)(GLenum mode, const void * indirect); +// typedef void (APIENTRYP GPDRAWARRAYSINSTANCED)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +// typedef void (APIENTRYP GPDRAWARRAYSINSTANCEDBASEINSTANCE)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +// typedef void (APIENTRYP GPDRAWBUFFER)(GLenum buf); +// typedef void (APIENTRYP GPDRAWBUFFERS)(GLsizei n, const GLenum * bufs); +// typedef void (APIENTRYP GPDRAWELEMENTS)(GLenum mode, GLsizei count, GLenum type, const void * indices); +// typedef void (APIENTRYP GPDRAWELEMENTSBASEVERTEX)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex); +// typedef void (APIENTRYP GPDRAWELEMENTSINDIRECT)(GLenum mode, GLenum type, const void * indirect); +// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCED)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount); +// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDBASEINSTANCE)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLuint baseinstance); +// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDBASEVERTEX)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex); +// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +// typedef void (APIENTRYP GPDRAWRANGEELEMENTS)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices); +// typedef void (APIENTRYP GPDRAWRANGEELEMENTSBASEVERTEX)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex); +// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACK)(GLenum mode, GLuint id); +// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACKINSTANCED)(GLenum mode, GLuint id, GLsizei instancecount); +// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACKSTREAM)(GLenum mode, GLuint id, GLuint stream); +// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +// typedef void (APIENTRYP GPENABLE)(GLenum cap); +// typedef void (APIENTRYP GPENABLEVERTEXARRAYATTRIB)(GLuint vaobj, GLuint index); +// typedef void (APIENTRYP GPENABLEVERTEXATTRIBARRAY)(GLuint index); +// typedef void (APIENTRYP GPENABLEI)(GLenum target, GLuint index); +// typedef void (APIENTRYP GPENDCONDITIONALRENDER)(); +// typedef void (APIENTRYP GPENDQUERY)(GLenum target); +// typedef void (APIENTRYP GPENDQUERYINDEXED)(GLenum target, GLuint index); +// typedef void (APIENTRYP GPENDTRANSFORMFEEDBACK)(); +// typedef GLsync (APIENTRYP GPFENCESYNC)(GLenum condition, GLbitfield flags); +// typedef void (APIENTRYP GPFINISH)(); +// typedef void (APIENTRYP GPFLUSH)(); +// typedef void (APIENTRYP GPFLUSHMAPPEDBUFFERRANGE)(GLenum target, GLintptr offset, GLsizeiptr length); +// typedef void (APIENTRYP GPFLUSHMAPPEDNAMEDBUFFERRANGE)(GLuint buffer, GLintptr offset, GLsizei length); +// typedef void (APIENTRYP GPFRAMEBUFFERPARAMETERI)(GLenum target, GLenum pname, GLint param); +// typedef void (APIENTRYP GPFRAMEBUFFERRENDERBUFFER)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE)(GLenum target, GLenum attachment, GLuint texture, GLint level); +// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURELAYER)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +// typedef void (APIENTRYP GPFRONTFACE)(GLenum mode); +// typedef void (APIENTRYP GPGENBUFFERS)(GLsizei n, GLuint * buffers); +// typedef void (APIENTRYP GPGENFRAMEBUFFERS)(GLsizei n, GLuint * framebuffers); +// typedef void (APIENTRYP GPGENPROGRAMPIPELINES)(GLsizei n, GLuint * pipelines); +// typedef void (APIENTRYP GPGENQUERIES)(GLsizei n, GLuint * ids); +// typedef void (APIENTRYP GPGENRENDERBUFFERS)(GLsizei n, GLuint * renderbuffers); +// typedef void (APIENTRYP GPGENSAMPLERS)(GLsizei count, GLuint * samplers); +// typedef void (APIENTRYP GPGENTEXTURES)(GLsizei n, GLuint * textures); +// typedef void (APIENTRYP GPGENTRANSFORMFEEDBACKS)(GLsizei n, GLuint * ids); +// typedef void (APIENTRYP GPGENVERTEXARRAYS)(GLsizei n, GLuint * arrays); +// typedef void (APIENTRYP GPGENERATEMIPMAP)(GLenum target); +// typedef void (APIENTRYP GPGENERATETEXTUREMIPMAP)(GLuint texture); +// typedef void (APIENTRYP GPGETACTIVEATOMICCOUNTERBUFFERIV)(GLuint program, GLuint bufferIndex, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETACTIVEATTRIB)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); +// typedef void (APIENTRYP GPGETACTIVESUBROUTINENAME)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name); +// typedef void (APIENTRYP GPGETACTIVESUBROUTINEUNIFORMNAME)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name); +// typedef void (APIENTRYP GPGETACTIVESUBROUTINEUNIFORMIV)(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values); +// typedef void (APIENTRYP GPGETACTIVEUNIFORM)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); +// typedef void (APIENTRYP GPGETACTIVEUNIFORMBLOCKNAME)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName); +// typedef void (APIENTRYP GPGETACTIVEUNIFORMBLOCKIV)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETACTIVEUNIFORMNAME)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName); +// typedef void (APIENTRYP GPGETACTIVEUNIFORMSIV)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETATTACHEDSHADERS)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); +// typedef GLint (APIENTRYP GPGETATTRIBLOCATION)(GLuint program, const GLchar * name); +// typedef void (APIENTRYP GPGETBOOLEANI_V)(GLenum target, GLuint index, GLboolean * data); +// typedef void (APIENTRYP GPGETBOOLEANV)(GLenum pname, GLboolean * data); +// typedef void (APIENTRYP GPGETBUFFERPARAMETERI64V)(GLenum target, GLenum pname, GLint64 * params); +// typedef void (APIENTRYP GPGETBUFFERPARAMETERIV)(GLenum target, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETBUFFERPOINTERV)(GLenum target, GLenum pname, void ** params); +// typedef void (APIENTRYP GPGETBUFFERSUBDATA)(GLenum target, GLintptr offset, GLsizeiptr size, void * data); +// typedef void (APIENTRYP GPGETCOMPRESSEDTEXIMAGE)(GLenum target, GLint level, void * img); +// typedef void (APIENTRYP GPGETCOMPRESSEDTEXTUREIMAGE)(GLuint texture, GLint level, GLsizei bufSize, void * pixels); +// typedef void (APIENTRYP GPGETCOMPRESSEDTEXTURESUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void * pixels); +// typedef GLuint (APIENTRYP GPGETDEBUGMESSAGELOG)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog); +// typedef GLuint (APIENTRYP GPGETDEBUGMESSAGELOGARB)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog); +// typedef GLuint (APIENTRYP GPGETDEBUGMESSAGELOGKHR)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog); +// typedef void (APIENTRYP GPGETDOUBLEI_V)(GLenum target, GLuint index, GLdouble * data); +// typedef void (APIENTRYP GPGETDOUBLEV)(GLenum pname, GLdouble * data); +// typedef GLenum (APIENTRYP GPGETERROR)(); +// typedef void (APIENTRYP GPGETFLOATI_V)(GLenum target, GLuint index, GLfloat * data); +// typedef void (APIENTRYP GPGETFLOATV)(GLenum pname, GLfloat * data); +// typedef GLint (APIENTRYP GPGETFRAGDATAINDEX)(GLuint program, const GLchar * name); +// typedef GLint (APIENTRYP GPGETFRAGDATALOCATION)(GLuint program, const GLchar * name); +// typedef void (APIENTRYP GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(GLenum target, GLenum attachment, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETFRAMEBUFFERPARAMETERIV)(GLenum target, GLenum pname, GLint * params); +// typedef GLenum (APIENTRYP GPGETGRAPHICSRESETSTATUS)(); +// typedef GLenum (APIENTRYP GPGETGRAPHICSRESETSTATUSARB)(); +// typedef GLenum (APIENTRYP GPGETGRAPHICSRESETSTATUSKHR)(); +// typedef GLuint64 (APIENTRYP GPGETIMAGEHANDLEARB)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +// typedef void (APIENTRYP GPGETINTEGER64I_V)(GLenum target, GLuint index, GLint64 * data); +// typedef void (APIENTRYP GPGETINTEGER64V)(GLenum pname, GLint64 * data); +// typedef void (APIENTRYP GPGETINTEGERI_V)(GLenum target, GLuint index, GLint * data); +// typedef void (APIENTRYP GPGETINTEGERV)(GLenum pname, GLint * data); +// typedef void (APIENTRYP GPGETINTERNALFORMATI64V)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 * params); +// typedef void (APIENTRYP GPGETINTERNALFORMATIV)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params); +// typedef void (APIENTRYP GPGETMULTISAMPLEFV)(GLenum pname, GLuint index, GLfloat * val); +// typedef void (APIENTRYP GPGETNAMEDBUFFERPARAMETERI64V)(GLuint buffer, GLenum pname, GLint64 * params); +// typedef void (APIENTRYP GPGETNAMEDBUFFERPARAMETERIV)(GLuint buffer, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETNAMEDBUFFERPOINTERV)(GLuint buffer, GLenum pname, void ** params); +// typedef void (APIENTRYP GPGETNAMEDBUFFERSUBDATA)(GLuint buffer, GLintptr offset, GLsizei size, void * data); +// typedef void (APIENTRYP GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETNAMEDFRAMEBUFFERPARAMETERIV)(GLuint framebuffer, GLenum pname, GLint * param); +// typedef void (APIENTRYP GPGETNAMEDRENDERBUFFERPARAMETERIV)(GLuint renderbuffer, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETNAMEDSTRINGARB)(GLint namelen, const GLchar * name, GLsizei bufSize, GLint * stringlen, GLchar * string); +// typedef void (APIENTRYP GPGETNAMEDSTRINGIVARB)(GLint namelen, const GLchar * name, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETOBJECTLABEL)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label); +// typedef void (APIENTRYP GPGETOBJECTLABELKHR)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label); +// typedef void (APIENTRYP GPGETOBJECTPTRLABEL)(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label); +// typedef void (APIENTRYP GPGETOBJECTPTRLABELKHR)(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label); +// typedef void (APIENTRYP GPGETPOINTERV)(GLenum pname, void ** params); +// typedef void (APIENTRYP GPGETPOINTERVKHR)(GLenum pname, void ** params); +// typedef void (APIENTRYP GPGETPROGRAMBINARY)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary); +// typedef void (APIENTRYP GPGETPROGRAMINFOLOG)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +// typedef void (APIENTRYP GPGETPROGRAMINTERFACEIV)(GLuint program, GLenum programInterface, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETPROGRAMPIPELINEINFOLOG)(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +// typedef void (APIENTRYP GPGETPROGRAMPIPELINEIV)(GLuint pipeline, GLenum pname, GLint * params); +// typedef GLuint (APIENTRYP GPGETPROGRAMRESOURCEINDEX)(GLuint program, GLenum programInterface, const GLchar * name); +// typedef GLint (APIENTRYP GPGETPROGRAMRESOURCELOCATION)(GLuint program, GLenum programInterface, const GLchar * name); +// typedef GLint (APIENTRYP GPGETPROGRAMRESOURCELOCATIONINDEX)(GLuint program, GLenum programInterface, const GLchar * name); +// typedef void (APIENTRYP GPGETPROGRAMRESOURCENAME)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name); +// typedef void (APIENTRYP GPGETPROGRAMRESOURCEIV)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params); +// typedef void (APIENTRYP GPGETPROGRAMSTAGEIV)(GLuint program, GLenum shadertype, GLenum pname, GLint * values); +// typedef void (APIENTRYP GPGETPROGRAMIV)(GLuint program, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETQUERYINDEXEDIV)(GLenum target, GLuint index, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETQUERYOBJECTI64V)(GLuint id, GLenum pname, GLint64 * params); +// typedef void (APIENTRYP GPGETQUERYOBJECTIV)(GLuint id, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETQUERYOBJECTUI64V)(GLuint id, GLenum pname, GLuint64 * params); +// typedef void (APIENTRYP GPGETQUERYOBJECTUIV)(GLuint id, GLenum pname, GLuint * params); +// typedef void (APIENTRYP GPGETQUERYIV)(GLenum target, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETRENDERBUFFERPARAMETERIV)(GLenum target, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETSAMPLERPARAMETERIIV)(GLuint sampler, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETSAMPLERPARAMETERIUIV)(GLuint sampler, GLenum pname, GLuint * params); +// typedef void (APIENTRYP GPGETSAMPLERPARAMETERFV)(GLuint sampler, GLenum pname, GLfloat * params); +// typedef void (APIENTRYP GPGETSAMPLERPARAMETERIV)(GLuint sampler, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETSHADERINFOLOG)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +// typedef void (APIENTRYP GPGETSHADERPRECISIONFORMAT)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); +// typedef void (APIENTRYP GPGETSHADERSOURCE)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); +// typedef void (APIENTRYP GPGETSHADERIV)(GLuint shader, GLenum pname, GLint * params); +// typedef const GLubyte * (APIENTRYP GPGETSTRING)(GLenum name); +// typedef const GLubyte * (APIENTRYP GPGETSTRINGI)(GLenum name, GLuint index); +// typedef GLuint (APIENTRYP GPGETSUBROUTINEINDEX)(GLuint program, GLenum shadertype, const GLchar * name); +// typedef GLint (APIENTRYP GPGETSUBROUTINEUNIFORMLOCATION)(GLuint program, GLenum shadertype, const GLchar * name); +// typedef void (APIENTRYP GPGETSYNCIV)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values); +// typedef void (APIENTRYP GPGETTEXIMAGE)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels); +// typedef void (APIENTRYP GPGETTEXLEVELPARAMETERFV)(GLenum target, GLint level, GLenum pname, GLfloat * params); +// typedef void (APIENTRYP GPGETTEXLEVELPARAMETERIV)(GLenum target, GLint level, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETTEXPARAMETERIIV)(GLenum target, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETTEXPARAMETERIUIV)(GLenum target, GLenum pname, GLuint * params); +// typedef void (APIENTRYP GPGETTEXPARAMETERFV)(GLenum target, GLenum pname, GLfloat * params); +// typedef void (APIENTRYP GPGETTEXPARAMETERIV)(GLenum target, GLenum pname, GLint * params); +// typedef GLuint64 (APIENTRYP GPGETTEXTUREHANDLEARB)(GLuint texture); +// typedef void (APIENTRYP GPGETTEXTUREIMAGE)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * pixels); +// typedef void (APIENTRYP GPGETTEXTURELEVELPARAMETERFV)(GLuint texture, GLint level, GLenum pname, GLfloat * params); +// typedef void (APIENTRYP GPGETTEXTURELEVELPARAMETERIV)(GLuint texture, GLint level, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIIV)(GLuint texture, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIUIV)(GLuint texture, GLenum pname, GLuint * params); +// typedef void (APIENTRYP GPGETTEXTUREPARAMETERFV)(GLuint texture, GLenum pname, GLfloat * params); +// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIV)(GLuint texture, GLenum pname, GLint * params); +// typedef GLuint64 (APIENTRYP GPGETTEXTURESAMPLERHANDLEARB)(GLuint texture, GLuint sampler); +// typedef void (APIENTRYP GPGETTEXTURESUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void * pixels); +// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKVARYING)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKI64_V)(GLuint xfb, GLenum pname, GLuint index, GLint64 * param); +// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKI_V)(GLuint xfb, GLenum pname, GLuint index, GLint * param); +// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKIV)(GLuint xfb, GLenum pname, GLint * param); +// typedef GLuint (APIENTRYP GPGETUNIFORMBLOCKINDEX)(GLuint program, const GLchar * uniformBlockName); +// typedef void (APIENTRYP GPGETUNIFORMINDICES)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices); +// typedef GLint (APIENTRYP GPGETUNIFORMLOCATION)(GLuint program, const GLchar * name); +// typedef void (APIENTRYP GPGETUNIFORMSUBROUTINEUIV)(GLenum shadertype, GLint location, GLuint * params); +// typedef void (APIENTRYP GPGETUNIFORMDV)(GLuint program, GLint location, GLdouble * params); +// typedef void (APIENTRYP GPGETUNIFORMFV)(GLuint program, GLint location, GLfloat * params); +// typedef void (APIENTRYP GPGETUNIFORMIV)(GLuint program, GLint location, GLint * params); +// typedef void (APIENTRYP GPGETUNIFORMUIV)(GLuint program, GLint location, GLuint * params); +// typedef void (APIENTRYP GPGETVERTEXARRAYINDEXED64IV)(GLuint vaobj, GLuint index, GLenum pname, GLint64 * param); +// typedef void (APIENTRYP GPGETVERTEXARRAYINDEXEDIV)(GLuint vaobj, GLuint index, GLenum pname, GLint * param); +// typedef void (APIENTRYP GPGETVERTEXARRAYIV)(GLuint vaobj, GLenum pname, GLint * param); +// typedef void (APIENTRYP GPGETVERTEXATTRIBIIV)(GLuint index, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETVERTEXATTRIBIUIV)(GLuint index, GLenum pname, GLuint * params); +// typedef void (APIENTRYP GPGETVERTEXATTRIBLDV)(GLuint index, GLenum pname, GLdouble * params); +// typedef void (APIENTRYP GPGETVERTEXATTRIBLUI64VARB)(GLuint index, GLenum pname, GLuint64EXT * params); +// typedef void (APIENTRYP GPGETVERTEXATTRIBPOINTERV)(GLuint index, GLenum pname, void ** pointer); +// typedef void (APIENTRYP GPGETVERTEXATTRIBDV)(GLuint index, GLenum pname, GLdouble * params); +// typedef void (APIENTRYP GPGETVERTEXATTRIBFV)(GLuint index, GLenum pname, GLfloat * params); +// typedef void (APIENTRYP GPGETVERTEXATTRIBIV)(GLuint index, GLenum pname, GLint * params); +// typedef void (APIENTRYP GPGETNCOMPRESSEDTEXIMAGEARB)(GLenum target, GLint lod, GLsizei bufSize, void * img); +// typedef void (APIENTRYP GPGETNTEXIMAGEARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * img); +// typedef void (APIENTRYP GPGETNUNIFORMDVARB)(GLuint program, GLint location, GLsizei bufSize, GLdouble * params); +// typedef void (APIENTRYP GPGETNUNIFORMFV)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params); +// typedef void (APIENTRYP GPGETNUNIFORMFVARB)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params); +// typedef void (APIENTRYP GPGETNUNIFORMFVKHR)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params); +// typedef void (APIENTRYP GPGETNUNIFORMIV)(GLuint program, GLint location, GLsizei bufSize, GLint * params); +// typedef void (APIENTRYP GPGETNUNIFORMIVARB)(GLuint program, GLint location, GLsizei bufSize, GLint * params); +// typedef void (APIENTRYP GPGETNUNIFORMIVKHR)(GLuint program, GLint location, GLsizei bufSize, GLint * params); +// typedef void (APIENTRYP GPGETNUNIFORMUIV)(GLuint program, GLint location, GLsizei bufSize, GLuint * params); +// typedef void (APIENTRYP GPGETNUNIFORMUIVARB)(GLuint program, GLint location, GLsizei bufSize, GLuint * params); +// typedef void (APIENTRYP GPGETNUNIFORMUIVKHR)(GLuint program, GLint location, GLsizei bufSize, GLuint * params); +// typedef void (APIENTRYP GPHINT)(GLenum target, GLenum mode); +// typedef void (APIENTRYP GPINVALIDATEBUFFERDATA)(GLuint buffer); +// typedef void (APIENTRYP GPINVALIDATEBUFFERSUBDATA)(GLuint buffer, GLintptr offset, GLsizeiptr length); +// typedef void (APIENTRYP GPINVALIDATEFRAMEBUFFER)(GLenum target, GLsizei numAttachments, const GLenum * attachments); +// typedef void (APIENTRYP GPINVALIDATENAMEDFRAMEBUFFERDATA)(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments); +// typedef void (APIENTRYP GPINVALIDATENAMEDFRAMEBUFFERSUBDATA)(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPINVALIDATESUBFRAMEBUFFER)(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPINVALIDATETEXIMAGE)(GLuint texture, GLint level); +// typedef void (APIENTRYP GPINVALIDATETEXSUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +// typedef GLboolean (APIENTRYP GPISBUFFER)(GLuint buffer); +// typedef GLboolean (APIENTRYP GPISENABLED)(GLenum cap); +// typedef GLboolean (APIENTRYP GPISENABLEDI)(GLenum target, GLuint index); +// typedef GLboolean (APIENTRYP GPISFRAMEBUFFER)(GLuint framebuffer); +// typedef GLboolean (APIENTRYP GPISIMAGEHANDLERESIDENTARB)(GLuint64 handle); +// typedef GLboolean (APIENTRYP GPISNAMEDSTRINGARB)(GLint namelen, const GLchar * name); +// typedef GLboolean (APIENTRYP GPISPROGRAM)(GLuint program); +// typedef GLboolean (APIENTRYP GPISPROGRAMPIPELINE)(GLuint pipeline); +// typedef GLboolean (APIENTRYP GPISQUERY)(GLuint id); +// typedef GLboolean (APIENTRYP GPISRENDERBUFFER)(GLuint renderbuffer); +// typedef GLboolean (APIENTRYP GPISSAMPLER)(GLuint sampler); +// typedef GLboolean (APIENTRYP GPISSHADER)(GLuint shader); +// typedef GLboolean (APIENTRYP GPISSYNC)(GLsync sync); +// typedef GLboolean (APIENTRYP GPISTEXTURE)(GLuint texture); +// typedef GLboolean (APIENTRYP GPISTEXTUREHANDLERESIDENTARB)(GLuint64 handle); +// typedef GLboolean (APIENTRYP GPISTRANSFORMFEEDBACK)(GLuint id); +// typedef GLboolean (APIENTRYP GPISVERTEXARRAY)(GLuint array); +// typedef void (APIENTRYP GPLINEWIDTH)(GLfloat width); +// typedef void (APIENTRYP GPLINKPROGRAM)(GLuint program); +// typedef void (APIENTRYP GPLOGICOP)(GLenum opcode); +// typedef void (APIENTRYP GPMAKEIMAGEHANDLENONRESIDENTARB)(GLuint64 handle); +// typedef void (APIENTRYP GPMAKEIMAGEHANDLERESIDENTARB)(GLuint64 handle, GLenum access); +// typedef void (APIENTRYP GPMAKETEXTUREHANDLENONRESIDENTARB)(GLuint64 handle); +// typedef void (APIENTRYP GPMAKETEXTUREHANDLERESIDENTARB)(GLuint64 handle); +// typedef void * (APIENTRYP GPMAPBUFFER)(GLenum target, GLenum access); +// typedef void * (APIENTRYP GPMAPBUFFERRANGE)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +// typedef void * (APIENTRYP GPMAPNAMEDBUFFER)(GLuint buffer, GLenum access); +// typedef void * (APIENTRYP GPMAPNAMEDBUFFERRANGE)(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access); +// typedef void (APIENTRYP GPMEMORYBARRIER)(GLbitfield barriers); +// typedef void (APIENTRYP GPMEMORYBARRIERBYREGION)(GLbitfield barriers); +// typedef void (APIENTRYP GPMINSAMPLESHADINGARB)(GLfloat value); +// typedef void (APIENTRYP GPMULTIDRAWARRAYS)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount); +// typedef void (APIENTRYP GPMULTIDRAWARRAYSINDIRECT)(GLenum mode, const void * indirect, GLsizei drawcount, GLsizei stride); +// typedef void (APIENTRYP GPMULTIDRAWARRAYSINDIRECTCOUNTARB)(GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +// typedef void (APIENTRYP GPMULTIDRAWELEMENTS)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount); +// typedef void (APIENTRYP GPMULTIDRAWELEMENTSBASEVERTEX)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex); +// typedef void (APIENTRYP GPMULTIDRAWELEMENTSINDIRECT)(GLenum mode, GLenum type, const void * indirect, GLsizei drawcount, GLsizei stride); +// typedef void (APIENTRYP GPMULTIDRAWELEMENTSINDIRECTCOUNTARB)(GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +// typedef void (APIENTRYP GPNAMEDBUFFERDATA)(GLuint buffer, GLsizei size, const void * data, GLenum usage); +// typedef void (APIENTRYP GPNAMEDBUFFERPAGECOMMITMENTARB)(GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit); +// typedef void (APIENTRYP GPNAMEDBUFFERPAGECOMMITMENTEXT)(GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit); +// typedef void (APIENTRYP GPNAMEDBUFFERSTORAGE)(GLuint buffer, GLsizei size, const void * data, GLbitfield flags); +// typedef void (APIENTRYP GPNAMEDBUFFERSUBDATA)(GLuint buffer, GLintptr offset, GLsizei size, const void * data); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERDRAWBUFFER)(GLuint framebuffer, GLenum buf); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERDRAWBUFFERS)(GLuint framebuffer, GLsizei n, const GLenum * bufs); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERPARAMETERI)(GLuint framebuffer, GLenum pname, GLint param); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERREADBUFFER)(GLuint framebuffer, GLenum src); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERRENDERBUFFER)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURE)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURELAYER)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGE)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPNAMEDSTRINGARB)(GLenum type, GLint namelen, const GLchar * name, GLint stringlen, const GLchar * string); +// typedef void (APIENTRYP GPOBJECTLABEL)(GLenum identifier, GLuint name, GLsizei length, const GLchar * label); +// typedef void (APIENTRYP GPOBJECTLABELKHR)(GLenum identifier, GLuint name, GLsizei length, const GLchar * label); +// typedef void (APIENTRYP GPOBJECTPTRLABEL)(const void * ptr, GLsizei length, const GLchar * label); +// typedef void (APIENTRYP GPOBJECTPTRLABELKHR)(const void * ptr, GLsizei length, const GLchar * label); +// typedef void (APIENTRYP GPPATCHPARAMETERFV)(GLenum pname, const GLfloat * values); +// typedef void (APIENTRYP GPPATCHPARAMETERI)(GLenum pname, GLint value); +// typedef void (APIENTRYP GPPAUSETRANSFORMFEEDBACK)(); +// typedef void (APIENTRYP GPPIXELSTOREF)(GLenum pname, GLfloat param); +// typedef void (APIENTRYP GPPIXELSTOREI)(GLenum pname, GLint param); +// typedef void (APIENTRYP GPPOINTPARAMETERF)(GLenum pname, GLfloat param); +// typedef void (APIENTRYP GPPOINTPARAMETERFV)(GLenum pname, const GLfloat * params); +// typedef void (APIENTRYP GPPOINTPARAMETERI)(GLenum pname, GLint param); +// typedef void (APIENTRYP GPPOINTPARAMETERIV)(GLenum pname, const GLint * params); +// typedef void (APIENTRYP GPPOINTSIZE)(GLfloat size); +// typedef void (APIENTRYP GPPOLYGONMODE)(GLenum face, GLenum mode); +// typedef void (APIENTRYP GPPOLYGONOFFSET)(GLfloat factor, GLfloat units); +// typedef void (APIENTRYP GPPOPDEBUGGROUP)(); +// typedef void (APIENTRYP GPPOPDEBUGGROUPKHR)(); +// typedef void (APIENTRYP GPPRIMITIVERESTARTINDEX)(GLuint index); +// typedef void (APIENTRYP GPPROGRAMBINARY)(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length); +// typedef void (APIENTRYP GPPROGRAMPARAMETERI)(GLuint program, GLenum pname, GLint value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1D)(GLuint program, GLint location, GLdouble v0); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1F)(GLuint program, GLint location, GLfloat v0); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1I)(GLuint program, GLint location, GLint v0); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1IV)(GLuint program, GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1UI)(GLuint program, GLint location, GLuint v0); +// typedef void (APIENTRYP GPPROGRAMUNIFORM1UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2D)(GLuint program, GLint location, GLdouble v0, GLdouble v1); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2F)(GLuint program, GLint location, GLfloat v0, GLfloat v1); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2I)(GLuint program, GLint location, GLint v0, GLint v1); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2IV)(GLuint program, GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2UI)(GLuint program, GLint location, GLuint v0, GLuint v1); +// typedef void (APIENTRYP GPPROGRAMUNIFORM2UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3D)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3F)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3I)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3IV)(GLuint program, GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3UI)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +// typedef void (APIENTRYP GPPROGRAMUNIFORM3UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4D)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4F)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4I)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4IV)(GLuint program, GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4UI)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +// typedef void (APIENTRYP GPPROGRAMUNIFORM4UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMHANDLEUI64ARB)(GLuint program, GLint location, GLuint64 value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMHANDLEUI64VARB)(GLuint program, GLint location, GLsizei count, const GLuint64 * values); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X3DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X3FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X4DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X4FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X2DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X2FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X4DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X4FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X2DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X2FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X3DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X3FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPPROVOKINGVERTEX)(GLenum mode); +// typedef void (APIENTRYP GPPUSHDEBUGGROUP)(GLenum source, GLuint id, GLsizei length, const GLchar * message); +// typedef void (APIENTRYP GPPUSHDEBUGGROUPKHR)(GLenum source, GLuint id, GLsizei length, const GLchar * message); +// typedef void (APIENTRYP GPQUERYCOUNTER)(GLuint id, GLenum target); +// typedef void (APIENTRYP GPREADBUFFER)(GLenum src); +// typedef void (APIENTRYP GPREADPIXELS)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels); +// typedef void (APIENTRYP GPREADNPIXELS)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data); +// typedef void (APIENTRYP GPREADNPIXELSARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data); +// typedef void (APIENTRYP GPREADNPIXELSKHR)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data); +// typedef void (APIENTRYP GPRELEASESHADERCOMPILER)(); +// typedef void (APIENTRYP GPRENDERBUFFERSTORAGE)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPRENDERBUFFERSTORAGEMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPRESUMETRANSFORMFEEDBACK)(); +// typedef void (APIENTRYP GPSAMPLECOVERAGE)(GLfloat value, GLboolean invert); +// typedef void (APIENTRYP GPSAMPLEMASKI)(GLuint maskNumber, GLbitfield mask); +// typedef void (APIENTRYP GPSAMPLERPARAMETERIIV)(GLuint sampler, GLenum pname, const GLint * param); +// typedef void (APIENTRYP GPSAMPLERPARAMETERIUIV)(GLuint sampler, GLenum pname, const GLuint * param); +// typedef void (APIENTRYP GPSAMPLERPARAMETERF)(GLuint sampler, GLenum pname, GLfloat param); +// typedef void (APIENTRYP GPSAMPLERPARAMETERFV)(GLuint sampler, GLenum pname, const GLfloat * param); +// typedef void (APIENTRYP GPSAMPLERPARAMETERI)(GLuint sampler, GLenum pname, GLint param); +// typedef void (APIENTRYP GPSAMPLERPARAMETERIV)(GLuint sampler, GLenum pname, const GLint * param); +// typedef void (APIENTRYP GPSCISSOR)(GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPSCISSORARRAYV)(GLuint first, GLsizei count, const GLint * v); +// typedef void (APIENTRYP GPSCISSORINDEXED)(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPSCISSORINDEXEDV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPSHADERBINARY)(GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length); +// typedef void (APIENTRYP GPSHADERSOURCE)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length); +// typedef void (APIENTRYP GPSHADERSTORAGEBLOCKBINDING)(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +// typedef void (APIENTRYP GPSTENCILFUNC)(GLenum func, GLint ref, GLuint mask); +// typedef void (APIENTRYP GPSTENCILFUNCSEPARATE)(GLenum face, GLenum func, GLint ref, GLuint mask); +// typedef void (APIENTRYP GPSTENCILMASK)(GLuint mask); +// typedef void (APIENTRYP GPSTENCILMASKSEPARATE)(GLenum face, GLuint mask); +// typedef void (APIENTRYP GPSTENCILOP)(GLenum fail, GLenum zfail, GLenum zpass); +// typedef void (APIENTRYP GPSTENCILOPSEPARATE)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +// typedef void (APIENTRYP GPTEXBUFFER)(GLenum target, GLenum internalformat, GLuint buffer); +// typedef void (APIENTRYP GPTEXBUFFERRANGE)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +// typedef void (APIENTRYP GPTEXIMAGE1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXIMAGE2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXIMAGE2DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +// typedef void (APIENTRYP GPTEXIMAGE3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXIMAGE3DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +// typedef void (APIENTRYP GPTEXPAGECOMMITMENTARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); +// typedef void (APIENTRYP GPTEXPARAMETERIIV)(GLenum target, GLenum pname, const GLint * params); +// typedef void (APIENTRYP GPTEXPARAMETERIUIV)(GLenum target, GLenum pname, const GLuint * params); +// typedef void (APIENTRYP GPTEXPARAMETERF)(GLenum target, GLenum pname, GLfloat param); +// typedef void (APIENTRYP GPTEXPARAMETERFV)(GLenum target, GLenum pname, const GLfloat * params); +// typedef void (APIENTRYP GPTEXPARAMETERI)(GLenum target, GLenum pname, GLint param); +// typedef void (APIENTRYP GPTEXPARAMETERIV)(GLenum target, GLenum pname, const GLint * params); +// typedef void (APIENTRYP GPTEXSTORAGE1D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +// typedef void (APIENTRYP GPTEXSTORAGE2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPTEXSTORAGE2DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +// typedef void (APIENTRYP GPTEXSTORAGE3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +// typedef void (APIENTRYP GPTEXSTORAGE3DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +// typedef void (APIENTRYP GPTEXSUBIMAGE1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXSUBIMAGE3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXTUREBARRIER)(); +// typedef void (APIENTRYP GPTEXTUREBUFFER)(GLuint texture, GLenum internalformat, GLuint buffer); +// typedef void (APIENTRYP GPTEXTUREBUFFERRANGE)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size); +// typedef void (APIENTRYP GPTEXTUREPARAMETERIIV)(GLuint texture, GLenum pname, const GLint * params); +// typedef void (APIENTRYP GPTEXTUREPARAMETERIUIV)(GLuint texture, GLenum pname, const GLuint * params); +// typedef void (APIENTRYP GPTEXTUREPARAMETERF)(GLuint texture, GLenum pname, GLfloat param); +// typedef void (APIENTRYP GPTEXTUREPARAMETERFV)(GLuint texture, GLenum pname, const GLfloat * param); +// typedef void (APIENTRYP GPTEXTUREPARAMETERI)(GLuint texture, GLenum pname, GLint param); +// typedef void (APIENTRYP GPTEXTUREPARAMETERIV)(GLuint texture, GLenum pname, const GLint * param); +// typedef void (APIENTRYP GPTEXTURESTORAGE1D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +// typedef void (APIENTRYP GPTEXTURESTORAGE2D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPTEXTURESTORAGE2DMULTISAMPLE)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +// typedef void (APIENTRYP GPTEXTURESTORAGE3D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +// typedef void (APIENTRYP GPTEXTURESTORAGE3DMULTISAMPLE)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +// typedef void (APIENTRYP GPTEXTURESUBIMAGE1D)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXTURESUBIMAGE2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXTURESUBIMAGE3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels); +// typedef void (APIENTRYP GPTEXTUREVIEW)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +// typedef void (APIENTRYP GPTRANSFORMFEEDBACKBUFFERBASE)(GLuint xfb, GLuint index, GLuint buffer); +// typedef void (APIENTRYP GPTRANSFORMFEEDBACKBUFFERRANGE)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size); +// typedef void (APIENTRYP GPTRANSFORMFEEDBACKVARYINGS)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); +// typedef void (APIENTRYP GPUNIFORM1D)(GLint location, GLdouble x); +// typedef void (APIENTRYP GPUNIFORM1DV)(GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORM1F)(GLint location, GLfloat v0); +// typedef void (APIENTRYP GPUNIFORM1FV)(GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORM1I)(GLint location, GLint v0); +// typedef void (APIENTRYP GPUNIFORM1IV)(GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPUNIFORM1UI)(GLint location, GLuint v0); +// typedef void (APIENTRYP GPUNIFORM1UIV)(GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPUNIFORM2D)(GLint location, GLdouble x, GLdouble y); +// typedef void (APIENTRYP GPUNIFORM2DV)(GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORM2F)(GLint location, GLfloat v0, GLfloat v1); +// typedef void (APIENTRYP GPUNIFORM2FV)(GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORM2I)(GLint location, GLint v0, GLint v1); +// typedef void (APIENTRYP GPUNIFORM2IV)(GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPUNIFORM2UI)(GLint location, GLuint v0, GLuint v1); +// typedef void (APIENTRYP GPUNIFORM2UIV)(GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPUNIFORM3D)(GLint location, GLdouble x, GLdouble y, GLdouble z); +// typedef void (APIENTRYP GPUNIFORM3DV)(GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORM3F)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +// typedef void (APIENTRYP GPUNIFORM3FV)(GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORM3I)(GLint location, GLint v0, GLint v1, GLint v2); +// typedef void (APIENTRYP GPUNIFORM3IV)(GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPUNIFORM3UI)(GLint location, GLuint v0, GLuint v1, GLuint v2); +// typedef void (APIENTRYP GPUNIFORM3UIV)(GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPUNIFORM4D)(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +// typedef void (APIENTRYP GPUNIFORM4DV)(GLint location, GLsizei count, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORM4F)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +// typedef void (APIENTRYP GPUNIFORM4FV)(GLint location, GLsizei count, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +// typedef void (APIENTRYP GPUNIFORM4IV)(GLint location, GLsizei count, const GLint * value); +// typedef void (APIENTRYP GPUNIFORM4UI)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +// typedef void (APIENTRYP GPUNIFORM4UIV)(GLint location, GLsizei count, const GLuint * value); +// typedef void (APIENTRYP GPUNIFORMBLOCKBINDING)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +// typedef void (APIENTRYP GPUNIFORMHANDLEUI64ARB)(GLint location, GLuint64 value); +// typedef void (APIENTRYP GPUNIFORMHANDLEUI64VARB)(GLint location, GLsizei count, const GLuint64 * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX2DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX2X3DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX2X3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX2X4DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX2X4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX3DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX3X2DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX3X2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX3X4DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX3X4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX4DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX4X2DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX4X2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX4X3DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value); +// typedef void (APIENTRYP GPUNIFORMMATRIX4X3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +// typedef void (APIENTRYP GPUNIFORMSUBROUTINESUIV)(GLenum shadertype, GLsizei count, const GLuint * indices); +// typedef GLboolean (APIENTRYP GPUNMAPBUFFER)(GLenum target); +// typedef GLboolean (APIENTRYP GPUNMAPNAMEDBUFFER)(GLuint buffer); +// typedef void (APIENTRYP GPUSEPROGRAM)(GLuint program); +// typedef void (APIENTRYP GPUSEPROGRAMSTAGES)(GLuint pipeline, GLbitfield stages, GLuint program); +// typedef void (APIENTRYP GPVALIDATEPROGRAM)(GLuint program); +// typedef void (APIENTRYP GPVALIDATEPROGRAMPIPELINE)(GLuint pipeline); +// typedef void (APIENTRYP GPVERTEXARRAYATTRIBBINDING)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); +// typedef void (APIENTRYP GPVERTEXARRAYATTRIBFORMAT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +// typedef void (APIENTRYP GPVERTEXARRAYATTRIBIFORMAT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +// typedef void (APIENTRYP GPVERTEXARRAYATTRIBLFORMAT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +// typedef void (APIENTRYP GPVERTEXARRAYBINDINGDIVISOR)(GLuint vaobj, GLuint bindingindex, GLuint divisor); +// typedef void (APIENTRYP GPVERTEXARRAYELEMENTBUFFER)(GLuint vaobj, GLuint buffer); +// typedef void (APIENTRYP GPVERTEXARRAYVERTEXBUFFER)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +// typedef void (APIENTRYP GPVERTEXARRAYVERTEXBUFFERS)(GLuint vaobj, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides); +// typedef void (APIENTRYP GPVERTEXATTRIB1D)(GLuint index, GLdouble x); +// typedef void (APIENTRYP GPVERTEXATTRIB1DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIB1F)(GLuint index, GLfloat x); +// typedef void (APIENTRYP GPVERTEXATTRIB1FV)(GLuint index, const GLfloat * v); +// typedef void (APIENTRYP GPVERTEXATTRIB1S)(GLuint index, GLshort x); +// typedef void (APIENTRYP GPVERTEXATTRIB1SV)(GLuint index, const GLshort * v); +// typedef void (APIENTRYP GPVERTEXATTRIB2D)(GLuint index, GLdouble x, GLdouble y); +// typedef void (APIENTRYP GPVERTEXATTRIB2DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIB2F)(GLuint index, GLfloat x, GLfloat y); +// typedef void (APIENTRYP GPVERTEXATTRIB2FV)(GLuint index, const GLfloat * v); +// typedef void (APIENTRYP GPVERTEXATTRIB2S)(GLuint index, GLshort x, GLshort y); +// typedef void (APIENTRYP GPVERTEXATTRIB2SV)(GLuint index, const GLshort * v); +// typedef void (APIENTRYP GPVERTEXATTRIB3D)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +// typedef void (APIENTRYP GPVERTEXATTRIB3DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIB3F)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +// typedef void (APIENTRYP GPVERTEXATTRIB3FV)(GLuint index, const GLfloat * v); +// typedef void (APIENTRYP GPVERTEXATTRIB3S)(GLuint index, GLshort x, GLshort y, GLshort z); +// typedef void (APIENTRYP GPVERTEXATTRIB3SV)(GLuint index, const GLshort * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4NBV)(GLuint index, const GLbyte * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4NIV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4NSV)(GLuint index, const GLshort * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4NUB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +// typedef void (APIENTRYP GPVERTEXATTRIB4NUBV)(GLuint index, const GLubyte * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4NUIV)(GLuint index, const GLuint * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4NUSV)(GLuint index, const GLushort * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4BV)(GLuint index, const GLbyte * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4D)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +// typedef void (APIENTRYP GPVERTEXATTRIB4DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4F)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +// typedef void (APIENTRYP GPVERTEXATTRIB4FV)(GLuint index, const GLfloat * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4IV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4S)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +// typedef void (APIENTRYP GPVERTEXATTRIB4SV)(GLuint index, const GLshort * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4UBV)(GLuint index, const GLubyte * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4UIV)(GLuint index, const GLuint * v); +// typedef void (APIENTRYP GPVERTEXATTRIB4USV)(GLuint index, const GLushort * v); +// typedef void (APIENTRYP GPVERTEXATTRIBBINDING)(GLuint attribindex, GLuint bindingindex); +// typedef void (APIENTRYP GPVERTEXATTRIBDIVISOR)(GLuint index, GLuint divisor); +// typedef void (APIENTRYP GPVERTEXATTRIBFORMAT)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +// typedef void (APIENTRYP GPVERTEXATTRIBI1I)(GLuint index, GLint x); +// typedef void (APIENTRYP GPVERTEXATTRIBI1IV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI1UI)(GLuint index, GLuint x); +// typedef void (APIENTRYP GPVERTEXATTRIBI1UIV)(GLuint index, const GLuint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI2I)(GLuint index, GLint x, GLint y); +// typedef void (APIENTRYP GPVERTEXATTRIBI2IV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI2UI)(GLuint index, GLuint x, GLuint y); +// typedef void (APIENTRYP GPVERTEXATTRIBI2UIV)(GLuint index, const GLuint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI3I)(GLuint index, GLint x, GLint y, GLint z); +// typedef void (APIENTRYP GPVERTEXATTRIBI3IV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI3UI)(GLuint index, GLuint x, GLuint y, GLuint z); +// typedef void (APIENTRYP GPVERTEXATTRIBI3UIV)(GLuint index, const GLuint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI4BV)(GLuint index, const GLbyte * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI4I)(GLuint index, GLint x, GLint y, GLint z, GLint w); +// typedef void (APIENTRYP GPVERTEXATTRIBI4IV)(GLuint index, const GLint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI4SV)(GLuint index, const GLshort * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI4UBV)(GLuint index, const GLubyte * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI4UI)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +// typedef void (APIENTRYP GPVERTEXATTRIBI4UIV)(GLuint index, const GLuint * v); +// typedef void (APIENTRYP GPVERTEXATTRIBI4USV)(GLuint index, const GLushort * v); +// typedef void (APIENTRYP GPVERTEXATTRIBIFORMAT)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +// typedef void (APIENTRYP GPVERTEXATTRIBIPOINTER)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer); +// typedef void (APIENTRYP GPVERTEXATTRIBL1D)(GLuint index, GLdouble x); +// typedef void (APIENTRYP GPVERTEXATTRIBL1DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIBL1UI64ARB)(GLuint index, GLuint64EXT x); +// typedef void (APIENTRYP GPVERTEXATTRIBL1UI64VARB)(GLuint index, const GLuint64EXT * v); +// typedef void (APIENTRYP GPVERTEXATTRIBL2D)(GLuint index, GLdouble x, GLdouble y); +// typedef void (APIENTRYP GPVERTEXATTRIBL2DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIBL3D)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +// typedef void (APIENTRYP GPVERTEXATTRIBL3DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIBL4D)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +// typedef void (APIENTRYP GPVERTEXATTRIBL4DV)(GLuint index, const GLdouble * v); +// typedef void (APIENTRYP GPVERTEXATTRIBLFORMAT)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +// typedef void (APIENTRYP GPVERTEXATTRIBLPOINTER)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer); +// typedef void (APIENTRYP GPVERTEXATTRIBP1UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +// typedef void (APIENTRYP GPVERTEXATTRIBP1UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); +// typedef void (APIENTRYP GPVERTEXATTRIBP2UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +// typedef void (APIENTRYP GPVERTEXATTRIBP2UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); +// typedef void (APIENTRYP GPVERTEXATTRIBP3UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +// typedef void (APIENTRYP GPVERTEXATTRIBP3UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); +// typedef void (APIENTRYP GPVERTEXATTRIBP4UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +// typedef void (APIENTRYP GPVERTEXATTRIBP4UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); +// typedef void (APIENTRYP GPVERTEXATTRIBPOINTER)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer); +// typedef void (APIENTRYP GPVERTEXBINDINGDIVISOR)(GLuint bindingindex, GLuint divisor); +// typedef void (APIENTRYP GPVIEWPORT)(GLint x, GLint y, GLsizei width, GLsizei height); +// typedef void (APIENTRYP GPVIEWPORTARRAYV)(GLuint first, GLsizei count, const GLfloat * v); +// typedef void (APIENTRYP GPVIEWPORTINDEXEDF)(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +// typedef void (APIENTRYP GPVIEWPORTINDEXEDFV)(GLuint index, const GLfloat * v); +// typedef void (APIENTRYP GPWAITSYNC)(GLsync sync, GLbitfield flags, GLuint64 timeout); +// static void glowActiveShaderProgram(GPACTIVESHADERPROGRAM fnptr, GLuint pipeline, GLuint program) { +// (*fnptr)(pipeline, program); +// } +// static void glowActiveTexture(GPACTIVETEXTURE fnptr, GLenum texture) { +// (*fnptr)(texture); +// } +// static void glowAttachShader(GPATTACHSHADER fnptr, GLuint program, GLuint shader) { +// (*fnptr)(program, shader); +// } +// static void glowBeginConditionalRender(GPBEGINCONDITIONALRENDER fnptr, GLuint id, GLenum mode) { +// (*fnptr)(id, mode); +// } +// static void glowBeginQuery(GPBEGINQUERY fnptr, GLenum target, GLuint id) { +// (*fnptr)(target, id); +// } +// static void glowBeginQueryIndexed(GPBEGINQUERYINDEXED fnptr, GLenum target, GLuint index, GLuint id) { +// (*fnptr)(target, index, id); +// } +// static void glowBeginTransformFeedback(GPBEGINTRANSFORMFEEDBACK fnptr, GLenum primitiveMode) { +// (*fnptr)(primitiveMode); +// } +// static void glowBindAttribLocation(GPBINDATTRIBLOCATION fnptr, GLuint program, GLuint index, const GLchar * name) { +// (*fnptr)(program, index, name); +// } +// static void glowBindBuffer(GPBINDBUFFER fnptr, GLenum target, GLuint buffer) { +// (*fnptr)(target, buffer); +// } +// static void glowBindBufferBase(GPBINDBUFFERBASE fnptr, GLenum target, GLuint index, GLuint buffer) { +// (*fnptr)(target, index, buffer); +// } +// static void glowBindBufferRange(GPBINDBUFFERRANGE fnptr, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) { +// (*fnptr)(target, index, buffer, offset, size); +// } +// static void glowBindBuffersBase(GPBINDBUFFERSBASE fnptr, GLenum target, GLuint first, GLsizei count, const GLuint * buffers) { +// (*fnptr)(target, first, count, buffers); +// } +// static void glowBindBuffersRange(GPBINDBUFFERSRANGE fnptr, GLenum target, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizeiptr * sizes) { +// (*fnptr)(target, first, count, buffers, offsets, sizes); +// } +// static void glowBindFragDataLocation(GPBINDFRAGDATALOCATION fnptr, GLuint program, GLuint color, const GLchar * name) { +// (*fnptr)(program, color, name); +// } +// static void glowBindFragDataLocationIndexed(GPBINDFRAGDATALOCATIONINDEXED fnptr, GLuint program, GLuint colorNumber, GLuint index, const GLchar * name) { +// (*fnptr)(program, colorNumber, index, name); +// } +// static void glowBindFramebuffer(GPBINDFRAMEBUFFER fnptr, GLenum target, GLuint framebuffer) { +// (*fnptr)(target, framebuffer); +// } +// static void glowBindImageTexture(GPBINDIMAGETEXTURE fnptr, GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) { +// (*fnptr)(unit, texture, level, layered, layer, access, format); +// } +// static void glowBindImageTextures(GPBINDIMAGETEXTURES fnptr, GLuint first, GLsizei count, const GLuint * textures) { +// (*fnptr)(first, count, textures); +// } +// static void glowBindProgramPipeline(GPBINDPROGRAMPIPELINE fnptr, GLuint pipeline) { +// (*fnptr)(pipeline); +// } +// static void glowBindRenderbuffer(GPBINDRENDERBUFFER fnptr, GLenum target, GLuint renderbuffer) { +// (*fnptr)(target, renderbuffer); +// } +// static void glowBindSampler(GPBINDSAMPLER fnptr, GLuint unit, GLuint sampler) { +// (*fnptr)(unit, sampler); +// } +// static void glowBindSamplers(GPBINDSAMPLERS fnptr, GLuint first, GLsizei count, const GLuint * samplers) { +// (*fnptr)(first, count, samplers); +// } +// static void glowBindTexture(GPBINDTEXTURE fnptr, GLenum target, GLuint texture) { +// (*fnptr)(target, texture); +// } +// static void glowBindTextureUnit(GPBINDTEXTUREUNIT fnptr, GLuint unit, GLuint texture) { +// (*fnptr)(unit, texture); +// } +// static void glowBindTextures(GPBINDTEXTURES fnptr, GLuint first, GLsizei count, const GLuint * textures) { +// (*fnptr)(first, count, textures); +// } +// static void glowBindTransformFeedback(GPBINDTRANSFORMFEEDBACK fnptr, GLenum target, GLuint id) { +// (*fnptr)(target, id); +// } +// static void glowBindVertexArray(GPBINDVERTEXARRAY fnptr, GLuint array) { +// (*fnptr)(array); +// } +// static void glowBindVertexBuffer(GPBINDVERTEXBUFFER fnptr, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) { +// (*fnptr)(bindingindex, buffer, offset, stride); +// } +// static void glowBindVertexBuffers(GPBINDVERTEXBUFFERS fnptr, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides) { +// (*fnptr)(first, count, buffers, offsets, strides); +// } +// static void glowBlendColor(GPBLENDCOLOR fnptr, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { +// (*fnptr)(red, green, blue, alpha); +// } +// static void glowBlendEquation(GPBLENDEQUATION fnptr, GLenum mode) { +// (*fnptr)(mode); +// } +// static void glowBlendEquationSeparate(GPBLENDEQUATIONSEPARATE fnptr, GLenum modeRGB, GLenum modeAlpha) { +// (*fnptr)(modeRGB, modeAlpha); +// } +// static void glowBlendEquationSeparateiARB(GPBLENDEQUATIONSEPARATEIARB fnptr, GLuint buf, GLenum modeRGB, GLenum modeAlpha) { +// (*fnptr)(buf, modeRGB, modeAlpha); +// } +// static void glowBlendEquationiARB(GPBLENDEQUATIONIARB fnptr, GLuint buf, GLenum mode) { +// (*fnptr)(buf, mode); +// } +// static void glowBlendFunc(GPBLENDFUNC fnptr, GLenum sfactor, GLenum dfactor) { +// (*fnptr)(sfactor, dfactor); +// } +// static void glowBlendFuncSeparate(GPBLENDFUNCSEPARATE fnptr, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { +// (*fnptr)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); +// } +// static void glowBlendFuncSeparateiARB(GPBLENDFUNCSEPARATEIARB fnptr, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) { +// (*fnptr)(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); +// } +// static void glowBlendFunciARB(GPBLENDFUNCIARB fnptr, GLuint buf, GLenum src, GLenum dst) { +// (*fnptr)(buf, src, dst); +// } +// static void glowBlitFramebuffer(GPBLITFRAMEBUFFER fnptr, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { +// (*fnptr)(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); +// } +// static void glowBlitNamedFramebuffer(GPBLITNAMEDFRAMEBUFFER fnptr, GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { +// (*fnptr)(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); +// } +// static void glowBufferData(GPBUFFERDATA fnptr, GLenum target, GLsizeiptr size, const void * data, GLenum usage) { +// (*fnptr)(target, size, data, usage); +// } +// static void glowBufferPageCommitmentARB(GPBUFFERPAGECOMMITMENTARB fnptr, GLenum target, GLintptr offset, GLsizei size, GLboolean commit) { +// (*fnptr)(target, offset, size, commit); +// } +// static void glowBufferStorage(GPBUFFERSTORAGE fnptr, GLenum target, GLsizeiptr size, const void * data, GLbitfield flags) { +// (*fnptr)(target, size, data, flags); +// } +// static void glowBufferSubData(GPBUFFERSUBDATA fnptr, GLenum target, GLintptr offset, GLsizeiptr size, const void * data) { +// (*fnptr)(target, offset, size, data); +// } +// static GLenum glowCheckFramebufferStatus(GPCHECKFRAMEBUFFERSTATUS fnptr, GLenum target) { +// return (*fnptr)(target); +// } +// static GLenum glowCheckNamedFramebufferStatus(GPCHECKNAMEDFRAMEBUFFERSTATUS fnptr, GLuint framebuffer, GLenum target) { +// return (*fnptr)(framebuffer, target); +// } +// static void glowClampColor(GPCLAMPCOLOR fnptr, GLenum target, GLenum clamp) { +// (*fnptr)(target, clamp); +// } +// static void glowClear(GPCLEAR fnptr, GLbitfield mask) { +// (*fnptr)(mask); +// } +// static void glowClearBufferData(GPCLEARBUFFERDATA fnptr, GLenum target, GLenum internalformat, GLenum format, GLenum type, const void * data) { +// (*fnptr)(target, internalformat, format, type, data); +// } +// static void glowClearBufferSubData(GPCLEARBUFFERSUBDATA fnptr, GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data) { +// (*fnptr)(target, internalformat, offset, size, format, type, data); +// } +// static void glowClearBufferfi(GPCLEARBUFFERFI fnptr, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) { +// (*fnptr)(buffer, drawbuffer, depth, stencil); +// } +// static void glowClearBufferfv(GPCLEARBUFFERFV fnptr, GLenum buffer, GLint drawbuffer, const GLfloat * value) { +// (*fnptr)(buffer, drawbuffer, value); +// } +// static void glowClearBufferiv(GPCLEARBUFFERIV fnptr, GLenum buffer, GLint drawbuffer, const GLint * value) { +// (*fnptr)(buffer, drawbuffer, value); +// } +// static void glowClearBufferuiv(GPCLEARBUFFERUIV fnptr, GLenum buffer, GLint drawbuffer, const GLuint * value) { +// (*fnptr)(buffer, drawbuffer, value); +// } +// static void glowClearColor(GPCLEARCOLOR fnptr, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { +// (*fnptr)(red, green, blue, alpha); +// } +// static void glowClearDepth(GPCLEARDEPTH fnptr, GLdouble depth) { +// (*fnptr)(depth); +// } +// static void glowClearDepthf(GPCLEARDEPTHF fnptr, GLfloat d) { +// (*fnptr)(d); +// } +// static void glowClearNamedBufferData(GPCLEARNAMEDBUFFERDATA fnptr, GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void * data) { +// (*fnptr)(buffer, internalformat, format, type, data); +// } +// static void glowClearNamedBufferSubData(GPCLEARNAMEDBUFFERSUBDATA fnptr, GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void * data) { +// (*fnptr)(buffer, internalformat, offset, size, format, type, data); +// } +// static void glowClearNamedFramebufferfi(GPCLEARNAMEDFRAMEBUFFERFI fnptr, GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil) { +// (*fnptr)(framebuffer, buffer, depth, stencil); +// } +// static void glowClearNamedFramebufferfv(GPCLEARNAMEDFRAMEBUFFERFV fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat * value) { +// (*fnptr)(framebuffer, buffer, drawbuffer, value); +// } +// static void glowClearNamedFramebufferiv(GPCLEARNAMEDFRAMEBUFFERIV fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint * value) { +// (*fnptr)(framebuffer, buffer, drawbuffer, value); +// } +// static void glowClearNamedFramebufferuiv(GPCLEARNAMEDFRAMEBUFFERUIV fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint * value) { +// (*fnptr)(framebuffer, buffer, drawbuffer, value); +// } +// static void glowClearStencil(GPCLEARSTENCIL fnptr, GLint s) { +// (*fnptr)(s); +// } +// static void glowClearTexImage(GPCLEARTEXIMAGE fnptr, GLuint texture, GLint level, GLenum format, GLenum type, const void * data) { +// (*fnptr)(texture, level, format, type, data); +// } +// static void glowClearTexSubImage(GPCLEARTEXSUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); +// } +// static GLenum glowClientWaitSync(GPCLIENTWAITSYNC fnptr, GLsync sync, GLbitfield flags, GLuint64 timeout) { +// return (*fnptr)(sync, flags, timeout); +// } +// static void glowClipControl(GPCLIPCONTROL fnptr, GLenum origin, GLenum depth) { +// (*fnptr)(origin, depth); +// } +// static void glowColorMask(GPCOLORMASK fnptr, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) { +// (*fnptr)(red, green, blue, alpha); +// } +// static void glowColorMaski(GPCOLORMASKI fnptr, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) { +// (*fnptr)(index, r, g, b, a); +// } +// static void glowCompileShader(GPCOMPILESHADER fnptr, GLuint shader) { +// (*fnptr)(shader); +// } +// static void glowCompileShaderIncludeARB(GPCOMPILESHADERINCLUDEARB fnptr, GLuint shader, GLsizei count, const GLchar *const* path, const GLint * length) { +// (*fnptr)(shader, count, path, length); +// } +// static void glowCompressedTexImage1D(GPCOMPRESSEDTEXIMAGE1D fnptr, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data) { +// (*fnptr)(target, level, internalformat, width, border, imageSize, data); +// } +// static void glowCompressedTexImage2D(GPCOMPRESSEDTEXIMAGE2D fnptr, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data) { +// (*fnptr)(target, level, internalformat, width, height, border, imageSize, data); +// } +// static void glowCompressedTexImage3D(GPCOMPRESSEDTEXIMAGE3D fnptr, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data) { +// (*fnptr)(target, level, internalformat, width, height, depth, border, imageSize, data); +// } +// static void glowCompressedTexSubImage1D(GPCOMPRESSEDTEXSUBIMAGE1D fnptr, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data) { +// (*fnptr)(target, level, xoffset, width, format, imageSize, data); +// } +// static void glowCompressedTexSubImage2D(GPCOMPRESSEDTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data) { +// (*fnptr)(target, level, xoffset, yoffset, width, height, format, imageSize, data); +// } +// static void glowCompressedTexSubImage3D(GPCOMPRESSEDTEXSUBIMAGE3D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data) { +// (*fnptr)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); +// } +// static void glowCompressedTextureSubImage1D(GPCOMPRESSEDTEXTURESUBIMAGE1D fnptr, GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data) { +// (*fnptr)(texture, level, xoffset, width, format, imageSize, data); +// } +// static void glowCompressedTextureSubImage2D(GPCOMPRESSEDTEXTURESUBIMAGE2D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data) { +// (*fnptr)(texture, level, xoffset, yoffset, width, height, format, imageSize, data); +// } +// static void glowCompressedTextureSubImage3D(GPCOMPRESSEDTEXTURESUBIMAGE3D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); +// } +// static void glowCopyBufferSubData(GPCOPYBUFFERSUBDATA fnptr, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) { +// (*fnptr)(readTarget, writeTarget, readOffset, writeOffset, size); +// } +// static void glowCopyImageSubData(GPCOPYIMAGESUBDATA fnptr, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) { +// (*fnptr)(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); +// } +// static void glowCopyNamedBufferSubData(GPCOPYNAMEDBUFFERSUBDATA fnptr, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size) { +// (*fnptr)(readBuffer, writeBuffer, readOffset, writeOffset, size); +// } +// static void glowCopyTexImage1D(GPCOPYTEXIMAGE1D fnptr, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) { +// (*fnptr)(target, level, internalformat, x, y, width, border); +// } +// static void glowCopyTexImage2D(GPCOPYTEXIMAGE2D fnptr, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { +// (*fnptr)(target, level, internalformat, x, y, width, height, border); +// } +// static void glowCopyTexSubImage1D(GPCOPYTEXSUBIMAGE1D fnptr, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) { +// (*fnptr)(target, level, xoffset, x, y, width); +// } +// static void glowCopyTexSubImage2D(GPCOPYTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(target, level, xoffset, yoffset, x, y, width, height); +// } +// static void glowCopyTexSubImage3D(GPCOPYTEXSUBIMAGE3D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(target, level, xoffset, yoffset, zoffset, x, y, width, height); +// } +// static void glowCopyTextureSubImage1D(GPCOPYTEXTURESUBIMAGE1D fnptr, GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) { +// (*fnptr)(texture, level, xoffset, x, y, width); +// } +// static void glowCopyTextureSubImage2D(GPCOPYTEXTURESUBIMAGE2D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(texture, level, xoffset, yoffset, x, y, width, height); +// } +// static void glowCopyTextureSubImage3D(GPCOPYTEXTURESUBIMAGE3D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, x, y, width, height); +// } +// static void glowCreateBuffers(GPCREATEBUFFERS fnptr, GLsizei n, GLuint * buffers) { +// (*fnptr)(n, buffers); +// } +// static void glowCreateFramebuffers(GPCREATEFRAMEBUFFERS fnptr, GLsizei n, GLuint * framebuffers) { +// (*fnptr)(n, framebuffers); +// } +// static GLuint glowCreateProgram(GPCREATEPROGRAM fnptr) { +// return (*fnptr)(); +// } +// static void glowCreateProgramPipelines(GPCREATEPROGRAMPIPELINES fnptr, GLsizei n, GLuint * pipelines) { +// (*fnptr)(n, pipelines); +// } +// static void glowCreateQueries(GPCREATEQUERIES fnptr, GLenum target, GLsizei n, GLuint * ids) { +// (*fnptr)(target, n, ids); +// } +// static void glowCreateRenderbuffers(GPCREATERENDERBUFFERS fnptr, GLsizei n, GLuint * renderbuffers) { +// (*fnptr)(n, renderbuffers); +// } +// static void glowCreateSamplers(GPCREATESAMPLERS fnptr, GLsizei n, GLuint * samplers) { +// (*fnptr)(n, samplers); +// } +// static GLuint glowCreateShader(GPCREATESHADER fnptr, GLenum type) { +// return (*fnptr)(type); +// } +// static GLuint glowCreateShaderProgramv(GPCREATESHADERPROGRAMV fnptr, GLenum type, GLsizei count, const GLchar *const* strings) { +// return (*fnptr)(type, count, strings); +// } +// static GLsync glowCreateSyncFromCLeventARB(GPCREATESYNCFROMCLEVENTARB fnptr, struct _cl_context * context, struct _cl_event * event, GLbitfield flags) { +// return (*fnptr)(context, event, flags); +// } +// static void glowCreateTextures(GPCREATETEXTURES fnptr, GLenum target, GLsizei n, GLuint * textures) { +// (*fnptr)(target, n, textures); +// } +// static void glowCreateTransformFeedbacks(GPCREATETRANSFORMFEEDBACKS fnptr, GLsizei n, GLuint * ids) { +// (*fnptr)(n, ids); +// } +// static void glowCreateVertexArrays(GPCREATEVERTEXARRAYS fnptr, GLsizei n, GLuint * arrays) { +// (*fnptr)(n, arrays); +// } +// static void glowCullFace(GPCULLFACE fnptr, GLenum mode) { +// (*fnptr)(mode); +// } +// static void glowDebugMessageCallback(GPDEBUGMESSAGECALLBACK fnptr, GLDEBUGPROC callback, const void * userParam) { +// (*fnptr)(glowCDebugCallback, userParam); +// } +// static void glowDebugMessageCallbackARB(GPDEBUGMESSAGECALLBACKARB fnptr, GLDEBUGPROCARB callback, const void * userParam) { +// (*fnptr)(glowCDebugCallback, userParam); +// } +// static void glowDebugMessageCallbackKHR(GPDEBUGMESSAGECALLBACKKHR fnptr, GLDEBUGPROCKHR callback, const void * userParam) { +// (*fnptr)(glowCDebugCallback, userParam); +// } +// static void glowDebugMessageControl(GPDEBUGMESSAGECONTROL fnptr, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) { +// (*fnptr)(source, type, severity, count, ids, enabled); +// } +// static void glowDebugMessageControlARB(GPDEBUGMESSAGECONTROLARB fnptr, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) { +// (*fnptr)(source, type, severity, count, ids, enabled); +// } +// static void glowDebugMessageControlKHR(GPDEBUGMESSAGECONTROLKHR fnptr, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) { +// (*fnptr)(source, type, severity, count, ids, enabled); +// } +// static void glowDebugMessageInsert(GPDEBUGMESSAGEINSERT fnptr, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) { +// (*fnptr)(source, type, id, severity, length, buf); +// } +// static void glowDebugMessageInsertARB(GPDEBUGMESSAGEINSERTARB fnptr, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) { +// (*fnptr)(source, type, id, severity, length, buf); +// } +// static void glowDebugMessageInsertKHR(GPDEBUGMESSAGEINSERTKHR fnptr, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) { +// (*fnptr)(source, type, id, severity, length, buf); +// } +// static void glowDeleteBuffers(GPDELETEBUFFERS fnptr, GLsizei n, const GLuint * buffers) { +// (*fnptr)(n, buffers); +// } +// static void glowDeleteFramebuffers(GPDELETEFRAMEBUFFERS fnptr, GLsizei n, const GLuint * framebuffers) { +// (*fnptr)(n, framebuffers); +// } +// static void glowDeleteNamedStringARB(GPDELETENAMEDSTRINGARB fnptr, GLint namelen, const GLchar * name) { +// (*fnptr)(namelen, name); +// } +// static void glowDeleteProgram(GPDELETEPROGRAM fnptr, GLuint program) { +// (*fnptr)(program); +// } +// static void glowDeleteProgramPipelines(GPDELETEPROGRAMPIPELINES fnptr, GLsizei n, const GLuint * pipelines) { +// (*fnptr)(n, pipelines); +// } +// static void glowDeleteQueries(GPDELETEQUERIES fnptr, GLsizei n, const GLuint * ids) { +// (*fnptr)(n, ids); +// } +// static void glowDeleteRenderbuffers(GPDELETERENDERBUFFERS fnptr, GLsizei n, const GLuint * renderbuffers) { +// (*fnptr)(n, renderbuffers); +// } +// static void glowDeleteSamplers(GPDELETESAMPLERS fnptr, GLsizei count, const GLuint * samplers) { +// (*fnptr)(count, samplers); +// } +// static void glowDeleteShader(GPDELETESHADER fnptr, GLuint shader) { +// (*fnptr)(shader); +// } +// static void glowDeleteSync(GPDELETESYNC fnptr, GLsync sync) { +// (*fnptr)(sync); +// } +// static void glowDeleteTextures(GPDELETETEXTURES fnptr, GLsizei n, const GLuint * textures) { +// (*fnptr)(n, textures); +// } +// static void glowDeleteTransformFeedbacks(GPDELETETRANSFORMFEEDBACKS fnptr, GLsizei n, const GLuint * ids) { +// (*fnptr)(n, ids); +// } +// static void glowDeleteVertexArrays(GPDELETEVERTEXARRAYS fnptr, GLsizei n, const GLuint * arrays) { +// (*fnptr)(n, arrays); +// } +// static void glowDepthFunc(GPDEPTHFUNC fnptr, GLenum func) { +// (*fnptr)(func); +// } +// static void glowDepthMask(GPDEPTHMASK fnptr, GLboolean flag) { +// (*fnptr)(flag); +// } +// static void glowDepthRange(GPDEPTHRANGE fnptr, GLdouble xnear, GLdouble xfar) { +// (*fnptr)(xnear, xfar); +// } +// static void glowDepthRangeArrayv(GPDEPTHRANGEARRAYV fnptr, GLuint first, GLsizei count, const GLdouble * v) { +// (*fnptr)(first, count, v); +// } +// static void glowDepthRangeIndexed(GPDEPTHRANGEINDEXED fnptr, GLuint index, GLdouble n, GLdouble f) { +// (*fnptr)(index, n, f); +// } +// static void glowDepthRangef(GPDEPTHRANGEF fnptr, GLfloat n, GLfloat f) { +// (*fnptr)(n, f); +// } +// static void glowDetachShader(GPDETACHSHADER fnptr, GLuint program, GLuint shader) { +// (*fnptr)(program, shader); +// } +// static void glowDisable(GPDISABLE fnptr, GLenum cap) { +// (*fnptr)(cap); +// } +// static void glowDisableVertexArrayAttrib(GPDISABLEVERTEXARRAYATTRIB fnptr, GLuint vaobj, GLuint index) { +// (*fnptr)(vaobj, index); +// } +// static void glowDisableVertexAttribArray(GPDISABLEVERTEXATTRIBARRAY fnptr, GLuint index) { +// (*fnptr)(index); +// } +// static void glowDisablei(GPDISABLEI fnptr, GLenum target, GLuint index) { +// (*fnptr)(target, index); +// } +// static void glowDispatchCompute(GPDISPATCHCOMPUTE fnptr, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) { +// (*fnptr)(num_groups_x, num_groups_y, num_groups_z); +// } +// static void glowDispatchComputeGroupSizeARB(GPDISPATCHCOMPUTEGROUPSIZEARB fnptr, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z) { +// (*fnptr)(num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z); +// } +// static void glowDispatchComputeIndirect(GPDISPATCHCOMPUTEINDIRECT fnptr, GLintptr indirect) { +// (*fnptr)(indirect); +// } +// static void glowDrawArrays(GPDRAWARRAYS fnptr, GLenum mode, GLint first, GLsizei count) { +// (*fnptr)(mode, first, count); +// } +// static void glowDrawArraysIndirect(GPDRAWARRAYSINDIRECT fnptr, GLenum mode, const void * indirect) { +// (*fnptr)(mode, indirect); +// } +// static void glowDrawArraysInstanced(GPDRAWARRAYSINSTANCED fnptr, GLenum mode, GLint first, GLsizei count, GLsizei instancecount) { +// (*fnptr)(mode, first, count, instancecount); +// } +// static void glowDrawArraysInstancedBaseInstance(GPDRAWARRAYSINSTANCEDBASEINSTANCE fnptr, GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance) { +// (*fnptr)(mode, first, count, instancecount, baseinstance); +// } +// static void glowDrawBuffer(GPDRAWBUFFER fnptr, GLenum buf) { +// (*fnptr)(buf); +// } +// static void glowDrawBuffers(GPDRAWBUFFERS fnptr, GLsizei n, const GLenum * bufs) { +// (*fnptr)(n, bufs); +// } +// static void glowDrawElements(GPDRAWELEMENTS fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices) { +// (*fnptr)(mode, count, type, indices); +// } +// static void glowDrawElementsBaseVertex(GPDRAWELEMENTSBASEVERTEX fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex) { +// (*fnptr)(mode, count, type, indices, basevertex); +// } +// static void glowDrawElementsIndirect(GPDRAWELEMENTSINDIRECT fnptr, GLenum mode, GLenum type, const void * indirect) { +// (*fnptr)(mode, type, indirect); +// } +// static void glowDrawElementsInstanced(GPDRAWELEMENTSINSTANCED fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount) { +// (*fnptr)(mode, count, type, indices, instancecount); +// } +// static void glowDrawElementsInstancedBaseInstance(GPDRAWELEMENTSINSTANCEDBASEINSTANCE fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLuint baseinstance) { +// (*fnptr)(mode, count, type, indices, instancecount, baseinstance); +// } +// static void glowDrawElementsInstancedBaseVertex(GPDRAWELEMENTSINSTANCEDBASEVERTEX fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex) { +// (*fnptr)(mode, count, type, indices, instancecount, basevertex); +// } +// static void glowDrawElementsInstancedBaseVertexBaseInstance(GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance) { +// (*fnptr)(mode, count, type, indices, instancecount, basevertex, baseinstance); +// } +// static void glowDrawRangeElements(GPDRAWRANGEELEMENTS fnptr, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices) { +// (*fnptr)(mode, start, end, count, type, indices); +// } +// static void glowDrawRangeElementsBaseVertex(GPDRAWRANGEELEMENTSBASEVERTEX fnptr, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex) { +// (*fnptr)(mode, start, end, count, type, indices, basevertex); +// } +// static void glowDrawTransformFeedback(GPDRAWTRANSFORMFEEDBACK fnptr, GLenum mode, GLuint id) { +// (*fnptr)(mode, id); +// } +// static void glowDrawTransformFeedbackInstanced(GPDRAWTRANSFORMFEEDBACKINSTANCED fnptr, GLenum mode, GLuint id, GLsizei instancecount) { +// (*fnptr)(mode, id, instancecount); +// } +// static void glowDrawTransformFeedbackStream(GPDRAWTRANSFORMFEEDBACKSTREAM fnptr, GLenum mode, GLuint id, GLuint stream) { +// (*fnptr)(mode, id, stream); +// } +// static void glowDrawTransformFeedbackStreamInstanced(GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED fnptr, GLenum mode, GLuint id, GLuint stream, GLsizei instancecount) { +// (*fnptr)(mode, id, stream, instancecount); +// } +// static void glowEnable(GPENABLE fnptr, GLenum cap) { +// (*fnptr)(cap); +// } +// static void glowEnableVertexArrayAttrib(GPENABLEVERTEXARRAYATTRIB fnptr, GLuint vaobj, GLuint index) { +// (*fnptr)(vaobj, index); +// } +// static void glowEnableVertexAttribArray(GPENABLEVERTEXATTRIBARRAY fnptr, GLuint index) { +// (*fnptr)(index); +// } +// static void glowEnablei(GPENABLEI fnptr, GLenum target, GLuint index) { +// (*fnptr)(target, index); +// } +// static void glowEndConditionalRender(GPENDCONDITIONALRENDER fnptr) { +// (*fnptr)(); +// } +// static void glowEndQuery(GPENDQUERY fnptr, GLenum target) { +// (*fnptr)(target); +// } +// static void glowEndQueryIndexed(GPENDQUERYINDEXED fnptr, GLenum target, GLuint index) { +// (*fnptr)(target, index); +// } +// static void glowEndTransformFeedback(GPENDTRANSFORMFEEDBACK fnptr) { +// (*fnptr)(); +// } +// static GLsync glowFenceSync(GPFENCESYNC fnptr, GLenum condition, GLbitfield flags) { +// return (*fnptr)(condition, flags); +// } +// static void glowFinish(GPFINISH fnptr) { +// (*fnptr)(); +// } +// static void glowFlush(GPFLUSH fnptr) { +// (*fnptr)(); +// } +// static void glowFlushMappedBufferRange(GPFLUSHMAPPEDBUFFERRANGE fnptr, GLenum target, GLintptr offset, GLsizeiptr length) { +// (*fnptr)(target, offset, length); +// } +// static void glowFlushMappedNamedBufferRange(GPFLUSHMAPPEDNAMEDBUFFERRANGE fnptr, GLuint buffer, GLintptr offset, GLsizei length) { +// (*fnptr)(buffer, offset, length); +// } +// static void glowFramebufferParameteri(GPFRAMEBUFFERPARAMETERI fnptr, GLenum target, GLenum pname, GLint param) { +// (*fnptr)(target, pname, param); +// } +// static void glowFramebufferRenderbuffer(GPFRAMEBUFFERRENDERBUFFER fnptr, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { +// (*fnptr)(target, attachment, renderbuffertarget, renderbuffer); +// } +// static void glowFramebufferTexture(GPFRAMEBUFFERTEXTURE fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level) { +// (*fnptr)(target, attachment, texture, level); +// } +// static void glowFramebufferTexture1D(GPFRAMEBUFFERTEXTURE1D fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { +// (*fnptr)(target, attachment, textarget, texture, level); +// } +// static void glowFramebufferTexture2D(GPFRAMEBUFFERTEXTURE2D fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { +// (*fnptr)(target, attachment, textarget, texture, level); +// } +// static void glowFramebufferTexture3D(GPFRAMEBUFFERTEXTURE3D fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { +// (*fnptr)(target, attachment, textarget, texture, level, zoffset); +// } +// static void glowFramebufferTextureLayer(GPFRAMEBUFFERTEXTURELAYER fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) { +// (*fnptr)(target, attachment, texture, level, layer); +// } +// static void glowFrontFace(GPFRONTFACE fnptr, GLenum mode) { +// (*fnptr)(mode); +// } +// static void glowGenBuffers(GPGENBUFFERS fnptr, GLsizei n, GLuint * buffers) { +// (*fnptr)(n, buffers); +// } +// static void glowGenFramebuffers(GPGENFRAMEBUFFERS fnptr, GLsizei n, GLuint * framebuffers) { +// (*fnptr)(n, framebuffers); +// } +// static void glowGenProgramPipelines(GPGENPROGRAMPIPELINES fnptr, GLsizei n, GLuint * pipelines) { +// (*fnptr)(n, pipelines); +// } +// static void glowGenQueries(GPGENQUERIES fnptr, GLsizei n, GLuint * ids) { +// (*fnptr)(n, ids); +// } +// static void glowGenRenderbuffers(GPGENRENDERBUFFERS fnptr, GLsizei n, GLuint * renderbuffers) { +// (*fnptr)(n, renderbuffers); +// } +// static void glowGenSamplers(GPGENSAMPLERS fnptr, GLsizei count, GLuint * samplers) { +// (*fnptr)(count, samplers); +// } +// static void glowGenTextures(GPGENTEXTURES fnptr, GLsizei n, GLuint * textures) { +// (*fnptr)(n, textures); +// } +// static void glowGenTransformFeedbacks(GPGENTRANSFORMFEEDBACKS fnptr, GLsizei n, GLuint * ids) { +// (*fnptr)(n, ids); +// } +// static void glowGenVertexArrays(GPGENVERTEXARRAYS fnptr, GLsizei n, GLuint * arrays) { +// (*fnptr)(n, arrays); +// } +// static void glowGenerateMipmap(GPGENERATEMIPMAP fnptr, GLenum target) { +// (*fnptr)(target); +// } +// static void glowGenerateTextureMipmap(GPGENERATETEXTUREMIPMAP fnptr, GLuint texture) { +// (*fnptr)(texture); +// } +// static void glowGetActiveAtomicCounterBufferiv(GPGETACTIVEATOMICCOUNTERBUFFERIV fnptr, GLuint program, GLuint bufferIndex, GLenum pname, GLint * params) { +// (*fnptr)(program, bufferIndex, pname, params); +// } +// static void glowGetActiveAttrib(GPGETACTIVEATTRIB fnptr, GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) { +// (*fnptr)(program, index, bufSize, length, size, type, name); +// } +// static void glowGetActiveSubroutineName(GPGETACTIVESUBROUTINENAME fnptr, GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name) { +// (*fnptr)(program, shadertype, index, bufsize, length, name); +// } +// static void glowGetActiveSubroutineUniformName(GPGETACTIVESUBROUTINEUNIFORMNAME fnptr, GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name) { +// (*fnptr)(program, shadertype, index, bufsize, length, name); +// } +// static void glowGetActiveSubroutineUniformiv(GPGETACTIVESUBROUTINEUNIFORMIV fnptr, GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values) { +// (*fnptr)(program, shadertype, index, pname, values); +// } +// static void glowGetActiveUniform(GPGETACTIVEUNIFORM fnptr, GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) { +// (*fnptr)(program, index, bufSize, length, size, type, name); +// } +// static void glowGetActiveUniformBlockName(GPGETACTIVEUNIFORMBLOCKNAME fnptr, GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName) { +// (*fnptr)(program, uniformBlockIndex, bufSize, length, uniformBlockName); +// } +// static void glowGetActiveUniformBlockiv(GPGETACTIVEUNIFORMBLOCKIV fnptr, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params) { +// (*fnptr)(program, uniformBlockIndex, pname, params); +// } +// static void glowGetActiveUniformName(GPGETACTIVEUNIFORMNAME fnptr, GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName) { +// (*fnptr)(program, uniformIndex, bufSize, length, uniformName); +// } +// static void glowGetActiveUniformsiv(GPGETACTIVEUNIFORMSIV fnptr, GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params) { +// (*fnptr)(program, uniformCount, uniformIndices, pname, params); +// } +// static void glowGetAttachedShaders(GPGETATTACHEDSHADERS fnptr, GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders) { +// (*fnptr)(program, maxCount, count, shaders); +// } +// static GLint glowGetAttribLocation(GPGETATTRIBLOCATION fnptr, GLuint program, const GLchar * name) { +// return (*fnptr)(program, name); +// } +// static void glowGetBooleani_v(GPGETBOOLEANI_V fnptr, GLenum target, GLuint index, GLboolean * data) { +// (*fnptr)(target, index, data); +// } +// static void glowGetBooleanv(GPGETBOOLEANV fnptr, GLenum pname, GLboolean * data) { +// (*fnptr)(pname, data); +// } +// static void glowGetBufferParameteri64v(GPGETBUFFERPARAMETERI64V fnptr, GLenum target, GLenum pname, GLint64 * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetBufferParameteriv(GPGETBUFFERPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetBufferPointerv(GPGETBUFFERPOINTERV fnptr, GLenum target, GLenum pname, void ** params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetBufferSubData(GPGETBUFFERSUBDATA fnptr, GLenum target, GLintptr offset, GLsizeiptr size, void * data) { +// (*fnptr)(target, offset, size, data); +// } +// static void glowGetCompressedTexImage(GPGETCOMPRESSEDTEXIMAGE fnptr, GLenum target, GLint level, void * img) { +// (*fnptr)(target, level, img); +// } +// static void glowGetCompressedTextureImage(GPGETCOMPRESSEDTEXTUREIMAGE fnptr, GLuint texture, GLint level, GLsizei bufSize, void * pixels) { +// (*fnptr)(texture, level, bufSize, pixels); +// } +// static void glowGetCompressedTextureSubImage(GPGETCOMPRESSEDTEXTURESUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void * pixels) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); +// } +// static GLuint glowGetDebugMessageLog(GPGETDEBUGMESSAGELOG fnptr, GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) { +// return (*fnptr)(count, bufSize, sources, types, ids, severities, lengths, messageLog); +// } +// static GLuint glowGetDebugMessageLogARB(GPGETDEBUGMESSAGELOGARB fnptr, GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) { +// return (*fnptr)(count, bufSize, sources, types, ids, severities, lengths, messageLog); +// } +// static GLuint glowGetDebugMessageLogKHR(GPGETDEBUGMESSAGELOGKHR fnptr, GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) { +// return (*fnptr)(count, bufSize, sources, types, ids, severities, lengths, messageLog); +// } +// static void glowGetDoublei_v(GPGETDOUBLEI_V fnptr, GLenum target, GLuint index, GLdouble * data) { +// (*fnptr)(target, index, data); +// } +// static void glowGetDoublev(GPGETDOUBLEV fnptr, GLenum pname, GLdouble * data) { +// (*fnptr)(pname, data); +// } +// static GLenum glowGetError(GPGETERROR fnptr) { +// return (*fnptr)(); +// } +// static void glowGetFloati_v(GPGETFLOATI_V fnptr, GLenum target, GLuint index, GLfloat * data) { +// (*fnptr)(target, index, data); +// } +// static void glowGetFloatv(GPGETFLOATV fnptr, GLenum pname, GLfloat * data) { +// (*fnptr)(pname, data); +// } +// static GLint glowGetFragDataIndex(GPGETFRAGDATAINDEX fnptr, GLuint program, const GLchar * name) { +// return (*fnptr)(program, name); +// } +// static GLint glowGetFragDataLocation(GPGETFRAGDATALOCATION fnptr, GLuint program, const GLchar * name) { +// return (*fnptr)(program, name); +// } +// static void glowGetFramebufferAttachmentParameteriv(GPGETFRAMEBUFFERATTACHMENTPARAMETERIV fnptr, GLenum target, GLenum attachment, GLenum pname, GLint * params) { +// (*fnptr)(target, attachment, pname, params); +// } +// static void glowGetFramebufferParameteriv(GPGETFRAMEBUFFERPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static GLenum glowGetGraphicsResetStatus(GPGETGRAPHICSRESETSTATUS fnptr) { +// return (*fnptr)(); +// } +// static GLenum glowGetGraphicsResetStatusARB(GPGETGRAPHICSRESETSTATUSARB fnptr) { +// return (*fnptr)(); +// } +// static GLenum glowGetGraphicsResetStatusKHR(GPGETGRAPHICSRESETSTATUSKHR fnptr) { +// return (*fnptr)(); +// } +// static GLuint64 glowGetImageHandleARB(GPGETIMAGEHANDLEARB fnptr, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format) { +// return (*fnptr)(texture, level, layered, layer, format); +// } +// static void glowGetInteger64i_v(GPGETINTEGER64I_V fnptr, GLenum target, GLuint index, GLint64 * data) { +// (*fnptr)(target, index, data); +// } +// static void glowGetInteger64v(GPGETINTEGER64V fnptr, GLenum pname, GLint64 * data) { +// (*fnptr)(pname, data); +// } +// static void glowGetIntegeri_v(GPGETINTEGERI_V fnptr, GLenum target, GLuint index, GLint * data) { +// (*fnptr)(target, index, data); +// } +// static void glowGetIntegerv(GPGETINTEGERV fnptr, GLenum pname, GLint * data) { +// (*fnptr)(pname, data); +// } +// static void glowGetInternalformati64v(GPGETINTERNALFORMATI64V fnptr, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 * params) { +// (*fnptr)(target, internalformat, pname, bufSize, params); +// } +// static void glowGetInternalformativ(GPGETINTERNALFORMATIV fnptr, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params) { +// (*fnptr)(target, internalformat, pname, bufSize, params); +// } +// static void glowGetMultisamplefv(GPGETMULTISAMPLEFV fnptr, GLenum pname, GLuint index, GLfloat * val) { +// (*fnptr)(pname, index, val); +// } +// static void glowGetNamedBufferParameteri64v(GPGETNAMEDBUFFERPARAMETERI64V fnptr, GLuint buffer, GLenum pname, GLint64 * params) { +// (*fnptr)(buffer, pname, params); +// } +// static void glowGetNamedBufferParameteriv(GPGETNAMEDBUFFERPARAMETERIV fnptr, GLuint buffer, GLenum pname, GLint * params) { +// (*fnptr)(buffer, pname, params); +// } +// static void glowGetNamedBufferPointerv(GPGETNAMEDBUFFERPOINTERV fnptr, GLuint buffer, GLenum pname, void ** params) { +// (*fnptr)(buffer, pname, params); +// } +// static void glowGetNamedBufferSubData(GPGETNAMEDBUFFERSUBDATA fnptr, GLuint buffer, GLintptr offset, GLsizei size, void * data) { +// (*fnptr)(buffer, offset, size, data); +// } +// static void glowGetNamedFramebufferAttachmentParameteriv(GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV fnptr, GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params) { +// (*fnptr)(framebuffer, attachment, pname, params); +// } +// static void glowGetNamedFramebufferParameteriv(GPGETNAMEDFRAMEBUFFERPARAMETERIV fnptr, GLuint framebuffer, GLenum pname, GLint * param) { +// (*fnptr)(framebuffer, pname, param); +// } +// static void glowGetNamedRenderbufferParameteriv(GPGETNAMEDRENDERBUFFERPARAMETERIV fnptr, GLuint renderbuffer, GLenum pname, GLint * params) { +// (*fnptr)(renderbuffer, pname, params); +// } +// static void glowGetNamedStringARB(GPGETNAMEDSTRINGARB fnptr, GLint namelen, const GLchar * name, GLsizei bufSize, GLint * stringlen, GLchar * string) { +// (*fnptr)(namelen, name, bufSize, stringlen, string); +// } +// static void glowGetNamedStringivARB(GPGETNAMEDSTRINGIVARB fnptr, GLint namelen, const GLchar * name, GLenum pname, GLint * params) { +// (*fnptr)(namelen, name, pname, params); +// } +// static void glowGetObjectLabel(GPGETOBJECTLABEL fnptr, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label) { +// (*fnptr)(identifier, name, bufSize, length, label); +// } +// static void glowGetObjectLabelKHR(GPGETOBJECTLABELKHR fnptr, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label) { +// (*fnptr)(identifier, name, bufSize, length, label); +// } +// static void glowGetObjectPtrLabel(GPGETOBJECTPTRLABEL fnptr, const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label) { +// (*fnptr)(ptr, bufSize, length, label); +// } +// static void glowGetObjectPtrLabelKHR(GPGETOBJECTPTRLABELKHR fnptr, const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label) { +// (*fnptr)(ptr, bufSize, length, label); +// } +// static void glowGetPointerv(GPGETPOINTERV fnptr, GLenum pname, void ** params) { +// (*fnptr)(pname, params); +// } +// static void glowGetPointervKHR(GPGETPOINTERVKHR fnptr, GLenum pname, void ** params) { +// (*fnptr)(pname, params); +// } +// static void glowGetProgramBinary(GPGETPROGRAMBINARY fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary) { +// (*fnptr)(program, bufSize, length, binaryFormat, binary); +// } +// static void glowGetProgramInfoLog(GPGETPROGRAMINFOLOG fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) { +// (*fnptr)(program, bufSize, length, infoLog); +// } +// static void glowGetProgramInterfaceiv(GPGETPROGRAMINTERFACEIV fnptr, GLuint program, GLenum programInterface, GLenum pname, GLint * params) { +// (*fnptr)(program, programInterface, pname, params); +// } +// static void glowGetProgramPipelineInfoLog(GPGETPROGRAMPIPELINEINFOLOG fnptr, GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog) { +// (*fnptr)(pipeline, bufSize, length, infoLog); +// } +// static void glowGetProgramPipelineiv(GPGETPROGRAMPIPELINEIV fnptr, GLuint pipeline, GLenum pname, GLint * params) { +// (*fnptr)(pipeline, pname, params); +// } +// static GLuint glowGetProgramResourceIndex(GPGETPROGRAMRESOURCEINDEX fnptr, GLuint program, GLenum programInterface, const GLchar * name) { +// return (*fnptr)(program, programInterface, name); +// } +// static GLint glowGetProgramResourceLocation(GPGETPROGRAMRESOURCELOCATION fnptr, GLuint program, GLenum programInterface, const GLchar * name) { +// return (*fnptr)(program, programInterface, name); +// } +// static GLint glowGetProgramResourceLocationIndex(GPGETPROGRAMRESOURCELOCATIONINDEX fnptr, GLuint program, GLenum programInterface, const GLchar * name) { +// return (*fnptr)(program, programInterface, name); +// } +// static void glowGetProgramResourceName(GPGETPROGRAMRESOURCENAME fnptr, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name) { +// (*fnptr)(program, programInterface, index, bufSize, length, name); +// } +// static void glowGetProgramResourceiv(GPGETPROGRAMRESOURCEIV fnptr, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) { +// (*fnptr)(program, programInterface, index, propCount, props, bufSize, length, params); +// } +// static void glowGetProgramStageiv(GPGETPROGRAMSTAGEIV fnptr, GLuint program, GLenum shadertype, GLenum pname, GLint * values) { +// (*fnptr)(program, shadertype, pname, values); +// } +// static void glowGetProgramiv(GPGETPROGRAMIV fnptr, GLuint program, GLenum pname, GLint * params) { +// (*fnptr)(program, pname, params); +// } +// static void glowGetQueryIndexediv(GPGETQUERYINDEXEDIV fnptr, GLenum target, GLuint index, GLenum pname, GLint * params) { +// (*fnptr)(target, index, pname, params); +// } +// static void glowGetQueryObjecti64v(GPGETQUERYOBJECTI64V fnptr, GLuint id, GLenum pname, GLint64 * params) { +// (*fnptr)(id, pname, params); +// } +// static void glowGetQueryObjectiv(GPGETQUERYOBJECTIV fnptr, GLuint id, GLenum pname, GLint * params) { +// (*fnptr)(id, pname, params); +// } +// static void glowGetQueryObjectui64v(GPGETQUERYOBJECTUI64V fnptr, GLuint id, GLenum pname, GLuint64 * params) { +// (*fnptr)(id, pname, params); +// } +// static void glowGetQueryObjectuiv(GPGETQUERYOBJECTUIV fnptr, GLuint id, GLenum pname, GLuint * params) { +// (*fnptr)(id, pname, params); +// } +// static void glowGetQueryiv(GPGETQUERYIV fnptr, GLenum target, GLenum pname, GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetRenderbufferParameteriv(GPGETRENDERBUFFERPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetSamplerParameterIiv(GPGETSAMPLERPARAMETERIIV fnptr, GLuint sampler, GLenum pname, GLint * params) { +// (*fnptr)(sampler, pname, params); +// } +// static void glowGetSamplerParameterIuiv(GPGETSAMPLERPARAMETERIUIV fnptr, GLuint sampler, GLenum pname, GLuint * params) { +// (*fnptr)(sampler, pname, params); +// } +// static void glowGetSamplerParameterfv(GPGETSAMPLERPARAMETERFV fnptr, GLuint sampler, GLenum pname, GLfloat * params) { +// (*fnptr)(sampler, pname, params); +// } +// static void glowGetSamplerParameteriv(GPGETSAMPLERPARAMETERIV fnptr, GLuint sampler, GLenum pname, GLint * params) { +// (*fnptr)(sampler, pname, params); +// } +// static void glowGetShaderInfoLog(GPGETSHADERINFOLOG fnptr, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) { +// (*fnptr)(shader, bufSize, length, infoLog); +// } +// static void glowGetShaderPrecisionFormat(GPGETSHADERPRECISIONFORMAT fnptr, GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision) { +// (*fnptr)(shadertype, precisiontype, range, precision); +// } +// static void glowGetShaderSource(GPGETSHADERSOURCE fnptr, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) { +// (*fnptr)(shader, bufSize, length, source); +// } +// static void glowGetShaderiv(GPGETSHADERIV fnptr, GLuint shader, GLenum pname, GLint * params) { +// (*fnptr)(shader, pname, params); +// } +// static const GLubyte * glowGetString(GPGETSTRING fnptr, GLenum name) { +// return (*fnptr)(name); +// } +// static const GLubyte * glowGetStringi(GPGETSTRINGI fnptr, GLenum name, GLuint index) { +// return (*fnptr)(name, index); +// } +// static GLuint glowGetSubroutineIndex(GPGETSUBROUTINEINDEX fnptr, GLuint program, GLenum shadertype, const GLchar * name) { +// return (*fnptr)(program, shadertype, name); +// } +// static GLint glowGetSubroutineUniformLocation(GPGETSUBROUTINEUNIFORMLOCATION fnptr, GLuint program, GLenum shadertype, const GLchar * name) { +// return (*fnptr)(program, shadertype, name); +// } +// static void glowGetSynciv(GPGETSYNCIV fnptr, GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values) { +// (*fnptr)(sync, pname, bufSize, length, values); +// } +// static void glowGetTexImage(GPGETTEXIMAGE fnptr, GLenum target, GLint level, GLenum format, GLenum type, void * pixels) { +// (*fnptr)(target, level, format, type, pixels); +// } +// static void glowGetTexLevelParameterfv(GPGETTEXLEVELPARAMETERFV fnptr, GLenum target, GLint level, GLenum pname, GLfloat * params) { +// (*fnptr)(target, level, pname, params); +// } +// static void glowGetTexLevelParameteriv(GPGETTEXLEVELPARAMETERIV fnptr, GLenum target, GLint level, GLenum pname, GLint * params) { +// (*fnptr)(target, level, pname, params); +// } +// static void glowGetTexParameterIiv(GPGETTEXPARAMETERIIV fnptr, GLenum target, GLenum pname, GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetTexParameterIuiv(GPGETTEXPARAMETERIUIV fnptr, GLenum target, GLenum pname, GLuint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetTexParameterfv(GPGETTEXPARAMETERFV fnptr, GLenum target, GLenum pname, GLfloat * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowGetTexParameteriv(GPGETTEXPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static GLuint64 glowGetTextureHandleARB(GPGETTEXTUREHANDLEARB fnptr, GLuint texture) { +// return (*fnptr)(texture); +// } +// static void glowGetTextureImage(GPGETTEXTUREIMAGE fnptr, GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * pixels) { +// (*fnptr)(texture, level, format, type, bufSize, pixels); +// } +// static void glowGetTextureLevelParameterfv(GPGETTEXTURELEVELPARAMETERFV fnptr, GLuint texture, GLint level, GLenum pname, GLfloat * params) { +// (*fnptr)(texture, level, pname, params); +// } +// static void glowGetTextureLevelParameteriv(GPGETTEXTURELEVELPARAMETERIV fnptr, GLuint texture, GLint level, GLenum pname, GLint * params) { +// (*fnptr)(texture, level, pname, params); +// } +// static void glowGetTextureParameterIiv(GPGETTEXTUREPARAMETERIIV fnptr, GLuint texture, GLenum pname, GLint * params) { +// (*fnptr)(texture, pname, params); +// } +// static void glowGetTextureParameterIuiv(GPGETTEXTUREPARAMETERIUIV fnptr, GLuint texture, GLenum pname, GLuint * params) { +// (*fnptr)(texture, pname, params); +// } +// static void glowGetTextureParameterfv(GPGETTEXTUREPARAMETERFV fnptr, GLuint texture, GLenum pname, GLfloat * params) { +// (*fnptr)(texture, pname, params); +// } +// static void glowGetTextureParameteriv(GPGETTEXTUREPARAMETERIV fnptr, GLuint texture, GLenum pname, GLint * params) { +// (*fnptr)(texture, pname, params); +// } +// static GLuint64 glowGetTextureSamplerHandleARB(GPGETTEXTURESAMPLERHANDLEARB fnptr, GLuint texture, GLuint sampler) { +// return (*fnptr)(texture, sampler); +// } +// static void glowGetTextureSubImage(GPGETTEXTURESUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void * pixels) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); +// } +// static void glowGetTransformFeedbackVarying(GPGETTRANSFORMFEEDBACKVARYING fnptr, GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) { +// (*fnptr)(program, index, bufSize, length, size, type, name); +// } +// static void glowGetTransformFeedbacki64_v(GPGETTRANSFORMFEEDBACKI64_V fnptr, GLuint xfb, GLenum pname, GLuint index, GLint64 * param) { +// (*fnptr)(xfb, pname, index, param); +// } +// static void glowGetTransformFeedbacki_v(GPGETTRANSFORMFEEDBACKI_V fnptr, GLuint xfb, GLenum pname, GLuint index, GLint * param) { +// (*fnptr)(xfb, pname, index, param); +// } +// static void glowGetTransformFeedbackiv(GPGETTRANSFORMFEEDBACKIV fnptr, GLuint xfb, GLenum pname, GLint * param) { +// (*fnptr)(xfb, pname, param); +// } +// static GLuint glowGetUniformBlockIndex(GPGETUNIFORMBLOCKINDEX fnptr, GLuint program, const GLchar * uniformBlockName) { +// return (*fnptr)(program, uniformBlockName); +// } +// static void glowGetUniformIndices(GPGETUNIFORMINDICES fnptr, GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices) { +// (*fnptr)(program, uniformCount, uniformNames, uniformIndices); +// } +// static GLint glowGetUniformLocation(GPGETUNIFORMLOCATION fnptr, GLuint program, const GLchar * name) { +// return (*fnptr)(program, name); +// } +// static void glowGetUniformSubroutineuiv(GPGETUNIFORMSUBROUTINEUIV fnptr, GLenum shadertype, GLint location, GLuint * params) { +// (*fnptr)(shadertype, location, params); +// } +// static void glowGetUniformdv(GPGETUNIFORMDV fnptr, GLuint program, GLint location, GLdouble * params) { +// (*fnptr)(program, location, params); +// } +// static void glowGetUniformfv(GPGETUNIFORMFV fnptr, GLuint program, GLint location, GLfloat * params) { +// (*fnptr)(program, location, params); +// } +// static void glowGetUniformiv(GPGETUNIFORMIV fnptr, GLuint program, GLint location, GLint * params) { +// (*fnptr)(program, location, params); +// } +// static void glowGetUniformuiv(GPGETUNIFORMUIV fnptr, GLuint program, GLint location, GLuint * params) { +// (*fnptr)(program, location, params); +// } +// static void glowGetVertexArrayIndexed64iv(GPGETVERTEXARRAYINDEXED64IV fnptr, GLuint vaobj, GLuint index, GLenum pname, GLint64 * param) { +// (*fnptr)(vaobj, index, pname, param); +// } +// static void glowGetVertexArrayIndexediv(GPGETVERTEXARRAYINDEXEDIV fnptr, GLuint vaobj, GLuint index, GLenum pname, GLint * param) { +// (*fnptr)(vaobj, index, pname, param); +// } +// static void glowGetVertexArrayiv(GPGETVERTEXARRAYIV fnptr, GLuint vaobj, GLenum pname, GLint * param) { +// (*fnptr)(vaobj, pname, param); +// } +// static void glowGetVertexAttribIiv(GPGETVERTEXATTRIBIIV fnptr, GLuint index, GLenum pname, GLint * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetVertexAttribIuiv(GPGETVERTEXATTRIBIUIV fnptr, GLuint index, GLenum pname, GLuint * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetVertexAttribLdv(GPGETVERTEXATTRIBLDV fnptr, GLuint index, GLenum pname, GLdouble * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetVertexAttribLui64vARB(GPGETVERTEXATTRIBLUI64VARB fnptr, GLuint index, GLenum pname, GLuint64EXT * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetVertexAttribPointerv(GPGETVERTEXATTRIBPOINTERV fnptr, GLuint index, GLenum pname, void ** pointer) { +// (*fnptr)(index, pname, pointer); +// } +// static void glowGetVertexAttribdv(GPGETVERTEXATTRIBDV fnptr, GLuint index, GLenum pname, GLdouble * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetVertexAttribfv(GPGETVERTEXATTRIBFV fnptr, GLuint index, GLenum pname, GLfloat * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetVertexAttribiv(GPGETVERTEXATTRIBIV fnptr, GLuint index, GLenum pname, GLint * params) { +// (*fnptr)(index, pname, params); +// } +// static void glowGetnCompressedTexImageARB(GPGETNCOMPRESSEDTEXIMAGEARB fnptr, GLenum target, GLint lod, GLsizei bufSize, void * img) { +// (*fnptr)(target, lod, bufSize, img); +// } +// static void glowGetnTexImageARB(GPGETNTEXIMAGEARB fnptr, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * img) { +// (*fnptr)(target, level, format, type, bufSize, img); +// } +// static void glowGetnUniformdvARB(GPGETNUNIFORMDVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLdouble * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformfv(GPGETNUNIFORMFV fnptr, GLuint program, GLint location, GLsizei bufSize, GLfloat * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformfvARB(GPGETNUNIFORMFVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLfloat * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformfvKHR(GPGETNUNIFORMFVKHR fnptr, GLuint program, GLint location, GLsizei bufSize, GLfloat * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformiv(GPGETNUNIFORMIV fnptr, GLuint program, GLint location, GLsizei bufSize, GLint * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformivARB(GPGETNUNIFORMIVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLint * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformivKHR(GPGETNUNIFORMIVKHR fnptr, GLuint program, GLint location, GLsizei bufSize, GLint * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformuiv(GPGETNUNIFORMUIV fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformuivARB(GPGETNUNIFORMUIVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowGetnUniformuivKHR(GPGETNUNIFORMUIVKHR fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint * params) { +// (*fnptr)(program, location, bufSize, params); +// } +// static void glowHint(GPHINT fnptr, GLenum target, GLenum mode) { +// (*fnptr)(target, mode); +// } +// static void glowInvalidateBufferData(GPINVALIDATEBUFFERDATA fnptr, GLuint buffer) { +// (*fnptr)(buffer); +// } +// static void glowInvalidateBufferSubData(GPINVALIDATEBUFFERSUBDATA fnptr, GLuint buffer, GLintptr offset, GLsizeiptr length) { +// (*fnptr)(buffer, offset, length); +// } +// static void glowInvalidateFramebuffer(GPINVALIDATEFRAMEBUFFER fnptr, GLenum target, GLsizei numAttachments, const GLenum * attachments) { +// (*fnptr)(target, numAttachments, attachments); +// } +// static void glowInvalidateNamedFramebufferData(GPINVALIDATENAMEDFRAMEBUFFERDATA fnptr, GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments) { +// (*fnptr)(framebuffer, numAttachments, attachments); +// } +// static void glowInvalidateNamedFramebufferSubData(GPINVALIDATENAMEDFRAMEBUFFERSUBDATA fnptr, GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(framebuffer, numAttachments, attachments, x, y, width, height); +// } +// static void glowInvalidateSubFramebuffer(GPINVALIDATESUBFRAMEBUFFER fnptr, GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(target, numAttachments, attachments, x, y, width, height); +// } +// static void glowInvalidateTexImage(GPINVALIDATETEXIMAGE fnptr, GLuint texture, GLint level) { +// (*fnptr)(texture, level); +// } +// static void glowInvalidateTexSubImage(GPINVALIDATETEXSUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth); +// } +// static GLboolean glowIsBuffer(GPISBUFFER fnptr, GLuint buffer) { +// return (*fnptr)(buffer); +// } +// static GLboolean glowIsEnabled(GPISENABLED fnptr, GLenum cap) { +// return (*fnptr)(cap); +// } +// static GLboolean glowIsEnabledi(GPISENABLEDI fnptr, GLenum target, GLuint index) { +// return (*fnptr)(target, index); +// } +// static GLboolean glowIsFramebuffer(GPISFRAMEBUFFER fnptr, GLuint framebuffer) { +// return (*fnptr)(framebuffer); +// } +// static GLboolean glowIsImageHandleResidentARB(GPISIMAGEHANDLERESIDENTARB fnptr, GLuint64 handle) { +// return (*fnptr)(handle); +// } +// static GLboolean glowIsNamedStringARB(GPISNAMEDSTRINGARB fnptr, GLint namelen, const GLchar * name) { +// return (*fnptr)(namelen, name); +// } +// static GLboolean glowIsProgram(GPISPROGRAM fnptr, GLuint program) { +// return (*fnptr)(program); +// } +// static GLboolean glowIsProgramPipeline(GPISPROGRAMPIPELINE fnptr, GLuint pipeline) { +// return (*fnptr)(pipeline); +// } +// static GLboolean glowIsQuery(GPISQUERY fnptr, GLuint id) { +// return (*fnptr)(id); +// } +// static GLboolean glowIsRenderbuffer(GPISRENDERBUFFER fnptr, GLuint renderbuffer) { +// return (*fnptr)(renderbuffer); +// } +// static GLboolean glowIsSampler(GPISSAMPLER fnptr, GLuint sampler) { +// return (*fnptr)(sampler); +// } +// static GLboolean glowIsShader(GPISSHADER fnptr, GLuint shader) { +// return (*fnptr)(shader); +// } +// static GLboolean glowIsSync(GPISSYNC fnptr, GLsync sync) { +// return (*fnptr)(sync); +// } +// static GLboolean glowIsTexture(GPISTEXTURE fnptr, GLuint texture) { +// return (*fnptr)(texture); +// } +// static GLboolean glowIsTextureHandleResidentARB(GPISTEXTUREHANDLERESIDENTARB fnptr, GLuint64 handle) { +// return (*fnptr)(handle); +// } +// static GLboolean glowIsTransformFeedback(GPISTRANSFORMFEEDBACK fnptr, GLuint id) { +// return (*fnptr)(id); +// } +// static GLboolean glowIsVertexArray(GPISVERTEXARRAY fnptr, GLuint array) { +// return (*fnptr)(array); +// } +// static void glowLineWidth(GPLINEWIDTH fnptr, GLfloat width) { +// (*fnptr)(width); +// } +// static void glowLinkProgram(GPLINKPROGRAM fnptr, GLuint program) { +// (*fnptr)(program); +// } +// static void glowLogicOp(GPLOGICOP fnptr, GLenum opcode) { +// (*fnptr)(opcode); +// } +// static void glowMakeImageHandleNonResidentARB(GPMAKEIMAGEHANDLENONRESIDENTARB fnptr, GLuint64 handle) { +// (*fnptr)(handle); +// } +// static void glowMakeImageHandleResidentARB(GPMAKEIMAGEHANDLERESIDENTARB fnptr, GLuint64 handle, GLenum access) { +// (*fnptr)(handle, access); +// } +// static void glowMakeTextureHandleNonResidentARB(GPMAKETEXTUREHANDLENONRESIDENTARB fnptr, GLuint64 handle) { +// (*fnptr)(handle); +// } +// static void glowMakeTextureHandleResidentARB(GPMAKETEXTUREHANDLERESIDENTARB fnptr, GLuint64 handle) { +// (*fnptr)(handle); +// } +// static void * glowMapBuffer(GPMAPBUFFER fnptr, GLenum target, GLenum access) { +// return (*fnptr)(target, access); +// } +// static void * glowMapBufferRange(GPMAPBUFFERRANGE fnptr, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) { +// return (*fnptr)(target, offset, length, access); +// } +// static void * glowMapNamedBuffer(GPMAPNAMEDBUFFER fnptr, GLuint buffer, GLenum access) { +// return (*fnptr)(buffer, access); +// } +// static void * glowMapNamedBufferRange(GPMAPNAMEDBUFFERRANGE fnptr, GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access) { +// return (*fnptr)(buffer, offset, length, access); +// } +// static void glowMemoryBarrier(GPMEMORYBARRIER fnptr, GLbitfield barriers) { +// (*fnptr)(barriers); +// } +// static void glowMemoryBarrierByRegion(GPMEMORYBARRIERBYREGION fnptr, GLbitfield barriers) { +// (*fnptr)(barriers); +// } +// static void glowMinSampleShadingARB(GPMINSAMPLESHADINGARB fnptr, GLfloat value) { +// (*fnptr)(value); +// } +// static void glowMultiDrawArrays(GPMULTIDRAWARRAYS fnptr, GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount) { +// (*fnptr)(mode, first, count, drawcount); +// } +// static void glowMultiDrawArraysIndirect(GPMULTIDRAWARRAYSINDIRECT fnptr, GLenum mode, const void * indirect, GLsizei drawcount, GLsizei stride) { +// (*fnptr)(mode, indirect, drawcount, stride); +// } +// static void glowMultiDrawArraysIndirectCountARB(GPMULTIDRAWARRAYSINDIRECTCOUNTARB fnptr, GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) { +// (*fnptr)(mode, indirect, drawcount, maxdrawcount, stride); +// } +// static void glowMultiDrawElements(GPMULTIDRAWELEMENTS fnptr, GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount) { +// (*fnptr)(mode, count, type, indices, drawcount); +// } +// static void glowMultiDrawElementsBaseVertex(GPMULTIDRAWELEMENTSBASEVERTEX fnptr, GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex) { +// (*fnptr)(mode, count, type, indices, drawcount, basevertex); +// } +// static void glowMultiDrawElementsIndirect(GPMULTIDRAWELEMENTSINDIRECT fnptr, GLenum mode, GLenum type, const void * indirect, GLsizei drawcount, GLsizei stride) { +// (*fnptr)(mode, type, indirect, drawcount, stride); +// } +// static void glowMultiDrawElementsIndirectCountARB(GPMULTIDRAWELEMENTSINDIRECTCOUNTARB fnptr, GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) { +// (*fnptr)(mode, type, indirect, drawcount, maxdrawcount, stride); +// } +// static void glowNamedBufferData(GPNAMEDBUFFERDATA fnptr, GLuint buffer, GLsizei size, const void * data, GLenum usage) { +// (*fnptr)(buffer, size, data, usage); +// } +// static void glowNamedBufferPageCommitmentARB(GPNAMEDBUFFERPAGECOMMITMENTARB fnptr, GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit) { +// (*fnptr)(buffer, offset, size, commit); +// } +// static void glowNamedBufferPageCommitmentEXT(GPNAMEDBUFFERPAGECOMMITMENTEXT fnptr, GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit) { +// (*fnptr)(buffer, offset, size, commit); +// } +// static void glowNamedBufferStorage(GPNAMEDBUFFERSTORAGE fnptr, GLuint buffer, GLsizei size, const void * data, GLbitfield flags) { +// (*fnptr)(buffer, size, data, flags); +// } +// static void glowNamedBufferSubData(GPNAMEDBUFFERSUBDATA fnptr, GLuint buffer, GLintptr offset, GLsizei size, const void * data) { +// (*fnptr)(buffer, offset, size, data); +// } +// static void glowNamedFramebufferDrawBuffer(GPNAMEDFRAMEBUFFERDRAWBUFFER fnptr, GLuint framebuffer, GLenum buf) { +// (*fnptr)(framebuffer, buf); +// } +// static void glowNamedFramebufferDrawBuffers(GPNAMEDFRAMEBUFFERDRAWBUFFERS fnptr, GLuint framebuffer, GLsizei n, const GLenum * bufs) { +// (*fnptr)(framebuffer, n, bufs); +// } +// static void glowNamedFramebufferParameteri(GPNAMEDFRAMEBUFFERPARAMETERI fnptr, GLuint framebuffer, GLenum pname, GLint param) { +// (*fnptr)(framebuffer, pname, param); +// } +// static void glowNamedFramebufferReadBuffer(GPNAMEDFRAMEBUFFERREADBUFFER fnptr, GLuint framebuffer, GLenum src) { +// (*fnptr)(framebuffer, src); +// } +// static void glowNamedFramebufferRenderbuffer(GPNAMEDFRAMEBUFFERRENDERBUFFER fnptr, GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { +// (*fnptr)(framebuffer, attachment, renderbuffertarget, renderbuffer); +// } +// static void glowNamedFramebufferTexture(GPNAMEDFRAMEBUFFERTEXTURE fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) { +// (*fnptr)(framebuffer, attachment, texture, level); +// } +// static void glowNamedFramebufferTextureLayer(GPNAMEDFRAMEBUFFERTEXTURELAYER fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) { +// (*fnptr)(framebuffer, attachment, texture, level, layer); +// } +// static void glowNamedRenderbufferStorage(GPNAMEDRENDERBUFFERSTORAGE fnptr, GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) { +// (*fnptr)(renderbuffer, internalformat, width, height); +// } +// static void glowNamedRenderbufferStorageMultisample(GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE fnptr, GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { +// (*fnptr)(renderbuffer, samples, internalformat, width, height); +// } +// static void glowNamedStringARB(GPNAMEDSTRINGARB fnptr, GLenum type, GLint namelen, const GLchar * name, GLint stringlen, const GLchar * string) { +// (*fnptr)(type, namelen, name, stringlen, string); +// } +// static void glowObjectLabel(GPOBJECTLABEL fnptr, GLenum identifier, GLuint name, GLsizei length, const GLchar * label) { +// (*fnptr)(identifier, name, length, label); +// } +// static void glowObjectLabelKHR(GPOBJECTLABELKHR fnptr, GLenum identifier, GLuint name, GLsizei length, const GLchar * label) { +// (*fnptr)(identifier, name, length, label); +// } +// static void glowObjectPtrLabel(GPOBJECTPTRLABEL fnptr, const void * ptr, GLsizei length, const GLchar * label) { +// (*fnptr)(ptr, length, label); +// } +// static void glowObjectPtrLabelKHR(GPOBJECTPTRLABELKHR fnptr, const void * ptr, GLsizei length, const GLchar * label) { +// (*fnptr)(ptr, length, label); +// } +// static void glowPatchParameterfv(GPPATCHPARAMETERFV fnptr, GLenum pname, const GLfloat * values) { +// (*fnptr)(pname, values); +// } +// static void glowPatchParameteri(GPPATCHPARAMETERI fnptr, GLenum pname, GLint value) { +// (*fnptr)(pname, value); +// } +// static void glowPauseTransformFeedback(GPPAUSETRANSFORMFEEDBACK fnptr) { +// (*fnptr)(); +// } +// static void glowPixelStoref(GPPIXELSTOREF fnptr, GLenum pname, GLfloat param) { +// (*fnptr)(pname, param); +// } +// static void glowPixelStorei(GPPIXELSTOREI fnptr, GLenum pname, GLint param) { +// (*fnptr)(pname, param); +// } +// static void glowPointParameterf(GPPOINTPARAMETERF fnptr, GLenum pname, GLfloat param) { +// (*fnptr)(pname, param); +// } +// static void glowPointParameterfv(GPPOINTPARAMETERFV fnptr, GLenum pname, const GLfloat * params) { +// (*fnptr)(pname, params); +// } +// static void glowPointParameteri(GPPOINTPARAMETERI fnptr, GLenum pname, GLint param) { +// (*fnptr)(pname, param); +// } +// static void glowPointParameteriv(GPPOINTPARAMETERIV fnptr, GLenum pname, const GLint * params) { +// (*fnptr)(pname, params); +// } +// static void glowPointSize(GPPOINTSIZE fnptr, GLfloat size) { +// (*fnptr)(size); +// } +// static void glowPolygonMode(GPPOLYGONMODE fnptr, GLenum face, GLenum mode) { +// (*fnptr)(face, mode); +// } +// static void glowPolygonOffset(GPPOLYGONOFFSET fnptr, GLfloat factor, GLfloat units) { +// (*fnptr)(factor, units); +// } +// static void glowPopDebugGroup(GPPOPDEBUGGROUP fnptr) { +// (*fnptr)(); +// } +// static void glowPopDebugGroupKHR(GPPOPDEBUGGROUPKHR fnptr) { +// (*fnptr)(); +// } +// static void glowPrimitiveRestartIndex(GPPRIMITIVERESTARTINDEX fnptr, GLuint index) { +// (*fnptr)(index); +// } +// static void glowProgramBinary(GPPROGRAMBINARY fnptr, GLuint program, GLenum binaryFormat, const void * binary, GLsizei length) { +// (*fnptr)(program, binaryFormat, binary, length); +// } +// static void glowProgramParameteri(GPPROGRAMPARAMETERI fnptr, GLuint program, GLenum pname, GLint value) { +// (*fnptr)(program, pname, value); +// } +// static void glowProgramUniform1d(GPPROGRAMUNIFORM1D fnptr, GLuint program, GLint location, GLdouble v0) { +// (*fnptr)(program, location, v0); +// } +// static void glowProgramUniform1dv(GPPROGRAMUNIFORM1DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform1f(GPPROGRAMUNIFORM1F fnptr, GLuint program, GLint location, GLfloat v0) { +// (*fnptr)(program, location, v0); +// } +// static void glowProgramUniform1fv(GPPROGRAMUNIFORM1FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform1i(GPPROGRAMUNIFORM1I fnptr, GLuint program, GLint location, GLint v0) { +// (*fnptr)(program, location, v0); +// } +// static void glowProgramUniform1iv(GPPROGRAMUNIFORM1IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform1ui(GPPROGRAMUNIFORM1UI fnptr, GLuint program, GLint location, GLuint v0) { +// (*fnptr)(program, location, v0); +// } +// static void glowProgramUniform1uiv(GPPROGRAMUNIFORM1UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform2d(GPPROGRAMUNIFORM2D fnptr, GLuint program, GLint location, GLdouble v0, GLdouble v1) { +// (*fnptr)(program, location, v0, v1); +// } +// static void glowProgramUniform2dv(GPPROGRAMUNIFORM2DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform2f(GPPROGRAMUNIFORM2F fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1) { +// (*fnptr)(program, location, v0, v1); +// } +// static void glowProgramUniform2fv(GPPROGRAMUNIFORM2FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform2i(GPPROGRAMUNIFORM2I fnptr, GLuint program, GLint location, GLint v0, GLint v1) { +// (*fnptr)(program, location, v0, v1); +// } +// static void glowProgramUniform2iv(GPPROGRAMUNIFORM2IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform2ui(GPPROGRAMUNIFORM2UI fnptr, GLuint program, GLint location, GLuint v0, GLuint v1) { +// (*fnptr)(program, location, v0, v1); +// } +// static void glowProgramUniform2uiv(GPPROGRAMUNIFORM2UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform3d(GPPROGRAMUNIFORM3D fnptr, GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2) { +// (*fnptr)(program, location, v0, v1, v2); +// } +// static void glowProgramUniform3dv(GPPROGRAMUNIFORM3DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform3f(GPPROGRAMUNIFORM3F fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) { +// (*fnptr)(program, location, v0, v1, v2); +// } +// static void glowProgramUniform3fv(GPPROGRAMUNIFORM3FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform3i(GPPROGRAMUNIFORM3I fnptr, GLuint program, GLint location, GLint v0, GLint v1, GLint v2) { +// (*fnptr)(program, location, v0, v1, v2); +// } +// static void glowProgramUniform3iv(GPPROGRAMUNIFORM3IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform3ui(GPPROGRAMUNIFORM3UI fnptr, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) { +// (*fnptr)(program, location, v0, v1, v2); +// } +// static void glowProgramUniform3uiv(GPPROGRAMUNIFORM3UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform4d(GPPROGRAMUNIFORM4D fnptr, GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3) { +// (*fnptr)(program, location, v0, v1, v2, v3); +// } +// static void glowProgramUniform4dv(GPPROGRAMUNIFORM4DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform4f(GPPROGRAMUNIFORM4F fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { +// (*fnptr)(program, location, v0, v1, v2, v3); +// } +// static void glowProgramUniform4fv(GPPROGRAMUNIFORM4FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform4i(GPPROGRAMUNIFORM4I fnptr, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) { +// (*fnptr)(program, location, v0, v1, v2, v3); +// } +// static void glowProgramUniform4iv(GPPROGRAMUNIFORM4IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniform4ui(GPPROGRAMUNIFORM4UI fnptr, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) { +// (*fnptr)(program, location, v0, v1, v2, v3); +// } +// static void glowProgramUniform4uiv(GPPROGRAMUNIFORM4UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(program, location, count, value); +// } +// static void glowProgramUniformHandleui64ARB(GPPROGRAMUNIFORMHANDLEUI64ARB fnptr, GLuint program, GLint location, GLuint64 value) { +// (*fnptr)(program, location, value); +// } +// static void glowProgramUniformHandleui64vARB(GPPROGRAMUNIFORMHANDLEUI64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * values) { +// (*fnptr)(program, location, count, values); +// } +// static void glowProgramUniformMatrix2dv(GPPROGRAMUNIFORMMATRIX2DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix2fv(GPPROGRAMUNIFORMMATRIX2FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix2x3dv(GPPROGRAMUNIFORMMATRIX2X3DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix2x3fv(GPPROGRAMUNIFORMMATRIX2X3FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix2x4dv(GPPROGRAMUNIFORMMATRIX2X4DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix2x4fv(GPPROGRAMUNIFORMMATRIX2X4FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix3dv(GPPROGRAMUNIFORMMATRIX3DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix3fv(GPPROGRAMUNIFORMMATRIX3FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix3x2dv(GPPROGRAMUNIFORMMATRIX3X2DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix3x2fv(GPPROGRAMUNIFORMMATRIX3X2FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix3x4dv(GPPROGRAMUNIFORMMATRIX3X4DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix3x4fv(GPPROGRAMUNIFORMMATRIX3X4FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix4dv(GPPROGRAMUNIFORMMATRIX4DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix4fv(GPPROGRAMUNIFORMMATRIX4FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix4x2dv(GPPROGRAMUNIFORMMATRIX4X2DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix4x2fv(GPPROGRAMUNIFORMMATRIX4X2FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix4x3dv(GPPROGRAMUNIFORMMATRIX4X3DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProgramUniformMatrix4x3fv(GPPROGRAMUNIFORMMATRIX4X3FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(program, location, count, transpose, value); +// } +// static void glowProvokingVertex(GPPROVOKINGVERTEX fnptr, GLenum mode) { +// (*fnptr)(mode); +// } +// static void glowPushDebugGroup(GPPUSHDEBUGGROUP fnptr, GLenum source, GLuint id, GLsizei length, const GLchar * message) { +// (*fnptr)(source, id, length, message); +// } +// static void glowPushDebugGroupKHR(GPPUSHDEBUGGROUPKHR fnptr, GLenum source, GLuint id, GLsizei length, const GLchar * message) { +// (*fnptr)(source, id, length, message); +// } +// static void glowQueryCounter(GPQUERYCOUNTER fnptr, GLuint id, GLenum target) { +// (*fnptr)(id, target); +// } +// static void glowReadBuffer(GPREADBUFFER fnptr, GLenum src) { +// (*fnptr)(src); +// } +// static void glowReadPixels(GPREADPIXELS fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels) { +// (*fnptr)(x, y, width, height, format, type, pixels); +// } +// static void glowReadnPixels(GPREADNPIXELS fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) { +// (*fnptr)(x, y, width, height, format, type, bufSize, data); +// } +// static void glowReadnPixelsARB(GPREADNPIXELSARB fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) { +// (*fnptr)(x, y, width, height, format, type, bufSize, data); +// } +// static void glowReadnPixelsKHR(GPREADNPIXELSKHR fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) { +// (*fnptr)(x, y, width, height, format, type, bufSize, data); +// } +// static void glowReleaseShaderCompiler(GPRELEASESHADERCOMPILER fnptr) { +// (*fnptr)(); +// } +// static void glowRenderbufferStorage(GPRENDERBUFFERSTORAGE fnptr, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { +// (*fnptr)(target, internalformat, width, height); +// } +// static void glowRenderbufferStorageMultisample(GPRENDERBUFFERSTORAGEMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { +// (*fnptr)(target, samples, internalformat, width, height); +// } +// static void glowResumeTransformFeedback(GPRESUMETRANSFORMFEEDBACK fnptr) { +// (*fnptr)(); +// } +// static void glowSampleCoverage(GPSAMPLECOVERAGE fnptr, GLfloat value, GLboolean invert) { +// (*fnptr)(value, invert); +// } +// static void glowSampleMaski(GPSAMPLEMASKI fnptr, GLuint maskNumber, GLbitfield mask) { +// (*fnptr)(maskNumber, mask); +// } +// static void glowSamplerParameterIiv(GPSAMPLERPARAMETERIIV fnptr, GLuint sampler, GLenum pname, const GLint * param) { +// (*fnptr)(sampler, pname, param); +// } +// static void glowSamplerParameterIuiv(GPSAMPLERPARAMETERIUIV fnptr, GLuint sampler, GLenum pname, const GLuint * param) { +// (*fnptr)(sampler, pname, param); +// } +// static void glowSamplerParameterf(GPSAMPLERPARAMETERF fnptr, GLuint sampler, GLenum pname, GLfloat param) { +// (*fnptr)(sampler, pname, param); +// } +// static void glowSamplerParameterfv(GPSAMPLERPARAMETERFV fnptr, GLuint sampler, GLenum pname, const GLfloat * param) { +// (*fnptr)(sampler, pname, param); +// } +// static void glowSamplerParameteri(GPSAMPLERPARAMETERI fnptr, GLuint sampler, GLenum pname, GLint param) { +// (*fnptr)(sampler, pname, param); +// } +// static void glowSamplerParameteriv(GPSAMPLERPARAMETERIV fnptr, GLuint sampler, GLenum pname, const GLint * param) { +// (*fnptr)(sampler, pname, param); +// } +// static void glowScissor(GPSCISSOR fnptr, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(x, y, width, height); +// } +// static void glowScissorArrayv(GPSCISSORARRAYV fnptr, GLuint first, GLsizei count, const GLint * v) { +// (*fnptr)(first, count, v); +// } +// static void glowScissorIndexed(GPSCISSORINDEXED fnptr, GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height) { +// (*fnptr)(index, left, bottom, width, height); +// } +// static void glowScissorIndexedv(GPSCISSORINDEXEDV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowShaderBinary(GPSHADERBINARY fnptr, GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length) { +// (*fnptr)(count, shaders, binaryformat, binary, length); +// } +// static void glowShaderSource(GPSHADERSOURCE fnptr, GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length) { +// (*fnptr)(shader, count, string, length); +// } +// static void glowShaderStorageBlockBinding(GPSHADERSTORAGEBLOCKBINDING fnptr, GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding) { +// (*fnptr)(program, storageBlockIndex, storageBlockBinding); +// } +// static void glowStencilFunc(GPSTENCILFUNC fnptr, GLenum func, GLint ref, GLuint mask) { +// (*fnptr)(func, ref, mask); +// } +// static void glowStencilFuncSeparate(GPSTENCILFUNCSEPARATE fnptr, GLenum face, GLenum func, GLint ref, GLuint mask) { +// (*fnptr)(face, func, ref, mask); +// } +// static void glowStencilMask(GPSTENCILMASK fnptr, GLuint mask) { +// (*fnptr)(mask); +// } +// static void glowStencilMaskSeparate(GPSTENCILMASKSEPARATE fnptr, GLenum face, GLuint mask) { +// (*fnptr)(face, mask); +// } +// static void glowStencilOp(GPSTENCILOP fnptr, GLenum fail, GLenum zfail, GLenum zpass) { +// (*fnptr)(fail, zfail, zpass); +// } +// static void glowStencilOpSeparate(GPSTENCILOPSEPARATE fnptr, GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) { +// (*fnptr)(face, sfail, dpfail, dppass); +// } +// static void glowTexBuffer(GPTEXBUFFER fnptr, GLenum target, GLenum internalformat, GLuint buffer) { +// (*fnptr)(target, internalformat, buffer); +// } +// static void glowTexBufferRange(GPTEXBUFFERRANGE fnptr, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) { +// (*fnptr)(target, internalformat, buffer, offset, size); +// } +// static void glowTexImage1D(GPTEXIMAGE1D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(target, level, internalformat, width, border, format, type, pixels); +// } +// static void glowTexImage2D(GPTEXIMAGE2D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(target, level, internalformat, width, height, border, format, type, pixels); +// } +// static void glowTexImage2DMultisample(GPTEXIMAGE2DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) { +// (*fnptr)(target, samples, internalformat, width, height, fixedsamplelocations); +// } +// static void glowTexImage3D(GPTEXIMAGE3D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(target, level, internalformat, width, height, depth, border, format, type, pixels); +// } +// static void glowTexImage3DMultisample(GPTEXIMAGE3DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) { +// (*fnptr)(target, samples, internalformat, width, height, depth, fixedsamplelocations); +// } +// static void glowTexPageCommitmentARB(GPTEXPAGECOMMITMENTARB fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident) { +// (*fnptr)(target, level, xoffset, yoffset, zoffset, width, height, depth, resident); +// } +// static void glowTexParameterIiv(GPTEXPARAMETERIIV fnptr, GLenum target, GLenum pname, const GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowTexParameterIuiv(GPTEXPARAMETERIUIV fnptr, GLenum target, GLenum pname, const GLuint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowTexParameterf(GPTEXPARAMETERF fnptr, GLenum target, GLenum pname, GLfloat param) { +// (*fnptr)(target, pname, param); +// } +// static void glowTexParameterfv(GPTEXPARAMETERFV fnptr, GLenum target, GLenum pname, const GLfloat * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowTexParameteri(GPTEXPARAMETERI fnptr, GLenum target, GLenum pname, GLint param) { +// (*fnptr)(target, pname, param); +// } +// static void glowTexParameteriv(GPTEXPARAMETERIV fnptr, GLenum target, GLenum pname, const GLint * params) { +// (*fnptr)(target, pname, params); +// } +// static void glowTexStorage1D(GPTEXSTORAGE1D fnptr, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) { +// (*fnptr)(target, levels, internalformat, width); +// } +// static void glowTexStorage2D(GPTEXSTORAGE2D fnptr, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) { +// (*fnptr)(target, levels, internalformat, width, height); +// } +// static void glowTexStorage2DMultisample(GPTEXSTORAGE2DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) { +// (*fnptr)(target, samples, internalformat, width, height, fixedsamplelocations); +// } +// static void glowTexStorage3D(GPTEXSTORAGE3D fnptr, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) { +// (*fnptr)(target, levels, internalformat, width, height, depth); +// } +// static void glowTexStorage3DMultisample(GPTEXSTORAGE3DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) { +// (*fnptr)(target, samples, internalformat, width, height, depth, fixedsamplelocations); +// } +// static void glowTexSubImage1D(GPTEXSUBIMAGE1D fnptr, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(target, level, xoffset, width, format, type, pixels); +// } +// static void glowTexSubImage2D(GPTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(target, level, xoffset, yoffset, width, height, format, type, pixels); +// } +// static void glowTexSubImage3D(GPTEXSUBIMAGE3D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); +// } +// static void glowTextureBarrier(GPTEXTUREBARRIER fnptr) { +// (*fnptr)(); +// } +// static void glowTextureBuffer(GPTEXTUREBUFFER fnptr, GLuint texture, GLenum internalformat, GLuint buffer) { +// (*fnptr)(texture, internalformat, buffer); +// } +// static void glowTextureBufferRange(GPTEXTUREBUFFERRANGE fnptr, GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size) { +// (*fnptr)(texture, internalformat, buffer, offset, size); +// } +// static void glowTextureParameterIiv(GPTEXTUREPARAMETERIIV fnptr, GLuint texture, GLenum pname, const GLint * params) { +// (*fnptr)(texture, pname, params); +// } +// static void glowTextureParameterIuiv(GPTEXTUREPARAMETERIUIV fnptr, GLuint texture, GLenum pname, const GLuint * params) { +// (*fnptr)(texture, pname, params); +// } +// static void glowTextureParameterf(GPTEXTUREPARAMETERF fnptr, GLuint texture, GLenum pname, GLfloat param) { +// (*fnptr)(texture, pname, param); +// } +// static void glowTextureParameterfv(GPTEXTUREPARAMETERFV fnptr, GLuint texture, GLenum pname, const GLfloat * param) { +// (*fnptr)(texture, pname, param); +// } +// static void glowTextureParameteri(GPTEXTUREPARAMETERI fnptr, GLuint texture, GLenum pname, GLint param) { +// (*fnptr)(texture, pname, param); +// } +// static void glowTextureParameteriv(GPTEXTUREPARAMETERIV fnptr, GLuint texture, GLenum pname, const GLint * param) { +// (*fnptr)(texture, pname, param); +// } +// static void glowTextureStorage1D(GPTEXTURESTORAGE1D fnptr, GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width) { +// (*fnptr)(texture, levels, internalformat, width); +// } +// static void glowTextureStorage2D(GPTEXTURESTORAGE2D fnptr, GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) { +// (*fnptr)(texture, levels, internalformat, width, height); +// } +// static void glowTextureStorage2DMultisample(GPTEXTURESTORAGE2DMULTISAMPLE fnptr, GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) { +// (*fnptr)(texture, samples, internalformat, width, height, fixedsamplelocations); +// } +// static void glowTextureStorage3D(GPTEXTURESTORAGE3D fnptr, GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) { +// (*fnptr)(texture, levels, internalformat, width, height, depth); +// } +// static void glowTextureStorage3DMultisample(GPTEXTURESTORAGE3DMULTISAMPLE fnptr, GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) { +// (*fnptr)(texture, samples, internalformat, width, height, depth, fixedsamplelocations); +// } +// static void glowTextureSubImage1D(GPTEXTURESUBIMAGE1D fnptr, GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(texture, level, xoffset, width, format, type, pixels); +// } +// static void glowTextureSubImage2D(GPTEXTURESUBIMAGE2D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(texture, level, xoffset, yoffset, width, height, format, type, pixels); +// } +// static void glowTextureSubImage3D(GPTEXTURESUBIMAGE3D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) { +// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); +// } +// static void glowTextureView(GPTEXTUREVIEW fnptr, GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) { +// (*fnptr)(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers); +// } +// static void glowTransformFeedbackBufferBase(GPTRANSFORMFEEDBACKBUFFERBASE fnptr, GLuint xfb, GLuint index, GLuint buffer) { +// (*fnptr)(xfb, index, buffer); +// } +// static void glowTransformFeedbackBufferRange(GPTRANSFORMFEEDBACKBUFFERRANGE fnptr, GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size) { +// (*fnptr)(xfb, index, buffer, offset, size); +// } +// static void glowTransformFeedbackVaryings(GPTRANSFORMFEEDBACKVARYINGS fnptr, GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode) { +// (*fnptr)(program, count, varyings, bufferMode); +// } +// static void glowUniform1d(GPUNIFORM1D fnptr, GLint location, GLdouble x) { +// (*fnptr)(location, x); +// } +// static void glowUniform1dv(GPUNIFORM1DV fnptr, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform1f(GPUNIFORM1F fnptr, GLint location, GLfloat v0) { +// (*fnptr)(location, v0); +// } +// static void glowUniform1fv(GPUNIFORM1FV fnptr, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform1i(GPUNIFORM1I fnptr, GLint location, GLint v0) { +// (*fnptr)(location, v0); +// } +// static void glowUniform1iv(GPUNIFORM1IV fnptr, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform1ui(GPUNIFORM1UI fnptr, GLint location, GLuint v0) { +// (*fnptr)(location, v0); +// } +// static void glowUniform1uiv(GPUNIFORM1UIV fnptr, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform2d(GPUNIFORM2D fnptr, GLint location, GLdouble x, GLdouble y) { +// (*fnptr)(location, x, y); +// } +// static void glowUniform2dv(GPUNIFORM2DV fnptr, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform2f(GPUNIFORM2F fnptr, GLint location, GLfloat v0, GLfloat v1) { +// (*fnptr)(location, v0, v1); +// } +// static void glowUniform2fv(GPUNIFORM2FV fnptr, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform2i(GPUNIFORM2I fnptr, GLint location, GLint v0, GLint v1) { +// (*fnptr)(location, v0, v1); +// } +// static void glowUniform2iv(GPUNIFORM2IV fnptr, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform2ui(GPUNIFORM2UI fnptr, GLint location, GLuint v0, GLuint v1) { +// (*fnptr)(location, v0, v1); +// } +// static void glowUniform2uiv(GPUNIFORM2UIV fnptr, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform3d(GPUNIFORM3D fnptr, GLint location, GLdouble x, GLdouble y, GLdouble z) { +// (*fnptr)(location, x, y, z); +// } +// static void glowUniform3dv(GPUNIFORM3DV fnptr, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform3f(GPUNIFORM3F fnptr, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) { +// (*fnptr)(location, v0, v1, v2); +// } +// static void glowUniform3fv(GPUNIFORM3FV fnptr, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform3i(GPUNIFORM3I fnptr, GLint location, GLint v0, GLint v1, GLint v2) { +// (*fnptr)(location, v0, v1, v2); +// } +// static void glowUniform3iv(GPUNIFORM3IV fnptr, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform3ui(GPUNIFORM3UI fnptr, GLint location, GLuint v0, GLuint v1, GLuint v2) { +// (*fnptr)(location, v0, v1, v2); +// } +// static void glowUniform3uiv(GPUNIFORM3UIV fnptr, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform4d(GPUNIFORM4D fnptr, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { +// (*fnptr)(location, x, y, z, w); +// } +// static void glowUniform4dv(GPUNIFORM4DV fnptr, GLint location, GLsizei count, const GLdouble * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform4f(GPUNIFORM4F fnptr, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { +// (*fnptr)(location, v0, v1, v2, v3); +// } +// static void glowUniform4fv(GPUNIFORM4FV fnptr, GLint location, GLsizei count, const GLfloat * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform4i(GPUNIFORM4I fnptr, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) { +// (*fnptr)(location, v0, v1, v2, v3); +// } +// static void glowUniform4iv(GPUNIFORM4IV fnptr, GLint location, GLsizei count, const GLint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniform4ui(GPUNIFORM4UI fnptr, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) { +// (*fnptr)(location, v0, v1, v2, v3); +// } +// static void glowUniform4uiv(GPUNIFORM4UIV fnptr, GLint location, GLsizei count, const GLuint * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniformBlockBinding(GPUNIFORMBLOCKBINDING fnptr, GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) { +// (*fnptr)(program, uniformBlockIndex, uniformBlockBinding); +// } +// static void glowUniformHandleui64ARB(GPUNIFORMHANDLEUI64ARB fnptr, GLint location, GLuint64 value) { +// (*fnptr)(location, value); +// } +// static void glowUniformHandleui64vARB(GPUNIFORMHANDLEUI64VARB fnptr, GLint location, GLsizei count, const GLuint64 * value) { +// (*fnptr)(location, count, value); +// } +// static void glowUniformMatrix2dv(GPUNIFORMMATRIX2DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix2fv(GPUNIFORMMATRIX2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix2x3dv(GPUNIFORMMATRIX2X3DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix2x3fv(GPUNIFORMMATRIX2X3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix2x4dv(GPUNIFORMMATRIX2X4DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix2x4fv(GPUNIFORMMATRIX2X4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix3dv(GPUNIFORMMATRIX3DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix3fv(GPUNIFORMMATRIX3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix3x2dv(GPUNIFORMMATRIX3X2DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix3x2fv(GPUNIFORMMATRIX3X2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix3x4dv(GPUNIFORMMATRIX3X4DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix3x4fv(GPUNIFORMMATRIX3X4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix4dv(GPUNIFORMMATRIX4DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix4fv(GPUNIFORMMATRIX4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix4x2dv(GPUNIFORMMATRIX4X2DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix4x2fv(GPUNIFORMMATRIX4X2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix4x3dv(GPUNIFORMMATRIX4X3DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformMatrix4x3fv(GPUNIFORMMATRIX4X3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { +// (*fnptr)(location, count, transpose, value); +// } +// static void glowUniformSubroutinesuiv(GPUNIFORMSUBROUTINESUIV fnptr, GLenum shadertype, GLsizei count, const GLuint * indices) { +// (*fnptr)(shadertype, count, indices); +// } +// static GLboolean glowUnmapBuffer(GPUNMAPBUFFER fnptr, GLenum target) { +// return (*fnptr)(target); +// } +// static GLboolean glowUnmapNamedBuffer(GPUNMAPNAMEDBUFFER fnptr, GLuint buffer) { +// return (*fnptr)(buffer); +// } +// static void glowUseProgram(GPUSEPROGRAM fnptr, GLuint program) { +// (*fnptr)(program); +// } +// static void glowUseProgramStages(GPUSEPROGRAMSTAGES fnptr, GLuint pipeline, GLbitfield stages, GLuint program) { +// (*fnptr)(pipeline, stages, program); +// } +// static void glowValidateProgram(GPVALIDATEPROGRAM fnptr, GLuint program) { +// (*fnptr)(program); +// } +// static void glowValidateProgramPipeline(GPVALIDATEPROGRAMPIPELINE fnptr, GLuint pipeline) { +// (*fnptr)(pipeline); +// } +// static void glowVertexArrayAttribBinding(GPVERTEXARRAYATTRIBBINDING fnptr, GLuint vaobj, GLuint attribindex, GLuint bindingindex) { +// (*fnptr)(vaobj, attribindex, bindingindex); +// } +// static void glowVertexArrayAttribFormat(GPVERTEXARRAYATTRIBFORMAT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) { +// (*fnptr)(vaobj, attribindex, size, type, normalized, relativeoffset); +// } +// static void glowVertexArrayAttribIFormat(GPVERTEXARRAYATTRIBIFORMAT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) { +// (*fnptr)(vaobj, attribindex, size, type, relativeoffset); +// } +// static void glowVertexArrayAttribLFormat(GPVERTEXARRAYATTRIBLFORMAT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) { +// (*fnptr)(vaobj, attribindex, size, type, relativeoffset); +// } +// static void glowVertexArrayBindingDivisor(GPVERTEXARRAYBINDINGDIVISOR fnptr, GLuint vaobj, GLuint bindingindex, GLuint divisor) { +// (*fnptr)(vaobj, bindingindex, divisor); +// } +// static void glowVertexArrayElementBuffer(GPVERTEXARRAYELEMENTBUFFER fnptr, GLuint vaobj, GLuint buffer) { +// (*fnptr)(vaobj, buffer); +// } +// static void glowVertexArrayVertexBuffer(GPVERTEXARRAYVERTEXBUFFER fnptr, GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) { +// (*fnptr)(vaobj, bindingindex, buffer, offset, stride); +// } +// static void glowVertexArrayVertexBuffers(GPVERTEXARRAYVERTEXBUFFERS fnptr, GLuint vaobj, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides) { +// (*fnptr)(vaobj, first, count, buffers, offsets, strides); +// } +// static void glowVertexAttrib1d(GPVERTEXATTRIB1D fnptr, GLuint index, GLdouble x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttrib1dv(GPVERTEXATTRIB1DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib1f(GPVERTEXATTRIB1F fnptr, GLuint index, GLfloat x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttrib1fv(GPVERTEXATTRIB1FV fnptr, GLuint index, const GLfloat * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib1s(GPVERTEXATTRIB1S fnptr, GLuint index, GLshort x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttrib1sv(GPVERTEXATTRIB1SV fnptr, GLuint index, const GLshort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib2d(GPVERTEXATTRIB2D fnptr, GLuint index, GLdouble x, GLdouble y) { +// (*fnptr)(index, x, y); +// } +// static void glowVertexAttrib2dv(GPVERTEXATTRIB2DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib2f(GPVERTEXATTRIB2F fnptr, GLuint index, GLfloat x, GLfloat y) { +// (*fnptr)(index, x, y); +// } +// static void glowVertexAttrib2fv(GPVERTEXATTRIB2FV fnptr, GLuint index, const GLfloat * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib2s(GPVERTEXATTRIB2S fnptr, GLuint index, GLshort x, GLshort y) { +// (*fnptr)(index, x, y); +// } +// static void glowVertexAttrib2sv(GPVERTEXATTRIB2SV fnptr, GLuint index, const GLshort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib3d(GPVERTEXATTRIB3D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z) { +// (*fnptr)(index, x, y, z); +// } +// static void glowVertexAttrib3dv(GPVERTEXATTRIB3DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib3f(GPVERTEXATTRIB3F fnptr, GLuint index, GLfloat x, GLfloat y, GLfloat z) { +// (*fnptr)(index, x, y, z); +// } +// static void glowVertexAttrib3fv(GPVERTEXATTRIB3FV fnptr, GLuint index, const GLfloat * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib3s(GPVERTEXATTRIB3S fnptr, GLuint index, GLshort x, GLshort y, GLshort z) { +// (*fnptr)(index, x, y, z); +// } +// static void glowVertexAttrib3sv(GPVERTEXATTRIB3SV fnptr, GLuint index, const GLshort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4Nbv(GPVERTEXATTRIB4NBV fnptr, GLuint index, const GLbyte * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4Niv(GPVERTEXATTRIB4NIV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4Nsv(GPVERTEXATTRIB4NSV fnptr, GLuint index, const GLshort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4Nub(GPVERTEXATTRIB4NUB fnptr, GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttrib4Nubv(GPVERTEXATTRIB4NUBV fnptr, GLuint index, const GLubyte * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4Nuiv(GPVERTEXATTRIB4NUIV fnptr, GLuint index, const GLuint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4Nusv(GPVERTEXATTRIB4NUSV fnptr, GLuint index, const GLushort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4bv(GPVERTEXATTRIB4BV fnptr, GLuint index, const GLbyte * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4d(GPVERTEXATTRIB4D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttrib4dv(GPVERTEXATTRIB4DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4f(GPVERTEXATTRIB4F fnptr, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttrib4fv(GPVERTEXATTRIB4FV fnptr, GLuint index, const GLfloat * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4iv(GPVERTEXATTRIB4IV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4s(GPVERTEXATTRIB4S fnptr, GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttrib4sv(GPVERTEXATTRIB4SV fnptr, GLuint index, const GLshort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4ubv(GPVERTEXATTRIB4UBV fnptr, GLuint index, const GLubyte * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4uiv(GPVERTEXATTRIB4UIV fnptr, GLuint index, const GLuint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttrib4usv(GPVERTEXATTRIB4USV fnptr, GLuint index, const GLushort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribBinding(GPVERTEXATTRIBBINDING fnptr, GLuint attribindex, GLuint bindingindex) { +// (*fnptr)(attribindex, bindingindex); +// } +// static void glowVertexAttribDivisor(GPVERTEXATTRIBDIVISOR fnptr, GLuint index, GLuint divisor) { +// (*fnptr)(index, divisor); +// } +// static void glowVertexAttribFormat(GPVERTEXATTRIBFORMAT fnptr, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) { +// (*fnptr)(attribindex, size, type, normalized, relativeoffset); +// } +// static void glowVertexAttribI1i(GPVERTEXATTRIBI1I fnptr, GLuint index, GLint x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttribI1iv(GPVERTEXATTRIBI1IV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI1ui(GPVERTEXATTRIBI1UI fnptr, GLuint index, GLuint x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttribI1uiv(GPVERTEXATTRIBI1UIV fnptr, GLuint index, const GLuint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI2i(GPVERTEXATTRIBI2I fnptr, GLuint index, GLint x, GLint y) { +// (*fnptr)(index, x, y); +// } +// static void glowVertexAttribI2iv(GPVERTEXATTRIBI2IV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI2ui(GPVERTEXATTRIBI2UI fnptr, GLuint index, GLuint x, GLuint y) { +// (*fnptr)(index, x, y); +// } +// static void glowVertexAttribI2uiv(GPVERTEXATTRIBI2UIV fnptr, GLuint index, const GLuint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI3i(GPVERTEXATTRIBI3I fnptr, GLuint index, GLint x, GLint y, GLint z) { +// (*fnptr)(index, x, y, z); +// } +// static void glowVertexAttribI3iv(GPVERTEXATTRIBI3IV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI3ui(GPVERTEXATTRIBI3UI fnptr, GLuint index, GLuint x, GLuint y, GLuint z) { +// (*fnptr)(index, x, y, z); +// } +// static void glowVertexAttribI3uiv(GPVERTEXATTRIBI3UIV fnptr, GLuint index, const GLuint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI4bv(GPVERTEXATTRIBI4BV fnptr, GLuint index, const GLbyte * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI4i(GPVERTEXATTRIBI4I fnptr, GLuint index, GLint x, GLint y, GLint z, GLint w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttribI4iv(GPVERTEXATTRIBI4IV fnptr, GLuint index, const GLint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI4sv(GPVERTEXATTRIBI4SV fnptr, GLuint index, const GLshort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI4ubv(GPVERTEXATTRIBI4UBV fnptr, GLuint index, const GLubyte * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI4ui(GPVERTEXATTRIBI4UI fnptr, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttribI4uiv(GPVERTEXATTRIBI4UIV fnptr, GLuint index, const GLuint * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribI4usv(GPVERTEXATTRIBI4USV fnptr, GLuint index, const GLushort * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribIFormat(GPVERTEXATTRIBIFORMAT fnptr, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) { +// (*fnptr)(attribindex, size, type, relativeoffset); +// } +// static void glowVertexAttribIPointer(GPVERTEXATTRIBIPOINTER fnptr, GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer) { +// (*fnptr)(index, size, type, stride, pointer); +// } +// static void glowVertexAttribL1d(GPVERTEXATTRIBL1D fnptr, GLuint index, GLdouble x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttribL1dv(GPVERTEXATTRIBL1DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribL1ui64ARB(GPVERTEXATTRIBL1UI64ARB fnptr, GLuint index, GLuint64EXT x) { +// (*fnptr)(index, x); +// } +// static void glowVertexAttribL1ui64vARB(GPVERTEXATTRIBL1UI64VARB fnptr, GLuint index, const GLuint64EXT * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribL2d(GPVERTEXATTRIBL2D fnptr, GLuint index, GLdouble x, GLdouble y) { +// (*fnptr)(index, x, y); +// } +// static void glowVertexAttribL2dv(GPVERTEXATTRIBL2DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribL3d(GPVERTEXATTRIBL3D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z) { +// (*fnptr)(index, x, y, z); +// } +// static void glowVertexAttribL3dv(GPVERTEXATTRIBL3DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribL4d(GPVERTEXATTRIBL4D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { +// (*fnptr)(index, x, y, z, w); +// } +// static void glowVertexAttribL4dv(GPVERTEXATTRIBL4DV fnptr, GLuint index, const GLdouble * v) { +// (*fnptr)(index, v); +// } +// static void glowVertexAttribLFormat(GPVERTEXATTRIBLFORMAT fnptr, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) { +// (*fnptr)(attribindex, size, type, relativeoffset); +// } +// static void glowVertexAttribLPointer(GPVERTEXATTRIBLPOINTER fnptr, GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer) { +// (*fnptr)(index, size, type, stride, pointer); +// } +// static void glowVertexAttribP1ui(GPVERTEXATTRIBP1UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP1uiv(GPVERTEXATTRIBP1UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP2ui(GPVERTEXATTRIBP2UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP2uiv(GPVERTEXATTRIBP2UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP3ui(GPVERTEXATTRIBP3UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP3uiv(GPVERTEXATTRIBP3UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP4ui(GPVERTEXATTRIBP4UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribP4uiv(GPVERTEXATTRIBP4UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) { +// (*fnptr)(index, type, normalized, value); +// } +// static void glowVertexAttribPointer(GPVERTEXATTRIBPOINTER fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer) { +// (*fnptr)(index, size, type, normalized, stride, pointer); +// } +// static void glowVertexBindingDivisor(GPVERTEXBINDINGDIVISOR fnptr, GLuint bindingindex, GLuint divisor) { +// (*fnptr)(bindingindex, divisor); +// } +// static void glowViewport(GPVIEWPORT fnptr, GLint x, GLint y, GLsizei width, GLsizei height) { +// (*fnptr)(x, y, width, height); +// } +// static void glowViewportArrayv(GPVIEWPORTARRAYV fnptr, GLuint first, GLsizei count, const GLfloat * v) { +// (*fnptr)(first, count, v); +// } +// static void glowViewportIndexedf(GPVIEWPORTINDEXEDF fnptr, GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) { +// (*fnptr)(index, x, y, w, h); +// } +// static void glowViewportIndexedfv(GPVIEWPORTINDEXEDFV fnptr, GLuint index, const GLfloat * v) { +// (*fnptr)(index, v); +// } +// static void glowWaitSync(GPWAITSYNC fnptr, GLsync sync, GLbitfield flags, GLuint64 timeout) { +// (*fnptr)(sync, flags, timeout); +// } +import "C" +import ( + "errors" + "unsafe" +) + +const ( + ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9 + ACTIVE_ATTRIBUTES = 0x8B89 + ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A + ACTIVE_PROGRAM = 0x8259 + ACTIVE_RESOURCES = 0x92F5 + ACTIVE_SUBROUTINES = 0x8DE5 + ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48 + ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6 + ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47 + ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49 + ACTIVE_TEXTURE = 0x84E0 + ACTIVE_UNIFORMS = 0x8B86 + ACTIVE_UNIFORM_BLOCKS = 0x8A36 + ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35 + ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87 + ACTIVE_VARIABLES = 0x9305 + ALIASED_LINE_WIDTH_RANGE = 0x846E + ALL_BARRIER_BITS = 0xFFFFFFFF + ALL_SHADER_BITS = 0xFFFFFFFF + ALPHA = 0x1906 + ALREADY_SIGNALED = 0x911A + ALWAYS = 0x0207 + AND = 0x1501 + AND_INVERTED = 0x1504 + AND_REVERSE = 0x1502 + ANY_SAMPLES_PASSED = 0x8C2F + ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A + ARRAY_BUFFER = 0x8892 + ARRAY_BUFFER_BINDING = 0x8894 + ARRAY_SIZE = 0x92FB + ARRAY_STRIDE = 0x92FE + ATOMIC_COUNTER_BARRIER_BIT = 0x00001000 + ATOMIC_COUNTER_BUFFER = 0x92C0 + ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5 + ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6 + ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1 + ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4 + ATOMIC_COUNTER_BUFFER_INDEX = 0x9301 + ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED + ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB + ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA + ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8 + ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9 + ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7 + ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3 + ATOMIC_COUNTER_BUFFER_START = 0x92C2 + ATTACHED_SHADERS = 0x8B85 + AUTO_GENERATE_MIPMAP = 0x8295 + BACK = 0x0405 + BACK_LEFT = 0x0402 + BACK_RIGHT = 0x0403 + BGR = 0x80E0 + BGRA = 0x80E1 + BGRA_INTEGER = 0x8D9B + BGR_INTEGER = 0x8D9A + BLEND = 0x0BE2 + BLEND_COLOR = 0x8005 + BLEND_DST = 0x0BE0 + BLEND_DST_ALPHA = 0x80CA + BLEND_DST_RGB = 0x80C8 + BLEND_EQUATION = 0x8009 + BLEND_EQUATION_ALPHA = 0x883D + BLEND_EQUATION_RGB = 0x8009 + BLEND_SRC = 0x0BE1 + BLEND_SRC_ALPHA = 0x80CB + BLEND_SRC_RGB = 0x80C9 + BLOCK_INDEX = 0x92FD + BLUE = 0x1905 + BLUE_INTEGER = 0x8D96 + BOOL = 0x8B56 + BOOL_VEC2 = 0x8B57 + BOOL_VEC3 = 0x8B58 + BOOL_VEC4 = 0x8B59 + BUFFER = 0x82E0 + BUFFER_ACCESS = 0x88BB + BUFFER_ACCESS_FLAGS = 0x911F + BUFFER_BINDING = 0x9302 + BUFFER_DATA_SIZE = 0x9303 + BUFFER_IMMUTABLE_STORAGE = 0x821F + BUFFER_KHR = 0x82E0 + BUFFER_MAPPED = 0x88BC + BUFFER_MAP_LENGTH = 0x9120 + BUFFER_MAP_OFFSET = 0x9121 + BUFFER_MAP_POINTER = 0x88BD + BUFFER_SIZE = 0x8764 + BUFFER_STORAGE_FLAGS = 0x8220 + BUFFER_UPDATE_BARRIER_BIT = 0x00000200 + BUFFER_USAGE = 0x8765 + BUFFER_VARIABLE = 0x92E5 + BYTE = 0x1400 + CAVEAT_SUPPORT = 0x82B8 + CCW = 0x0901 + CLAMP_READ_COLOR = 0x891C + CLAMP_TO_BORDER = 0x812D + CLAMP_TO_EDGE = 0x812F + CLEAR = 0x1500 + CLEAR_BUFFER = 0x82B4 + CLEAR_TEXTURE = 0x9365 + CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000 + CLIENT_STORAGE_BIT = 0x0200 + CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6 + CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7 + CLIP_DEPTH_MODE = 0x935D + CLIP_DISTANCE0 = 0x3000 + CLIP_DISTANCE1 = 0x3001 + CLIP_DISTANCE2 = 0x3002 + CLIP_DISTANCE3 = 0x3003 + CLIP_DISTANCE4 = 0x3004 + CLIP_DISTANCE5 = 0x3005 + CLIP_DISTANCE6 = 0x3006 + CLIP_DISTANCE7 = 0x3007 + CLIP_ORIGIN = 0x935C + COLOR = 0x1800 + COLOR_ATTACHMENT0 = 0x8CE0 + COLOR_ATTACHMENT1 = 0x8CE1 + COLOR_ATTACHMENT10 = 0x8CEA + COLOR_ATTACHMENT11 = 0x8CEB + COLOR_ATTACHMENT12 = 0x8CEC + COLOR_ATTACHMENT13 = 0x8CED + COLOR_ATTACHMENT14 = 0x8CEE + COLOR_ATTACHMENT15 = 0x8CEF + COLOR_ATTACHMENT2 = 0x8CE2 + COLOR_ATTACHMENT3 = 0x8CE3 + COLOR_ATTACHMENT4 = 0x8CE4 + COLOR_ATTACHMENT5 = 0x8CE5 + COLOR_ATTACHMENT6 = 0x8CE6 + COLOR_ATTACHMENT7 = 0x8CE7 + COLOR_ATTACHMENT8 = 0x8CE8 + COLOR_ATTACHMENT9 = 0x8CE9 + COLOR_BUFFER_BIT = 0x00004000 + COLOR_CLEAR_VALUE = 0x0C22 + COLOR_COMPONENTS = 0x8283 + COLOR_ENCODING = 0x8296 + COLOR_LOGIC_OP = 0x0BF2 + COLOR_RENDERABLE = 0x8286 + COLOR_WRITEMASK = 0x0C23 + COMMAND_BARRIER_BIT = 0x00000040 + COMPARE_REF_TO_TEXTURE = 0x884E + COMPATIBLE_SUBROUTINES = 0x8E4B + COMPILE_STATUS = 0x8B81 + COMPRESSED_R11_EAC = 0x9270 + COMPRESSED_RED = 0x8225 + COMPRESSED_RED_RGTC1 = 0x8DBB + COMPRESSED_RG = 0x8226 + COMPRESSED_RG11_EAC = 0x9272 + COMPRESSED_RGB = 0x84ED + COMPRESSED_RGB8_ETC2 = 0x9274 + COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276 + COMPRESSED_RGBA = 0x84EE + COMPRESSED_RGBA8_ETC2_EAC = 0x9278 + COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB + COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8 + COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9 + COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA + COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC + COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD + COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0 + COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1 + COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2 + COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3 + COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4 + COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5 + COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6 + COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7 + COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C + COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E + COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F + COMPRESSED_RG_RGTC2 = 0x8DBD + COMPRESSED_SIGNED_R11_EAC = 0x9271 + COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC + COMPRESSED_SIGNED_RG11_EAC = 0x9273 + COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE + COMPRESSED_SRGB = 0x8C48 + COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB + COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8 + COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9 + COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA + COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC + COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD + COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0 + COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1 + COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2 + COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3 + COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4 + COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5 + COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6 + COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7 + COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279 + COMPRESSED_SRGB8_ETC2 = 0x9275 + COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277 + COMPRESSED_SRGB_ALPHA = 0x8C49 + COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D + COMPRESSED_TEXTURE_FORMATS = 0x86A3 + COMPUTE_SHADER = 0x91B9 + COMPUTE_SHADER_BIT = 0x00000020 + COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5 + COMPUTE_SUBROUTINE = 0x92ED + COMPUTE_SUBROUTINE_UNIFORM = 0x92F3 + COMPUTE_TEXTURE = 0x82A0 + COMPUTE_WORK_GROUP_SIZE = 0x8267 + CONDITION_SATISFIED = 0x911C + CONSTANT_ALPHA = 0x8003 + CONSTANT_COLOR = 0x8001 + CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002 + CONTEXT_CORE_PROFILE_BIT = 0x00000001 + CONTEXT_FLAGS = 0x821E + CONTEXT_FLAG_DEBUG_BIT = 0x00000002 + CONTEXT_FLAG_DEBUG_BIT_KHR = 0x00000002 + CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001 + CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004 + CONTEXT_LOST = 0x0507 + CONTEXT_LOST_KHR = 0x0507 + CONTEXT_PROFILE_MASK = 0x9126 + CONTEXT_RELEASE_BEHAVIOR = 0x82FB + CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC + CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR = 0x82FC + CONTEXT_RELEASE_BEHAVIOR_KHR = 0x82FB + CONTEXT_ROBUST_ACCESS = 0x90F3 + CONTEXT_ROBUST_ACCESS_KHR = 0x90F3 + COPY = 0x1503 + COPY_INVERTED = 0x150C + COPY_READ_BUFFER = 0x8F36 + COPY_READ_BUFFER_BINDING = 0x8F36 + COPY_WRITE_BUFFER = 0x8F37 + COPY_WRITE_BUFFER_BINDING = 0x8F37 + CULL_FACE = 0x0B44 + CULL_FACE_MODE = 0x0B45 + CURRENT_PROGRAM = 0x8B8D + CURRENT_QUERY = 0x8865 + CURRENT_VERTEX_ATTRIB = 0x8626 + CW = 0x0900 + DEBUG_CALLBACK_FUNCTION = 0x8244 + DEBUG_CALLBACK_FUNCTION_ARB = 0x8244 + DEBUG_CALLBACK_FUNCTION_KHR = 0x8244 + DEBUG_CALLBACK_USER_PARAM = 0x8245 + DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245 + DEBUG_CALLBACK_USER_PARAM_KHR = 0x8245 + DEBUG_GROUP_STACK_DEPTH = 0x826D + DEBUG_GROUP_STACK_DEPTH_KHR = 0x826D + DEBUG_LOGGED_MESSAGES = 0x9145 + DEBUG_LOGGED_MESSAGES_ARB = 0x9145 + DEBUG_LOGGED_MESSAGES_KHR = 0x9145 + DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243 + DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243 + DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR = 0x8243 + DEBUG_OUTPUT = 0x92E0 + DEBUG_OUTPUT_KHR = 0x92E0 + DEBUG_OUTPUT_SYNCHRONOUS = 0x8242 + DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242 + DEBUG_OUTPUT_SYNCHRONOUS_KHR = 0x8242 + DEBUG_SEVERITY_HIGH = 0x9146 + DEBUG_SEVERITY_HIGH_ARB = 0x9146 + DEBUG_SEVERITY_HIGH_KHR = 0x9146 + DEBUG_SEVERITY_LOW = 0x9148 + DEBUG_SEVERITY_LOW_ARB = 0x9148 + DEBUG_SEVERITY_LOW_KHR = 0x9148 + DEBUG_SEVERITY_MEDIUM = 0x9147 + DEBUG_SEVERITY_MEDIUM_ARB = 0x9147 + DEBUG_SEVERITY_MEDIUM_KHR = 0x9147 + DEBUG_SEVERITY_NOTIFICATION = 0x826B + DEBUG_SEVERITY_NOTIFICATION_KHR = 0x826B + DEBUG_SOURCE_API = 0x8246 + DEBUG_SOURCE_API_ARB = 0x8246 + DEBUG_SOURCE_API_KHR = 0x8246 + DEBUG_SOURCE_APPLICATION = 0x824A + DEBUG_SOURCE_APPLICATION_ARB = 0x824A + DEBUG_SOURCE_APPLICATION_KHR = 0x824A + DEBUG_SOURCE_OTHER = 0x824B + DEBUG_SOURCE_OTHER_ARB = 0x824B + DEBUG_SOURCE_OTHER_KHR = 0x824B + DEBUG_SOURCE_SHADER_COMPILER = 0x8248 + DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248 + DEBUG_SOURCE_SHADER_COMPILER_KHR = 0x8248 + DEBUG_SOURCE_THIRD_PARTY = 0x8249 + DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249 + DEBUG_SOURCE_THIRD_PARTY_KHR = 0x8249 + DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247 + DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247 + DEBUG_SOURCE_WINDOW_SYSTEM_KHR = 0x8247 + DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D + DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D + DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR = 0x824D + DEBUG_TYPE_ERROR = 0x824C + DEBUG_TYPE_ERROR_ARB = 0x824C + DEBUG_TYPE_ERROR_KHR = 0x824C + DEBUG_TYPE_MARKER = 0x8268 + DEBUG_TYPE_MARKER_KHR = 0x8268 + DEBUG_TYPE_OTHER = 0x8251 + DEBUG_TYPE_OTHER_ARB = 0x8251 + DEBUG_TYPE_OTHER_KHR = 0x8251 + DEBUG_TYPE_PERFORMANCE = 0x8250 + DEBUG_TYPE_PERFORMANCE_ARB = 0x8250 + DEBUG_TYPE_PERFORMANCE_KHR = 0x8250 + DEBUG_TYPE_POP_GROUP = 0x826A + DEBUG_TYPE_POP_GROUP_KHR = 0x826A + DEBUG_TYPE_PORTABILITY = 0x824F + DEBUG_TYPE_PORTABILITY_ARB = 0x824F + DEBUG_TYPE_PORTABILITY_KHR = 0x824F + DEBUG_TYPE_PUSH_GROUP = 0x8269 + DEBUG_TYPE_PUSH_GROUP_KHR = 0x8269 + DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E + DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E + DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR = 0x824E + DECR = 0x1E03 + DECR_WRAP = 0x8508 + DELETE_STATUS = 0x8B80 + DEPTH = 0x1801 + DEPTH24_STENCIL8 = 0x88F0 + DEPTH32F_STENCIL8 = 0x8CAD + DEPTH_ATTACHMENT = 0x8D00 + DEPTH_BUFFER_BIT = 0x00000100 + DEPTH_CLAMP = 0x864F + DEPTH_CLEAR_VALUE = 0x0B73 + DEPTH_COMPONENT = 0x1902 + DEPTH_COMPONENT16 = 0x81A5 + DEPTH_COMPONENT24 = 0x81A6 + DEPTH_COMPONENT32 = 0x81A7 + DEPTH_COMPONENT32F = 0x8CAC + DEPTH_COMPONENTS = 0x8284 + DEPTH_FUNC = 0x0B74 + DEPTH_RANGE = 0x0B70 + DEPTH_RENDERABLE = 0x8287 + DEPTH_STENCIL = 0x84F9 + DEPTH_STENCIL_ATTACHMENT = 0x821A + DEPTH_STENCIL_TEXTURE_MODE = 0x90EA + DEPTH_TEST = 0x0B71 + DEPTH_WRITEMASK = 0x0B72 + DISPATCH_INDIRECT_BUFFER = 0x90EE + DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF + DITHER = 0x0BD0 + DONT_CARE = 0x1100 + DOUBLE = 0x140A + DOUBLEBUFFER = 0x0C32 + DOUBLE_MAT2 = 0x8F46 + DOUBLE_MAT2x3 = 0x8F49 + DOUBLE_MAT2x4 = 0x8F4A + DOUBLE_MAT3 = 0x8F47 + DOUBLE_MAT3x2 = 0x8F4B + DOUBLE_MAT3x4 = 0x8F4C + DOUBLE_MAT4 = 0x8F48 + DOUBLE_MAT4x2 = 0x8F4D + DOUBLE_MAT4x3 = 0x8F4E + DOUBLE_VEC2 = 0x8FFC + DOUBLE_VEC3 = 0x8FFD + DOUBLE_VEC4 = 0x8FFE + DRAW_BUFFER = 0x0C01 + DRAW_BUFFER0 = 0x8825 + DRAW_BUFFER1 = 0x8826 + DRAW_BUFFER10 = 0x882F + DRAW_BUFFER11 = 0x8830 + DRAW_BUFFER12 = 0x8831 + DRAW_BUFFER13 = 0x8832 + DRAW_BUFFER14 = 0x8833 + DRAW_BUFFER15 = 0x8834 + DRAW_BUFFER2 = 0x8827 + DRAW_BUFFER3 = 0x8828 + DRAW_BUFFER4 = 0x8829 + DRAW_BUFFER5 = 0x882A + DRAW_BUFFER6 = 0x882B + DRAW_BUFFER7 = 0x882C + DRAW_BUFFER8 = 0x882D + DRAW_BUFFER9 = 0x882E + DRAW_FRAMEBUFFER = 0x8CA9 + DRAW_FRAMEBUFFER_BINDING = 0x8CA6 + DRAW_INDIRECT_BUFFER = 0x8F3F + DRAW_INDIRECT_BUFFER_BINDING = 0x8F43 + DST_ALPHA = 0x0304 + DST_COLOR = 0x0306 + DYNAMIC_COPY = 0x88EA + DYNAMIC_DRAW = 0x88E8 + DYNAMIC_READ = 0x88E9 + DYNAMIC_STORAGE_BIT = 0x0100 + ELEMENT_ARRAY_BARRIER_BIT = 0x00000002 + ELEMENT_ARRAY_BUFFER = 0x8893 + ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 + EQUAL = 0x0202 + EQUIV = 0x1509 + EXTENSIONS = 0x1F03 + FALSE = 0 + FASTEST = 0x1101 + FILL = 0x1B02 + FILTER = 0x829A + FIRST_VERTEX_CONVENTION = 0x8E4D + FIXED = 0x140C + FIXED_ONLY = 0x891D + FLOAT = 0x1406 + FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD + FLOAT_MAT2 = 0x8B5A + FLOAT_MAT2x3 = 0x8B65 + FLOAT_MAT2x4 = 0x8B66 + FLOAT_MAT3 = 0x8B5B + FLOAT_MAT3x2 = 0x8B67 + FLOAT_MAT3x4 = 0x8B68 + FLOAT_MAT4 = 0x8B5C + FLOAT_MAT4x2 = 0x8B69 + FLOAT_MAT4x3 = 0x8B6A + FLOAT_VEC2 = 0x8B50 + FLOAT_VEC3 = 0x8B51 + FLOAT_VEC4 = 0x8B52 + FRACTIONAL_EVEN = 0x8E7C + FRACTIONAL_ODD = 0x8E7B + FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D + FRAGMENT_SHADER = 0x8B30 + FRAGMENT_SHADER_BIT = 0x00000002 + FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B + FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4 + FRAGMENT_SUBROUTINE = 0x92EC + FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2 + FRAGMENT_TEXTURE = 0x829F + FRAMEBUFFER = 0x8D40 + FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215 + FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214 + FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210 + FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211 + FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216 + FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213 + FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7 + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1 + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0 + FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212 + FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217 + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3 + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4 + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2 + FRAMEBUFFER_BARRIER_BIT = 0x00000400 + FRAMEBUFFER_BINDING = 0x8CA6 + FRAMEBUFFER_BLEND = 0x828B + FRAMEBUFFER_COMPLETE = 0x8CD5 + FRAMEBUFFER_DEFAULT = 0x8218 + FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314 + FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311 + FRAMEBUFFER_DEFAULT_LAYERS = 0x9312 + FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313 + FRAMEBUFFER_DEFAULT_WIDTH = 0x9310 + FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6 + FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB + FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8 + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7 + FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56 + FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC + FRAMEBUFFER_RENDERABLE = 0x8289 + FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A + FRAMEBUFFER_SRGB = 0x8DB9 + FRAMEBUFFER_UNDEFINED = 0x8219 + FRAMEBUFFER_UNSUPPORTED = 0x8CDD + FRONT = 0x0404 + FRONT_AND_BACK = 0x0408 + FRONT_FACE = 0x0B46 + FRONT_LEFT = 0x0400 + FRONT_RIGHT = 0x0401 + FULL_SUPPORT = 0x82B7 + FUNC_ADD = 0x8006 + FUNC_REVERSE_SUBTRACT = 0x800B + FUNC_SUBTRACT = 0x800A + GEOMETRY_INPUT_TYPE = 0x8917 + GEOMETRY_OUTPUT_TYPE = 0x8918 + GEOMETRY_SHADER = 0x8DD9 + GEOMETRY_SHADER_BIT = 0x00000004 + GEOMETRY_SHADER_INVOCATIONS = 0x887F + GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3 + GEOMETRY_SUBROUTINE = 0x92EB + GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1 + GEOMETRY_TEXTURE = 0x829E + GEOMETRY_VERTICES_OUT = 0x8916 + GEQUAL = 0x0206 + GET_TEXTURE_IMAGE_FORMAT = 0x8291 + GET_TEXTURE_IMAGE_TYPE = 0x8292 + GREATER = 0x0204 + GREEN = 0x1904 + GREEN_INTEGER = 0x8D95 + GUILTY_CONTEXT_RESET = 0x8253 + GUILTY_CONTEXT_RESET_ARB = 0x8253 + GUILTY_CONTEXT_RESET_KHR = 0x8253 + HALF_FLOAT = 0x140B + HIGH_FLOAT = 0x8DF2 + HIGH_INT = 0x8DF5 + IMAGE_1D = 0x904C + IMAGE_1D_ARRAY = 0x9052 + IMAGE_2D = 0x904D + IMAGE_2D_ARRAY = 0x9053 + IMAGE_2D_MULTISAMPLE = 0x9055 + IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056 + IMAGE_2D_RECT = 0x904F + IMAGE_3D = 0x904E + IMAGE_BINDING_ACCESS = 0x8F3E + IMAGE_BINDING_FORMAT = 0x906E + IMAGE_BINDING_LAYER = 0x8F3D + IMAGE_BINDING_LAYERED = 0x8F3C + IMAGE_BINDING_LEVEL = 0x8F3B + IMAGE_BINDING_NAME = 0x8F3A + IMAGE_BUFFER = 0x9051 + IMAGE_CLASS_10_10_10_2 = 0x82C3 + IMAGE_CLASS_11_11_10 = 0x82C2 + IMAGE_CLASS_1_X_16 = 0x82BE + IMAGE_CLASS_1_X_32 = 0x82BB + IMAGE_CLASS_1_X_8 = 0x82C1 + IMAGE_CLASS_2_X_16 = 0x82BD + IMAGE_CLASS_2_X_32 = 0x82BA + IMAGE_CLASS_2_X_8 = 0x82C0 + IMAGE_CLASS_4_X_16 = 0x82BC + IMAGE_CLASS_4_X_32 = 0x82B9 + IMAGE_CLASS_4_X_8 = 0x82BF + IMAGE_COMPATIBILITY_CLASS = 0x82A8 + IMAGE_CUBE = 0x9050 + IMAGE_CUBE_MAP_ARRAY = 0x9054 + IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9 + IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8 + IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7 + IMAGE_PIXEL_FORMAT = 0x82A9 + IMAGE_PIXEL_TYPE = 0x82AA + IMAGE_TEXEL_SIZE = 0x82A7 + IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B + IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A + INCR = 0x1E02 + INCR_WRAP = 0x8507 + INFO_LOG_LENGTH = 0x8B84 + INNOCENT_CONTEXT_RESET = 0x8254 + INNOCENT_CONTEXT_RESET_ARB = 0x8254 + INNOCENT_CONTEXT_RESET_KHR = 0x8254 + INT = 0x1404 + INTERLEAVED_ATTRIBS = 0x8C8C + INTERNALFORMAT_ALPHA_SIZE = 0x8274 + INTERNALFORMAT_ALPHA_TYPE = 0x827B + INTERNALFORMAT_BLUE_SIZE = 0x8273 + INTERNALFORMAT_BLUE_TYPE = 0x827A + INTERNALFORMAT_DEPTH_SIZE = 0x8275 + INTERNALFORMAT_DEPTH_TYPE = 0x827C + INTERNALFORMAT_GREEN_SIZE = 0x8272 + INTERNALFORMAT_GREEN_TYPE = 0x8279 + INTERNALFORMAT_PREFERRED = 0x8270 + INTERNALFORMAT_RED_SIZE = 0x8271 + INTERNALFORMAT_RED_TYPE = 0x8278 + INTERNALFORMAT_SHARED_SIZE = 0x8277 + INTERNALFORMAT_STENCIL_SIZE = 0x8276 + INTERNALFORMAT_STENCIL_TYPE = 0x827D + INTERNALFORMAT_SUPPORTED = 0x826F + INT_2_10_10_10_REV = 0x8D9F + INT_IMAGE_1D = 0x9057 + INT_IMAGE_1D_ARRAY = 0x905D + INT_IMAGE_2D = 0x9058 + INT_IMAGE_2D_ARRAY = 0x905E + INT_IMAGE_2D_MULTISAMPLE = 0x9060 + INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061 + INT_IMAGE_2D_RECT = 0x905A + INT_IMAGE_3D = 0x9059 + INT_IMAGE_BUFFER = 0x905C + INT_IMAGE_CUBE = 0x905B + INT_IMAGE_CUBE_MAP_ARRAY = 0x905F + INT_SAMPLER_1D = 0x8DC9 + INT_SAMPLER_1D_ARRAY = 0x8DCE + INT_SAMPLER_2D = 0x8DCA + INT_SAMPLER_2D_ARRAY = 0x8DCF + INT_SAMPLER_2D_MULTISAMPLE = 0x9109 + INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C + INT_SAMPLER_2D_RECT = 0x8DCD + INT_SAMPLER_3D = 0x8DCB + INT_SAMPLER_BUFFER = 0x8DD0 + INT_SAMPLER_CUBE = 0x8DCC + INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E + INT_VEC2 = 0x8B53 + INT_VEC3 = 0x8B54 + INT_VEC4 = 0x8B55 + INVALID_ENUM = 0x0500 + INVALID_FRAMEBUFFER_OPERATION = 0x0506 + INVALID_INDEX = 0xFFFFFFFF + INVALID_OPERATION = 0x0502 + INVALID_VALUE = 0x0501 + INVERT = 0x150A + ISOLINES = 0x8E7A + IS_PER_PATCH = 0x92E7 + IS_ROW_MAJOR = 0x9300 + KEEP = 0x1E00 + LAST_VERTEX_CONVENTION = 0x8E4E + LAYER_PROVOKING_VERTEX = 0x825E + LEFT = 0x0406 + LEQUAL = 0x0203 + LESS = 0x0201 + LINE = 0x1B01 + LINEAR = 0x2601 + LINEAR_MIPMAP_LINEAR = 0x2703 + LINEAR_MIPMAP_NEAREST = 0x2701 + LINES = 0x0001 + LINES_ADJACENCY = 0x000A + LINE_LOOP = 0x0002 + LINE_SMOOTH = 0x0B20 + LINE_SMOOTH_HINT = 0x0C52 + LINE_STRIP = 0x0003 + LINE_STRIP_ADJACENCY = 0x000B + LINE_WIDTH = 0x0B21 + LINE_WIDTH_GRANULARITY = 0x0B23 + LINE_WIDTH_RANGE = 0x0B22 + LINK_STATUS = 0x8B82 + LOCATION = 0x930E + LOCATION_COMPONENT = 0x934A + LOCATION_INDEX = 0x930F + LOGIC_OP_MODE = 0x0BF0 + LOSE_CONTEXT_ON_RESET = 0x8252 + LOSE_CONTEXT_ON_RESET_ARB = 0x8252 + LOSE_CONTEXT_ON_RESET_KHR = 0x8252 + LOWER_LEFT = 0x8CA1 + LOW_FLOAT = 0x8DF0 + LOW_INT = 0x8DF3 + MAJOR_VERSION = 0x821B + MANUAL_GENERATE_MIPMAP = 0x8294 + MAP_COHERENT_BIT = 0x0080 + MAP_FLUSH_EXPLICIT_BIT = 0x0010 + MAP_INVALIDATE_BUFFER_BIT = 0x0008 + MAP_INVALIDATE_RANGE_BIT = 0x0004 + MAP_PERSISTENT_BIT = 0x0040 + MAP_READ_BIT = 0x0001 + MAP_UNSYNCHRONIZED_BIT = 0x0020 + MAP_WRITE_BIT = 0x0002 + MATRIX_STRIDE = 0x92FF + MAX = 0x8008 + MAX_3D_TEXTURE_SIZE = 0x8073 + MAX_ARRAY_TEXTURE_LAYERS = 0x88FF + MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC + MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8 + MAX_CLIP_DISTANCES = 0x0D32 + MAX_COLOR_ATTACHMENTS = 0x8CDF + MAX_COLOR_TEXTURE_SAMPLES = 0x910E + MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7 + MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1 + MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA + MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266 + MAX_COMBINED_DIMENSIONS = 0x8282 + MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33 + MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32 + MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF + MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39 + MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39 + MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC + MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E + MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F + MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D + MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E + MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31 + MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265 + MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264 + MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB + MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF + MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD + MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB + MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262 + MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC + MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB + MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263 + MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344 + MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345 + MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE + MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB + MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF + MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C + MAX_CULL_DISTANCES = 0x82F9 + MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C + MAX_DEBUG_GROUP_STACK_DEPTH_KHR = 0x826C + MAX_DEBUG_LOGGED_MESSAGES = 0x9144 + MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144 + MAX_DEBUG_LOGGED_MESSAGES_KHR = 0x9144 + MAX_DEBUG_MESSAGE_LENGTH = 0x9143 + MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143 + MAX_DEBUG_MESSAGE_LENGTH_KHR = 0x9143 + MAX_DEPTH = 0x8280 + MAX_DEPTH_TEXTURE_SAMPLES = 0x910F + MAX_DRAW_BUFFERS = 0x8824 + MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC + MAX_ELEMENTS_INDICES = 0x80E9 + MAX_ELEMENTS_VERTICES = 0x80E8 + MAX_ELEMENT_INDEX = 0x8D6B + MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6 + MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0 + MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE + MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125 + MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C + MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA + MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D + MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49 + MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD + MAX_FRAMEBUFFER_HEIGHT = 0x9316 + MAX_FRAMEBUFFER_LAYERS = 0x9317 + MAX_FRAMEBUFFER_SAMPLES = 0x9318 + MAX_FRAMEBUFFER_WIDTH = 0x9315 + MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5 + MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF + MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD + MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123 + MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124 + MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0 + MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A + MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7 + MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29 + MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1 + MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C + MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF + MAX_HEIGHT = 0x827F + MAX_IMAGE_SAMPLES = 0x906D + MAX_IMAGE_UNITS = 0x8F38 + MAX_INTEGER_SAMPLES = 0x9110 + MAX_LABEL_LENGTH = 0x82E8 + MAX_LABEL_LENGTH_KHR = 0x82E8 + MAX_LAYERS = 0x8281 + MAX_NAME_LENGTH = 0x92F6 + MAX_NUM_ACTIVE_VARIABLES = 0x92F7 + MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8 + MAX_PATCH_VERTICES = 0x8E7D + MAX_PROGRAM_TEXEL_OFFSET = 0x8905 + MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F + MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F + MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8 + MAX_RENDERBUFFER_SIZE = 0x84E8 + MAX_SAMPLES = 0x8D57 + MAX_SAMPLE_MASK_WORDS = 0x8E59 + MAX_SERVER_WAIT_TIMEOUT = 0x9111 + MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE + MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD + MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199 + MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A + MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198 + MAX_SUBROUTINES = 0x8DE7 + MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8 + MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3 + MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD + MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB + MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C + MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83 + MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8 + MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81 + MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85 + MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89 + MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F + MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4 + MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE + MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC + MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D + MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86 + MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9 + MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82 + MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A + MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80 + MAX_TESS_GEN_LEVEL = 0x8E7E + MAX_TESS_PATCH_COMPONENTS = 0x8E84 + MAX_TEXTURE_BUFFER_SIZE = 0x8C2B + MAX_TEXTURE_IMAGE_UNITS = 0x8872 + MAX_TEXTURE_LOD_BIAS = 0x84FD + MAX_TEXTURE_SIZE = 0x0D33 + MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70 + MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A + MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B + MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80 + MAX_UNIFORM_BLOCK_SIZE = 0x8A30 + MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F + MAX_UNIFORM_LOCATIONS = 0x826E + MAX_VARYING_COMPONENTS = 0x8B4B + MAX_VARYING_FLOATS = 0x8B4B + MAX_VARYING_VECTORS = 0x8DFC + MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2 + MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC + MAX_VERTEX_ATTRIBS = 0x8869 + MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA + MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9 + MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA + MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122 + MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6 + MAX_VERTEX_STREAMS = 0x8E71 + MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C + MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B + MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A + MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB + MAX_VIEWPORTS = 0x825B + MAX_VIEWPORT_DIMS = 0x0D3A + MAX_WIDTH = 0x827E + MEDIUM_FLOAT = 0x8DF1 + MEDIUM_INT = 0x8DF4 + MIN = 0x8007 + MINOR_VERSION = 0x821C + MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B + MIN_MAP_BUFFER_ALIGNMENT = 0x90BC + MIN_PROGRAM_TEXEL_OFFSET = 0x8904 + MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E + MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37 + MIN_SPARSE_LEVEL_ARB = 0x919B + MIPMAP = 0x8293 + MIRRORED_REPEAT = 0x8370 + MIRROR_CLAMP_TO_EDGE = 0x8743 + MULTISAMPLE = 0x809D + NAMED_STRING_LENGTH_ARB = 0x8DE9 + NAMED_STRING_TYPE_ARB = 0x8DEA + NAME_LENGTH = 0x92F9 + NAND = 0x150E + NEAREST = 0x2600 + NEAREST_MIPMAP_LINEAR = 0x2702 + NEAREST_MIPMAP_NEAREST = 0x2700 + NEGATIVE_ONE_TO_ONE = 0x935E + NEVER = 0x0200 + NICEST = 0x1102 + NONE = 0 + NOOP = 0x1505 + NOR = 0x1508 + NOTEQUAL = 0x0205 + NO_ERROR = 0 + NO_RESET_NOTIFICATION = 0x8261 + NO_RESET_NOTIFICATION_ARB = 0x8261 + NO_RESET_NOTIFICATION_KHR = 0x8261 + NUM_ACTIVE_VARIABLES = 0x9304 + NUM_COMPATIBLE_SUBROUTINES = 0x8E4A + NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2 + NUM_EXTENSIONS = 0x821D + NUM_PROGRAM_BINARY_FORMATS = 0x87FE + NUM_SAMPLE_COUNTS = 0x9380 + NUM_SHADER_BINARY_FORMATS = 0x8DF9 + NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8 + OBJECT_TYPE = 0x9112 + OFFSET = 0x92FC + ONE = 1 + ONE_MINUS_CONSTANT_ALPHA = 0x8004 + ONE_MINUS_CONSTANT_COLOR = 0x8002 + ONE_MINUS_DST_ALPHA = 0x0305 + ONE_MINUS_DST_COLOR = 0x0307 + ONE_MINUS_SRC1_ALPHA = 0x88FB + ONE_MINUS_SRC1_COLOR = 0x88FA + ONE_MINUS_SRC_ALPHA = 0x0303 + ONE_MINUS_SRC_COLOR = 0x0301 + OR = 0x1507 + OR_INVERTED = 0x150D + OR_REVERSE = 0x150B + OUT_OF_MEMORY = 0x0505 + PACK_ALIGNMENT = 0x0D05 + PACK_COMPRESSED_BLOCK_DEPTH = 0x912D + PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C + PACK_COMPRESSED_BLOCK_SIZE = 0x912E + PACK_COMPRESSED_BLOCK_WIDTH = 0x912B + PACK_IMAGE_HEIGHT = 0x806C + PACK_LSB_FIRST = 0x0D01 + PACK_ROW_LENGTH = 0x0D02 + PACK_SKIP_IMAGES = 0x806B + PACK_SKIP_PIXELS = 0x0D04 + PACK_SKIP_ROWS = 0x0D03 + PACK_SWAP_BYTES = 0x0D00 + PARAMETER_BUFFER_ARB = 0x80EE + PARAMETER_BUFFER_BINDING_ARB = 0x80EF + PATCHES = 0x000E + PATCH_DEFAULT_INNER_LEVEL = 0x8E73 + PATCH_DEFAULT_OUTER_LEVEL = 0x8E74 + PATCH_VERTICES = 0x8E72 + PIXEL_BUFFER_BARRIER_BIT = 0x00000080 + PIXEL_PACK_BUFFER = 0x88EB + PIXEL_PACK_BUFFER_BINDING = 0x88ED + PIXEL_UNPACK_BUFFER = 0x88EC + PIXEL_UNPACK_BUFFER_BINDING = 0x88EF + POINT = 0x1B00 + POINTS = 0x0000 + POINT_FADE_THRESHOLD_SIZE = 0x8128 + POINT_SIZE = 0x0B11 + POINT_SIZE_GRANULARITY = 0x0B13 + POINT_SIZE_RANGE = 0x0B12 + POINT_SPRITE_COORD_ORIGIN = 0x8CA0 + POLYGON_MODE = 0x0B40 + POLYGON_OFFSET_FACTOR = 0x8038 + POLYGON_OFFSET_FILL = 0x8037 + POLYGON_OFFSET_LINE = 0x2A02 + POLYGON_OFFSET_POINT = 0x2A01 + POLYGON_OFFSET_UNITS = 0x2A00 + POLYGON_SMOOTH = 0x0B41 + POLYGON_SMOOTH_HINT = 0x0C53 + PRIMITIVES_GENERATED = 0x8C87 + PRIMITIVES_SUBMITTED_ARB = 0x82EF + PRIMITIVE_RESTART = 0x8F9D + PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69 + PRIMITIVE_RESTART_INDEX = 0x8F9E + PROGRAM = 0x82E2 + PROGRAM_BINARY_FORMATS = 0x87FF + PROGRAM_BINARY_LENGTH = 0x8741 + PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257 + PROGRAM_INPUT = 0x92E3 + PROGRAM_KHR = 0x82E2 + PROGRAM_OUTPUT = 0x92E4 + PROGRAM_PIPELINE = 0x82E4 + PROGRAM_PIPELINE_BINDING = 0x825A + PROGRAM_POINT_SIZE = 0x8642 + PROGRAM_SEPARABLE = 0x8258 + PROVOKING_VERTEX = 0x8E4F + PROXY_TEXTURE_1D = 0x8063 + PROXY_TEXTURE_1D_ARRAY = 0x8C19 + PROXY_TEXTURE_2D = 0x8064 + PROXY_TEXTURE_2D_ARRAY = 0x8C1B + PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101 + PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103 + PROXY_TEXTURE_3D = 0x8070 + PROXY_TEXTURE_CUBE_MAP = 0x851B + PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B + PROXY_TEXTURE_RECTANGLE = 0x84F7 + QUADS = 0x0007 + QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C + QUERY = 0x82E3 + QUERY_BUFFER = 0x9192 + QUERY_BUFFER_BARRIER_BIT = 0x00008000 + QUERY_BUFFER_BINDING = 0x9193 + QUERY_BY_REGION_NO_WAIT = 0x8E16 + QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A + QUERY_BY_REGION_WAIT = 0x8E15 + QUERY_BY_REGION_WAIT_INVERTED = 0x8E19 + QUERY_COUNTER_BITS = 0x8864 + QUERY_KHR = 0x82E3 + QUERY_NO_WAIT = 0x8E14 + QUERY_NO_WAIT_INVERTED = 0x8E18 + QUERY_RESULT = 0x8866 + QUERY_RESULT_AVAILABLE = 0x8867 + QUERY_RESULT_NO_WAIT = 0x9194 + QUERY_TARGET = 0x82EA + QUERY_WAIT = 0x8E13 + QUERY_WAIT_INVERTED = 0x8E17 + R11F_G11F_B10F = 0x8C3A + R16 = 0x822A + R16F = 0x822D + R16I = 0x8233 + R16UI = 0x8234 + R16_SNORM = 0x8F98 + R32F = 0x822E + R32I = 0x8235 + R32UI = 0x8236 + R3_G3_B2 = 0x2A10 + R8 = 0x8229 + R8I = 0x8231 + R8UI = 0x8232 + R8_SNORM = 0x8F94 + RASTERIZER_DISCARD = 0x8C89 + READ_BUFFER = 0x0C02 + READ_FRAMEBUFFER = 0x8CA8 + READ_FRAMEBUFFER_BINDING = 0x8CAA + READ_ONLY = 0x88B8 + READ_PIXELS = 0x828C + READ_PIXELS_FORMAT = 0x828D + READ_PIXELS_TYPE = 0x828E + READ_WRITE = 0x88BA + RED = 0x1903 + RED_INTEGER = 0x8D94 + REFERENCED_BY_COMPUTE_SHADER = 0x930B + REFERENCED_BY_FRAGMENT_SHADER = 0x930A + REFERENCED_BY_GEOMETRY_SHADER = 0x9309 + REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307 + REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308 + REFERENCED_BY_VERTEX_SHADER = 0x9306 + RENDERBUFFER = 0x8D41 + RENDERBUFFER_ALPHA_SIZE = 0x8D53 + RENDERBUFFER_BINDING = 0x8CA7 + RENDERBUFFER_BLUE_SIZE = 0x8D52 + RENDERBUFFER_DEPTH_SIZE = 0x8D54 + RENDERBUFFER_GREEN_SIZE = 0x8D51 + RENDERBUFFER_HEIGHT = 0x8D43 + RENDERBUFFER_INTERNAL_FORMAT = 0x8D44 + RENDERBUFFER_RED_SIZE = 0x8D50 + RENDERBUFFER_SAMPLES = 0x8CAB + RENDERBUFFER_STENCIL_SIZE = 0x8D55 + RENDERBUFFER_WIDTH = 0x8D42 + RENDERER = 0x1F01 + REPEAT = 0x2901 + REPLACE = 0x1E01 + RESET_NOTIFICATION_STRATEGY = 0x8256 + RESET_NOTIFICATION_STRATEGY_ARB = 0x8256 + RESET_NOTIFICATION_STRATEGY_KHR = 0x8256 + RG = 0x8227 + RG16 = 0x822C + RG16F = 0x822F + RG16I = 0x8239 + RG16UI = 0x823A + RG16_SNORM = 0x8F99 + RG32F = 0x8230 + RG32I = 0x823B + RG32UI = 0x823C + RG8 = 0x822B + RG8I = 0x8237 + RG8UI = 0x8238 + RG8_SNORM = 0x8F95 + RGB = 0x1907 + RGB10 = 0x8052 + RGB10_A2 = 0x8059 + RGB10_A2UI = 0x906F + RGB12 = 0x8053 + RGB16 = 0x8054 + RGB16F = 0x881B + RGB16I = 0x8D89 + RGB16UI = 0x8D77 + RGB16_SNORM = 0x8F9A + RGB32F = 0x8815 + RGB32I = 0x8D83 + RGB32UI = 0x8D71 + RGB4 = 0x804F + RGB5 = 0x8050 + RGB565 = 0x8D62 + RGB5_A1 = 0x8057 + RGB8 = 0x8051 + RGB8I = 0x8D8F + RGB8UI = 0x8D7D + RGB8_SNORM = 0x8F96 + RGB9_E5 = 0x8C3D + RGBA = 0x1908 + RGBA12 = 0x805A + RGBA16 = 0x805B + RGBA16F = 0x881A + RGBA16I = 0x8D88 + RGBA16UI = 0x8D76 + RGBA16_SNORM = 0x8F9B + RGBA2 = 0x8055 + RGBA32F = 0x8814 + RGBA32I = 0x8D82 + RGBA32UI = 0x8D70 + RGBA4 = 0x8056 + RGBA8 = 0x8058 + RGBA8I = 0x8D8E + RGBA8UI = 0x8D7C + RGBA8_SNORM = 0x8F97 + RGBA_INTEGER = 0x8D99 + RGB_INTEGER = 0x8D98 + RG_INTEGER = 0x8228 + RIGHT = 0x0407 + SAMPLER = 0x82E6 + SAMPLER_1D = 0x8B5D + SAMPLER_1D_ARRAY = 0x8DC0 + SAMPLER_1D_ARRAY_SHADOW = 0x8DC3 + SAMPLER_1D_SHADOW = 0x8B61 + SAMPLER_2D = 0x8B5E + SAMPLER_2D_ARRAY = 0x8DC1 + SAMPLER_2D_ARRAY_SHADOW = 0x8DC4 + SAMPLER_2D_MULTISAMPLE = 0x9108 + SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B + SAMPLER_2D_RECT = 0x8B63 + SAMPLER_2D_RECT_SHADOW = 0x8B64 + SAMPLER_2D_SHADOW = 0x8B62 + SAMPLER_3D = 0x8B5F + SAMPLER_BINDING = 0x8919 + SAMPLER_BUFFER = 0x8DC2 + SAMPLER_CUBE = 0x8B60 + SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C + SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D + SAMPLER_CUBE_SHADOW = 0x8DC5 + SAMPLER_KHR = 0x82E6 + SAMPLES = 0x80A9 + SAMPLES_PASSED = 0x8914 + SAMPLE_ALPHA_TO_COVERAGE = 0x809E + SAMPLE_ALPHA_TO_ONE = 0x809F + SAMPLE_BUFFERS = 0x80A8 + SAMPLE_COVERAGE = 0x80A0 + SAMPLE_COVERAGE_INVERT = 0x80AB + SAMPLE_COVERAGE_VALUE = 0x80AA + SAMPLE_MASK = 0x8E51 + SAMPLE_MASK_VALUE = 0x8E52 + SAMPLE_POSITION = 0x8E50 + SAMPLE_SHADING_ARB = 0x8C36 + SCISSOR_BOX = 0x0C10 + SCISSOR_TEST = 0x0C11 + SEPARATE_ATTRIBS = 0x8C8D + SET = 0x150F + SHADER = 0x82E1 + SHADER_BINARY_FORMATS = 0x8DF8 + SHADER_COMPILER = 0x8DFA + SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020 + SHADER_IMAGE_ATOMIC = 0x82A6 + SHADER_IMAGE_LOAD = 0x82A4 + SHADER_IMAGE_STORE = 0x82A5 + SHADER_INCLUDE_ARB = 0x8DAE + SHADER_KHR = 0x82E1 + SHADER_SOURCE_LENGTH = 0x8B88 + SHADER_STORAGE_BARRIER_BIT = 0x00002000 + SHADER_STORAGE_BLOCK = 0x92E6 + SHADER_STORAGE_BUFFER = 0x90D2 + SHADER_STORAGE_BUFFER_BINDING = 0x90D3 + SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF + SHADER_STORAGE_BUFFER_SIZE = 0x90D5 + SHADER_STORAGE_BUFFER_START = 0x90D4 + SHADER_TYPE = 0x8B4F + SHADING_LANGUAGE_VERSION = 0x8B8C + SHORT = 0x1402 + SIGNALED = 0x9119 + SIGNED_NORMALIZED = 0x8F9C + SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC + SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE + SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD + SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF + SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23 + SMOOTH_LINE_WIDTH_RANGE = 0x0B22 + SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13 + SMOOTH_POINT_SIZE_RANGE = 0x0B12 + SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8 + SPARSE_STORAGE_BIT_ARB = 0x0400 + SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9 + SRC1_ALPHA = 0x8589 + SRC1_COLOR = 0x88F9 + SRC_ALPHA = 0x0302 + SRC_ALPHA_SATURATE = 0x0308 + SRC_COLOR = 0x0300 + SRGB = 0x8C40 + SRGB8 = 0x8C41 + SRGB8_ALPHA8 = 0x8C43 + SRGB_ALPHA = 0x8C42 + SRGB_DECODE_ARB = 0x8299 + SRGB_READ = 0x8297 + SRGB_WRITE = 0x8298 + STACK_OVERFLOW = 0x0503 + STACK_OVERFLOW_KHR = 0x0503 + STACK_UNDERFLOW = 0x0504 + STACK_UNDERFLOW_KHR = 0x0504 + STATIC_COPY = 0x88E6 + STATIC_DRAW = 0x88E4 + STATIC_READ = 0x88E5 + STENCIL = 0x1802 + STENCIL_ATTACHMENT = 0x8D20 + STENCIL_BACK_FAIL = 0x8801 + STENCIL_BACK_FUNC = 0x8800 + STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802 + STENCIL_BACK_PASS_DEPTH_PASS = 0x8803 + STENCIL_BACK_REF = 0x8CA3 + STENCIL_BACK_VALUE_MASK = 0x8CA4 + STENCIL_BACK_WRITEMASK = 0x8CA5 + STENCIL_BUFFER_BIT = 0x00000400 + STENCIL_CLEAR_VALUE = 0x0B91 + STENCIL_COMPONENTS = 0x8285 + STENCIL_FAIL = 0x0B94 + STENCIL_FUNC = 0x0B92 + STENCIL_INDEX = 0x1901 + STENCIL_INDEX1 = 0x8D46 + STENCIL_INDEX16 = 0x8D49 + STENCIL_INDEX4 = 0x8D47 + STENCIL_INDEX8 = 0x8D48 + STENCIL_PASS_DEPTH_FAIL = 0x0B95 + STENCIL_PASS_DEPTH_PASS = 0x0B96 + STENCIL_REF = 0x0B97 + STENCIL_RENDERABLE = 0x8288 + STENCIL_TEST = 0x0B90 + STENCIL_VALUE_MASK = 0x0B93 + STENCIL_WRITEMASK = 0x0B98 + STEREO = 0x0C33 + STREAM_COPY = 0x88E2 + STREAM_DRAW = 0x88E0 + STREAM_READ = 0x88E1 + SUBPIXEL_BITS = 0x0D50 + SYNC_CL_EVENT_ARB = 0x8240 + SYNC_CL_EVENT_COMPLETE_ARB = 0x8241 + SYNC_CONDITION = 0x9113 + SYNC_FENCE = 0x9116 + SYNC_FLAGS = 0x9115 + SYNC_FLUSH_COMMANDS_BIT = 0x00000001 + SYNC_GPU_COMMANDS_COMPLETE = 0x9117 + SYNC_STATUS = 0x9114 + TESS_CONTROL_OUTPUT_VERTICES = 0x8E75 + TESS_CONTROL_SHADER = 0x8E88 + TESS_CONTROL_SHADER_BIT = 0x00000008 + TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1 + TESS_CONTROL_SUBROUTINE = 0x92E9 + TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF + TESS_CONTROL_TEXTURE = 0x829C + TESS_EVALUATION_SHADER = 0x8E87 + TESS_EVALUATION_SHADER_BIT = 0x00000010 + TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2 + TESS_EVALUATION_SUBROUTINE = 0x92EA + TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0 + TESS_EVALUATION_TEXTURE = 0x829D + TESS_GEN_MODE = 0x8E76 + TESS_GEN_POINT_MODE = 0x8E79 + TESS_GEN_SPACING = 0x8E77 + TESS_GEN_VERTEX_ORDER = 0x8E78 + TEXTURE = 0x1702 + TEXTURE0 = 0x84C0 + TEXTURE1 = 0x84C1 + TEXTURE10 = 0x84CA + TEXTURE11 = 0x84CB + TEXTURE12 = 0x84CC + TEXTURE13 = 0x84CD + TEXTURE14 = 0x84CE + TEXTURE15 = 0x84CF + TEXTURE16 = 0x84D0 + TEXTURE17 = 0x84D1 + TEXTURE18 = 0x84D2 + TEXTURE19 = 0x84D3 + TEXTURE2 = 0x84C2 + TEXTURE20 = 0x84D4 + TEXTURE21 = 0x84D5 + TEXTURE22 = 0x84D6 + TEXTURE23 = 0x84D7 + TEXTURE24 = 0x84D8 + TEXTURE25 = 0x84D9 + TEXTURE26 = 0x84DA + TEXTURE27 = 0x84DB + TEXTURE28 = 0x84DC + TEXTURE29 = 0x84DD + TEXTURE3 = 0x84C3 + TEXTURE30 = 0x84DE + TEXTURE31 = 0x84DF + TEXTURE4 = 0x84C4 + TEXTURE5 = 0x84C5 + TEXTURE6 = 0x84C6 + TEXTURE7 = 0x84C7 + TEXTURE8 = 0x84C8 + TEXTURE9 = 0x84C9 + TEXTURE_1D = 0x0DE0 + TEXTURE_1D_ARRAY = 0x8C18 + TEXTURE_2D = 0x0DE1 + TEXTURE_2D_ARRAY = 0x8C1A + TEXTURE_2D_MULTISAMPLE = 0x9100 + TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102 + TEXTURE_3D = 0x806F + TEXTURE_ALPHA_SIZE = 0x805F + TEXTURE_ALPHA_TYPE = 0x8C13 + TEXTURE_BASE_LEVEL = 0x813C + TEXTURE_BINDING = 0x82EB + TEXTURE_BINDING_1D = 0x8068 + TEXTURE_BINDING_1D_ARRAY = 0x8C1C + TEXTURE_BINDING_2D = 0x8069 + TEXTURE_BINDING_2D_ARRAY = 0x8C1D + TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104 + TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105 + TEXTURE_BINDING_3D = 0x806A + TEXTURE_BINDING_BUFFER = 0x8C2C + TEXTURE_BINDING_CUBE_MAP = 0x8514 + TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A + TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A + TEXTURE_BINDING_RECTANGLE = 0x84F6 + TEXTURE_BLUE_SIZE = 0x805E + TEXTURE_BLUE_TYPE = 0x8C12 + TEXTURE_BORDER_COLOR = 0x1004 + TEXTURE_BUFFER = 0x8C2A + TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D + TEXTURE_BUFFER_OFFSET = 0x919D + TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F + TEXTURE_BUFFER_SIZE = 0x919E + TEXTURE_COMPARE_FUNC = 0x884D + TEXTURE_COMPARE_MODE = 0x884C + TEXTURE_COMPRESSED = 0x86A1 + TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2 + TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3 + TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1 + TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0 + TEXTURE_COMPRESSION_HINT = 0x84EF + TEXTURE_CUBE_MAP = 0x8513 + TEXTURE_CUBE_MAP_ARRAY = 0x9009 + TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009 + TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516 + TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518 + TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A + TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 + TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517 + TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519 + TEXTURE_CUBE_MAP_SEAMLESS = 0x884F + TEXTURE_DEPTH = 0x8071 + TEXTURE_DEPTH_SIZE = 0x884A + TEXTURE_DEPTH_TYPE = 0x8C16 + TEXTURE_FETCH_BARRIER_BIT = 0x00000008 + TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107 + TEXTURE_GATHER = 0x82A2 + TEXTURE_GATHER_SHADOW = 0x82A3 + TEXTURE_GREEN_SIZE = 0x805D + TEXTURE_GREEN_TYPE = 0x8C11 + TEXTURE_HEIGHT = 0x1001 + TEXTURE_IMAGE_FORMAT = 0x828F + TEXTURE_IMAGE_TYPE = 0x8290 + TEXTURE_IMMUTABLE_FORMAT = 0x912F + TEXTURE_IMMUTABLE_LEVELS = 0x82DF + TEXTURE_INTERNAL_FORMAT = 0x1003 + TEXTURE_LOD_BIAS = 0x8501 + TEXTURE_MAG_FILTER = 0x2800 + TEXTURE_MAX_LEVEL = 0x813D + TEXTURE_MAX_LOD = 0x813B + TEXTURE_MIN_FILTER = 0x2801 + TEXTURE_MIN_LOD = 0x813A + TEXTURE_RECTANGLE = 0x84F5 + TEXTURE_RED_SIZE = 0x805C + TEXTURE_RED_TYPE = 0x8C10 + TEXTURE_SAMPLES = 0x9106 + TEXTURE_SHADOW = 0x82A1 + TEXTURE_SHARED_SIZE = 0x8C3F + TEXTURE_SPARSE_ARB = 0x91A6 + TEXTURE_STENCIL_SIZE = 0x88F1 + TEXTURE_SWIZZLE_A = 0x8E45 + TEXTURE_SWIZZLE_B = 0x8E44 + TEXTURE_SWIZZLE_G = 0x8E43 + TEXTURE_SWIZZLE_R = 0x8E42 + TEXTURE_SWIZZLE_RGBA = 0x8E46 + TEXTURE_TARGET = 0x1006 + TEXTURE_UPDATE_BARRIER_BIT = 0x00000100 + TEXTURE_VIEW = 0x82B5 + TEXTURE_VIEW_MIN_LAYER = 0x82DD + TEXTURE_VIEW_MIN_LEVEL = 0x82DB + TEXTURE_VIEW_NUM_LAYERS = 0x82DE + TEXTURE_VIEW_NUM_LEVELS = 0x82DC + TEXTURE_WIDTH = 0x1000 + TEXTURE_WRAP_R = 0x8072 + TEXTURE_WRAP_S = 0x2802 + TEXTURE_WRAP_T = 0x2803 + TIMEOUT_EXPIRED = 0x911B + TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF + TIMESTAMP = 0x8E28 + TIME_ELAPSED = 0x88BF + TOP_LEVEL_ARRAY_SIZE = 0x930C + TOP_LEVEL_ARRAY_STRIDE = 0x930D + TRANSFORM_FEEDBACK = 0x8E22 + TRANSFORM_FEEDBACK_ACTIVE = 0x8E24 + TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800 + TRANSFORM_FEEDBACK_BINDING = 0x8E25 + TRANSFORM_FEEDBACK_BUFFER = 0x8C8E + TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24 + TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F + TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B + TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F + TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23 + TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85 + TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84 + TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C + TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC + TRANSFORM_FEEDBACK_PAUSED = 0x8E23 + TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88 + TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED + TRANSFORM_FEEDBACK_VARYING = 0x92F4 + TRANSFORM_FEEDBACK_VARYINGS = 0x8C83 + TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76 + TRIANGLES = 0x0004 + TRIANGLES_ADJACENCY = 0x000C + TRIANGLE_FAN = 0x0006 + TRIANGLE_STRIP = 0x0005 + TRIANGLE_STRIP_ADJACENCY = 0x000D + TRUE = 1 + TYPE = 0x92FA + UNDEFINED_VERTEX = 0x8260 + UNIFORM = 0x92E1 + UNIFORM_ARRAY_STRIDE = 0x8A3C + UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA + UNIFORM_BARRIER_BIT = 0x00000004 + UNIFORM_BLOCK = 0x92E2 + UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42 + UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43 + UNIFORM_BLOCK_BINDING = 0x8A3F + UNIFORM_BLOCK_DATA_SIZE = 0x8A40 + UNIFORM_BLOCK_INDEX = 0x8A3A + UNIFORM_BLOCK_NAME_LENGTH = 0x8A41 + UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC + UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46 + UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45 + UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0 + UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1 + UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44 + UNIFORM_BUFFER = 0x8A11 + UNIFORM_BUFFER_BINDING = 0x8A28 + UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34 + UNIFORM_BUFFER_SIZE = 0x8A2A + UNIFORM_BUFFER_START = 0x8A29 + UNIFORM_IS_ROW_MAJOR = 0x8A3E + UNIFORM_MATRIX_STRIDE = 0x8A3D + UNIFORM_NAME_LENGTH = 0x8A39 + UNIFORM_OFFSET = 0x8A3B + UNIFORM_SIZE = 0x8A38 + UNIFORM_TYPE = 0x8A37 + UNKNOWN_CONTEXT_RESET = 0x8255 + UNKNOWN_CONTEXT_RESET_ARB = 0x8255 + UNKNOWN_CONTEXT_RESET_KHR = 0x8255 + UNPACK_ALIGNMENT = 0x0CF5 + UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129 + UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128 + UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A + UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127 + UNPACK_IMAGE_HEIGHT = 0x806E + UNPACK_LSB_FIRST = 0x0CF1 + UNPACK_ROW_LENGTH = 0x0CF2 + UNPACK_SKIP_IMAGES = 0x806D + UNPACK_SKIP_PIXELS = 0x0CF4 + UNPACK_SKIP_ROWS = 0x0CF3 + UNPACK_SWAP_BYTES = 0x0CF0 + UNSIGNALED = 0x9118 + UNSIGNED_BYTE = 0x1401 + UNSIGNED_BYTE_2_3_3_REV = 0x8362 + UNSIGNED_BYTE_3_3_2 = 0x8032 + UNSIGNED_INT = 0x1405 + UNSIGNED_INT64_ARB = 0x140F + UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B + UNSIGNED_INT_10_10_10_2 = 0x8036 + UNSIGNED_INT_24_8 = 0x84FA + UNSIGNED_INT_2_10_10_10_REV = 0x8368 + UNSIGNED_INT_5_9_9_9_REV = 0x8C3E + UNSIGNED_INT_8_8_8_8 = 0x8035 + UNSIGNED_INT_8_8_8_8_REV = 0x8367 + UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB + UNSIGNED_INT_IMAGE_1D = 0x9062 + UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068 + UNSIGNED_INT_IMAGE_2D = 0x9063 + UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069 + UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B + UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C + UNSIGNED_INT_IMAGE_2D_RECT = 0x9065 + UNSIGNED_INT_IMAGE_3D = 0x9064 + UNSIGNED_INT_IMAGE_BUFFER = 0x9067 + UNSIGNED_INT_IMAGE_CUBE = 0x9066 + UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A + UNSIGNED_INT_SAMPLER_1D = 0x8DD1 + UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6 + UNSIGNED_INT_SAMPLER_2D = 0x8DD2 + UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7 + UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A + UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D + UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5 + UNSIGNED_INT_SAMPLER_3D = 0x8DD3 + UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8 + UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4 + UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F + UNSIGNED_INT_VEC2 = 0x8DC6 + UNSIGNED_INT_VEC3 = 0x8DC7 + UNSIGNED_INT_VEC4 = 0x8DC8 + UNSIGNED_NORMALIZED = 0x8C17 + UNSIGNED_SHORT = 0x1403 + UNSIGNED_SHORT_1_5_5_5_REV = 0x8366 + UNSIGNED_SHORT_4_4_4_4 = 0x8033 + UNSIGNED_SHORT_4_4_4_4_REV = 0x8365 + UNSIGNED_SHORT_5_5_5_1 = 0x8034 + UNSIGNED_SHORT_5_6_5 = 0x8363 + UNSIGNED_SHORT_5_6_5_REV = 0x8364 + UPPER_LEFT = 0x8CA2 + VALIDATE_STATUS = 0x8B83 + VENDOR = 0x1F00 + VERSION = 0x1F02 + VERTEX_ARRAY = 0x8074 + VERTEX_ARRAY_BINDING = 0x85B5 + VERTEX_ARRAY_KHR = 0x8074 + VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001 + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F + VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE + VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 + VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD + VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A + VERTEX_ATTRIB_ARRAY_POINTER = 0x8645 + VERTEX_ATTRIB_ARRAY_SIZE = 0x8623 + VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624 + VERTEX_ATTRIB_ARRAY_TYPE = 0x8625 + VERTEX_ATTRIB_BINDING = 0x82D4 + VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5 + VERTEX_BINDING_DIVISOR = 0x82D6 + VERTEX_BINDING_OFFSET = 0x82D7 + VERTEX_BINDING_STRIDE = 0x82D8 + VERTEX_PROGRAM_POINT_SIZE = 0x8642 + VERTEX_SHADER = 0x8B31 + VERTEX_SHADER_BIT = 0x00000001 + VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0 + VERTEX_SUBROUTINE = 0x92E8 + VERTEX_SUBROUTINE_UNIFORM = 0x92EE + VERTEX_TEXTURE = 0x829B + VERTICES_SUBMITTED_ARB = 0x82EE + VIEWPORT = 0x0BA2 + VIEWPORT_BOUNDS_RANGE = 0x825D + VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F + VIEWPORT_SUBPIXEL_BITS = 0x825C + VIEW_CLASS_128_BITS = 0x82C4 + VIEW_CLASS_16_BITS = 0x82CA + VIEW_CLASS_24_BITS = 0x82C9 + VIEW_CLASS_32_BITS = 0x82C8 + VIEW_CLASS_48_BITS = 0x82C7 + VIEW_CLASS_64_BITS = 0x82C6 + VIEW_CLASS_8_BITS = 0x82CB + VIEW_CLASS_96_BITS = 0x82C5 + VIEW_CLASS_BPTC_FLOAT = 0x82D3 + VIEW_CLASS_BPTC_UNORM = 0x82D2 + VIEW_CLASS_RGTC1_RED = 0x82D0 + VIEW_CLASS_RGTC2_RG = 0x82D1 + VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC + VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD + VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE + VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF + VIEW_COMPATIBILITY_CLASS = 0x82B6 + VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7 + VIRTUAL_PAGE_SIZE_X_ARB = 0x9195 + VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196 + VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197 + WAIT_FAILED = 0x911D + WRITE_ONLY = 0x88B9 + XOR = 0x1506 + ZERO = 0 + ZERO_TO_ONE = 0x935F +) + +var ( + gpActiveShaderProgram C.GPACTIVESHADERPROGRAM + gpActiveTexture C.GPACTIVETEXTURE + gpAttachShader C.GPATTACHSHADER + gpBeginConditionalRender C.GPBEGINCONDITIONALRENDER + gpBeginQuery C.GPBEGINQUERY + gpBeginQueryIndexed C.GPBEGINQUERYINDEXED + gpBeginTransformFeedback C.GPBEGINTRANSFORMFEEDBACK + gpBindAttribLocation C.GPBINDATTRIBLOCATION + gpBindBuffer C.GPBINDBUFFER + gpBindBufferBase C.GPBINDBUFFERBASE + gpBindBufferRange C.GPBINDBUFFERRANGE + gpBindBuffersBase C.GPBINDBUFFERSBASE + gpBindBuffersRange C.GPBINDBUFFERSRANGE + gpBindFragDataLocation C.GPBINDFRAGDATALOCATION + gpBindFragDataLocationIndexed C.GPBINDFRAGDATALOCATIONINDEXED + gpBindFramebuffer C.GPBINDFRAMEBUFFER + gpBindImageTexture C.GPBINDIMAGETEXTURE + gpBindImageTextures C.GPBINDIMAGETEXTURES + gpBindProgramPipeline C.GPBINDPROGRAMPIPELINE + gpBindRenderbuffer C.GPBINDRENDERBUFFER + gpBindSampler C.GPBINDSAMPLER + gpBindSamplers C.GPBINDSAMPLERS + gpBindTexture C.GPBINDTEXTURE + gpBindTextureUnit C.GPBINDTEXTUREUNIT + gpBindTextures C.GPBINDTEXTURES + gpBindTransformFeedback C.GPBINDTRANSFORMFEEDBACK + gpBindVertexArray C.GPBINDVERTEXARRAY + gpBindVertexBuffer C.GPBINDVERTEXBUFFER + gpBindVertexBuffers C.GPBINDVERTEXBUFFERS + gpBlendColor C.GPBLENDCOLOR + gpBlendEquation C.GPBLENDEQUATION + gpBlendEquationSeparate C.GPBLENDEQUATIONSEPARATE + gpBlendEquationSeparateiARB C.GPBLENDEQUATIONSEPARATEIARB + gpBlendEquationiARB C.GPBLENDEQUATIONIARB + gpBlendFunc C.GPBLENDFUNC + gpBlendFuncSeparate C.GPBLENDFUNCSEPARATE + gpBlendFuncSeparateiARB C.GPBLENDFUNCSEPARATEIARB + gpBlendFunciARB C.GPBLENDFUNCIARB + gpBlitFramebuffer C.GPBLITFRAMEBUFFER + gpBlitNamedFramebuffer C.GPBLITNAMEDFRAMEBUFFER + gpBufferData C.GPBUFFERDATA + gpBufferPageCommitmentARB C.GPBUFFERPAGECOMMITMENTARB + gpBufferStorage C.GPBUFFERSTORAGE + gpBufferSubData C.GPBUFFERSUBDATA + gpCheckFramebufferStatus C.GPCHECKFRAMEBUFFERSTATUS + gpCheckNamedFramebufferStatus C.GPCHECKNAMEDFRAMEBUFFERSTATUS + gpClampColor C.GPCLAMPCOLOR + gpClear C.GPCLEAR + gpClearBufferData C.GPCLEARBUFFERDATA + gpClearBufferSubData C.GPCLEARBUFFERSUBDATA + gpClearBufferfi C.GPCLEARBUFFERFI + gpClearBufferfv C.GPCLEARBUFFERFV + gpClearBufferiv C.GPCLEARBUFFERIV + gpClearBufferuiv C.GPCLEARBUFFERUIV + gpClearColor C.GPCLEARCOLOR + gpClearDepth C.GPCLEARDEPTH + gpClearDepthf C.GPCLEARDEPTHF + gpClearNamedBufferData C.GPCLEARNAMEDBUFFERDATA + gpClearNamedBufferSubData C.GPCLEARNAMEDBUFFERSUBDATA + gpClearNamedFramebufferfi C.GPCLEARNAMEDFRAMEBUFFERFI + gpClearNamedFramebufferfv C.GPCLEARNAMEDFRAMEBUFFERFV + gpClearNamedFramebufferiv C.GPCLEARNAMEDFRAMEBUFFERIV + gpClearNamedFramebufferuiv C.GPCLEARNAMEDFRAMEBUFFERUIV + gpClearStencil C.GPCLEARSTENCIL + gpClearTexImage C.GPCLEARTEXIMAGE + gpClearTexSubImage C.GPCLEARTEXSUBIMAGE + gpClientWaitSync C.GPCLIENTWAITSYNC + gpClipControl C.GPCLIPCONTROL + gpColorMask C.GPCOLORMASK + gpColorMaski C.GPCOLORMASKI + gpCompileShader C.GPCOMPILESHADER + gpCompileShaderIncludeARB C.GPCOMPILESHADERINCLUDEARB + gpCompressedTexImage1D C.GPCOMPRESSEDTEXIMAGE1D + gpCompressedTexImage2D C.GPCOMPRESSEDTEXIMAGE2D + gpCompressedTexImage3D C.GPCOMPRESSEDTEXIMAGE3D + gpCompressedTexSubImage1D C.GPCOMPRESSEDTEXSUBIMAGE1D + gpCompressedTexSubImage2D C.GPCOMPRESSEDTEXSUBIMAGE2D + gpCompressedTexSubImage3D C.GPCOMPRESSEDTEXSUBIMAGE3D + gpCompressedTextureSubImage1D C.GPCOMPRESSEDTEXTURESUBIMAGE1D + gpCompressedTextureSubImage2D C.GPCOMPRESSEDTEXTURESUBIMAGE2D + gpCompressedTextureSubImage3D C.GPCOMPRESSEDTEXTURESUBIMAGE3D + gpCopyBufferSubData C.GPCOPYBUFFERSUBDATA + gpCopyImageSubData C.GPCOPYIMAGESUBDATA + gpCopyNamedBufferSubData C.GPCOPYNAMEDBUFFERSUBDATA + gpCopyTexImage1D C.GPCOPYTEXIMAGE1D + gpCopyTexImage2D C.GPCOPYTEXIMAGE2D + gpCopyTexSubImage1D C.GPCOPYTEXSUBIMAGE1D + gpCopyTexSubImage2D C.GPCOPYTEXSUBIMAGE2D + gpCopyTexSubImage3D C.GPCOPYTEXSUBIMAGE3D + gpCopyTextureSubImage1D C.GPCOPYTEXTURESUBIMAGE1D + gpCopyTextureSubImage2D C.GPCOPYTEXTURESUBIMAGE2D + gpCopyTextureSubImage3D C.GPCOPYTEXTURESUBIMAGE3D + gpCreateBuffers C.GPCREATEBUFFERS + gpCreateFramebuffers C.GPCREATEFRAMEBUFFERS + gpCreateProgram C.GPCREATEPROGRAM + gpCreateProgramPipelines C.GPCREATEPROGRAMPIPELINES + gpCreateQueries C.GPCREATEQUERIES + gpCreateRenderbuffers C.GPCREATERENDERBUFFERS + gpCreateSamplers C.GPCREATESAMPLERS + gpCreateShader C.GPCREATESHADER + gpCreateShaderProgramv C.GPCREATESHADERPROGRAMV + gpCreateSyncFromCLeventARB C.GPCREATESYNCFROMCLEVENTARB + gpCreateTextures C.GPCREATETEXTURES + gpCreateTransformFeedbacks C.GPCREATETRANSFORMFEEDBACKS + gpCreateVertexArrays C.GPCREATEVERTEXARRAYS + gpCullFace C.GPCULLFACE + gpDebugMessageCallback C.GPDEBUGMESSAGECALLBACK + gpDebugMessageCallbackARB C.GPDEBUGMESSAGECALLBACKARB + gpDebugMessageCallbackKHR C.GPDEBUGMESSAGECALLBACKKHR + gpDebugMessageControl C.GPDEBUGMESSAGECONTROL + gpDebugMessageControlARB C.GPDEBUGMESSAGECONTROLARB + gpDebugMessageControlKHR C.GPDEBUGMESSAGECONTROLKHR + gpDebugMessageInsert C.GPDEBUGMESSAGEINSERT + gpDebugMessageInsertARB C.GPDEBUGMESSAGEINSERTARB + gpDebugMessageInsertKHR C.GPDEBUGMESSAGEINSERTKHR + gpDeleteBuffers C.GPDELETEBUFFERS + gpDeleteFramebuffers C.GPDELETEFRAMEBUFFERS + gpDeleteNamedStringARB C.GPDELETENAMEDSTRINGARB + gpDeleteProgram C.GPDELETEPROGRAM + gpDeleteProgramPipelines C.GPDELETEPROGRAMPIPELINES + gpDeleteQueries C.GPDELETEQUERIES + gpDeleteRenderbuffers C.GPDELETERENDERBUFFERS + gpDeleteSamplers C.GPDELETESAMPLERS + gpDeleteShader C.GPDELETESHADER + gpDeleteSync C.GPDELETESYNC + gpDeleteTextures C.GPDELETETEXTURES + gpDeleteTransformFeedbacks C.GPDELETETRANSFORMFEEDBACKS + gpDeleteVertexArrays C.GPDELETEVERTEXARRAYS + gpDepthFunc C.GPDEPTHFUNC + gpDepthMask C.GPDEPTHMASK + gpDepthRange C.GPDEPTHRANGE + gpDepthRangeArrayv C.GPDEPTHRANGEARRAYV + gpDepthRangeIndexed C.GPDEPTHRANGEINDEXED + gpDepthRangef C.GPDEPTHRANGEF + gpDetachShader C.GPDETACHSHADER + gpDisable C.GPDISABLE + gpDisableVertexArrayAttrib C.GPDISABLEVERTEXARRAYATTRIB + gpDisableVertexAttribArray C.GPDISABLEVERTEXATTRIBARRAY + gpDisablei C.GPDISABLEI + gpDispatchCompute C.GPDISPATCHCOMPUTE + gpDispatchComputeGroupSizeARB C.GPDISPATCHCOMPUTEGROUPSIZEARB + gpDispatchComputeIndirect C.GPDISPATCHCOMPUTEINDIRECT + gpDrawArrays C.GPDRAWARRAYS + gpDrawArraysIndirect C.GPDRAWARRAYSINDIRECT + gpDrawArraysInstanced C.GPDRAWARRAYSINSTANCED + gpDrawArraysInstancedBaseInstance C.GPDRAWARRAYSINSTANCEDBASEINSTANCE + gpDrawBuffer C.GPDRAWBUFFER + gpDrawBuffers C.GPDRAWBUFFERS + gpDrawElements C.GPDRAWELEMENTS + gpDrawElementsBaseVertex C.GPDRAWELEMENTSBASEVERTEX + gpDrawElementsIndirect C.GPDRAWELEMENTSINDIRECT + gpDrawElementsInstanced C.GPDRAWELEMENTSINSTANCED + gpDrawElementsInstancedBaseInstance C.GPDRAWELEMENTSINSTANCEDBASEINSTANCE + gpDrawElementsInstancedBaseVertex C.GPDRAWELEMENTSINSTANCEDBASEVERTEX + gpDrawElementsInstancedBaseVertexBaseInstance C.GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE + gpDrawRangeElements C.GPDRAWRANGEELEMENTS + gpDrawRangeElementsBaseVertex C.GPDRAWRANGEELEMENTSBASEVERTEX + gpDrawTransformFeedback C.GPDRAWTRANSFORMFEEDBACK + gpDrawTransformFeedbackInstanced C.GPDRAWTRANSFORMFEEDBACKINSTANCED + gpDrawTransformFeedbackStream C.GPDRAWTRANSFORMFEEDBACKSTREAM + gpDrawTransformFeedbackStreamInstanced C.GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED + gpEnable C.GPENABLE + gpEnableVertexArrayAttrib C.GPENABLEVERTEXARRAYATTRIB + gpEnableVertexAttribArray C.GPENABLEVERTEXATTRIBARRAY + gpEnablei C.GPENABLEI + gpEndConditionalRender C.GPENDCONDITIONALRENDER + gpEndQuery C.GPENDQUERY + gpEndQueryIndexed C.GPENDQUERYINDEXED + gpEndTransformFeedback C.GPENDTRANSFORMFEEDBACK + gpFenceSync C.GPFENCESYNC + gpFinish C.GPFINISH + gpFlush C.GPFLUSH + gpFlushMappedBufferRange C.GPFLUSHMAPPEDBUFFERRANGE + gpFlushMappedNamedBufferRange C.GPFLUSHMAPPEDNAMEDBUFFERRANGE + gpFramebufferParameteri C.GPFRAMEBUFFERPARAMETERI + gpFramebufferRenderbuffer C.GPFRAMEBUFFERRENDERBUFFER + gpFramebufferTexture C.GPFRAMEBUFFERTEXTURE + gpFramebufferTexture1D C.GPFRAMEBUFFERTEXTURE1D + gpFramebufferTexture2D C.GPFRAMEBUFFERTEXTURE2D + gpFramebufferTexture3D C.GPFRAMEBUFFERTEXTURE3D + gpFramebufferTextureLayer C.GPFRAMEBUFFERTEXTURELAYER + gpFrontFace C.GPFRONTFACE + gpGenBuffers C.GPGENBUFFERS + gpGenFramebuffers C.GPGENFRAMEBUFFERS + gpGenProgramPipelines C.GPGENPROGRAMPIPELINES + gpGenQueries C.GPGENQUERIES + gpGenRenderbuffers C.GPGENRENDERBUFFERS + gpGenSamplers C.GPGENSAMPLERS + gpGenTextures C.GPGENTEXTURES + gpGenTransformFeedbacks C.GPGENTRANSFORMFEEDBACKS + gpGenVertexArrays C.GPGENVERTEXARRAYS + gpGenerateMipmap C.GPGENERATEMIPMAP + gpGenerateTextureMipmap C.GPGENERATETEXTUREMIPMAP + gpGetActiveAtomicCounterBufferiv C.GPGETACTIVEATOMICCOUNTERBUFFERIV + gpGetActiveAttrib C.GPGETACTIVEATTRIB + gpGetActiveSubroutineName C.GPGETACTIVESUBROUTINENAME + gpGetActiveSubroutineUniformName C.GPGETACTIVESUBROUTINEUNIFORMNAME + gpGetActiveSubroutineUniformiv C.GPGETACTIVESUBROUTINEUNIFORMIV + gpGetActiveUniform C.GPGETACTIVEUNIFORM + gpGetActiveUniformBlockName C.GPGETACTIVEUNIFORMBLOCKNAME + gpGetActiveUniformBlockiv C.GPGETACTIVEUNIFORMBLOCKIV + gpGetActiveUniformName C.GPGETACTIVEUNIFORMNAME + gpGetActiveUniformsiv C.GPGETACTIVEUNIFORMSIV + gpGetAttachedShaders C.GPGETATTACHEDSHADERS + gpGetAttribLocation C.GPGETATTRIBLOCATION + gpGetBooleani_v C.GPGETBOOLEANI_V + gpGetBooleanv C.GPGETBOOLEANV + gpGetBufferParameteri64v C.GPGETBUFFERPARAMETERI64V + gpGetBufferParameteriv C.GPGETBUFFERPARAMETERIV + gpGetBufferPointerv C.GPGETBUFFERPOINTERV + gpGetBufferSubData C.GPGETBUFFERSUBDATA + gpGetCompressedTexImage C.GPGETCOMPRESSEDTEXIMAGE + gpGetCompressedTextureImage C.GPGETCOMPRESSEDTEXTUREIMAGE + gpGetCompressedTextureSubImage C.GPGETCOMPRESSEDTEXTURESUBIMAGE + gpGetDebugMessageLog C.GPGETDEBUGMESSAGELOG + gpGetDebugMessageLogARB C.GPGETDEBUGMESSAGELOGARB + gpGetDebugMessageLogKHR C.GPGETDEBUGMESSAGELOGKHR + gpGetDoublei_v C.GPGETDOUBLEI_V + gpGetDoublev C.GPGETDOUBLEV + gpGetError C.GPGETERROR + gpGetFloati_v C.GPGETFLOATI_V + gpGetFloatv C.GPGETFLOATV + gpGetFragDataIndex C.GPGETFRAGDATAINDEX + gpGetFragDataLocation C.GPGETFRAGDATALOCATION + gpGetFramebufferAttachmentParameteriv C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV + gpGetFramebufferParameteriv C.GPGETFRAMEBUFFERPARAMETERIV + gpGetGraphicsResetStatus C.GPGETGRAPHICSRESETSTATUS + gpGetGraphicsResetStatusARB C.GPGETGRAPHICSRESETSTATUSARB + gpGetGraphicsResetStatusKHR C.GPGETGRAPHICSRESETSTATUSKHR + gpGetImageHandleARB C.GPGETIMAGEHANDLEARB + gpGetInteger64i_v C.GPGETINTEGER64I_V + gpGetInteger64v C.GPGETINTEGER64V + gpGetIntegeri_v C.GPGETINTEGERI_V + gpGetIntegerv C.GPGETINTEGERV + gpGetInternalformati64v C.GPGETINTERNALFORMATI64V + gpGetInternalformativ C.GPGETINTERNALFORMATIV + gpGetMultisamplefv C.GPGETMULTISAMPLEFV + gpGetNamedBufferParameteri64v C.GPGETNAMEDBUFFERPARAMETERI64V + gpGetNamedBufferParameteriv C.GPGETNAMEDBUFFERPARAMETERIV + gpGetNamedBufferPointerv C.GPGETNAMEDBUFFERPOINTERV + gpGetNamedBufferSubData C.GPGETNAMEDBUFFERSUBDATA + gpGetNamedFramebufferAttachmentParameteriv C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV + gpGetNamedFramebufferParameteriv C.GPGETNAMEDFRAMEBUFFERPARAMETERIV + gpGetNamedRenderbufferParameteriv C.GPGETNAMEDRENDERBUFFERPARAMETERIV + gpGetNamedStringARB C.GPGETNAMEDSTRINGARB + gpGetNamedStringivARB C.GPGETNAMEDSTRINGIVARB + gpGetObjectLabel C.GPGETOBJECTLABEL + gpGetObjectLabelKHR C.GPGETOBJECTLABELKHR + gpGetObjectPtrLabel C.GPGETOBJECTPTRLABEL + gpGetObjectPtrLabelKHR C.GPGETOBJECTPTRLABELKHR + gpGetPointerv C.GPGETPOINTERV + gpGetPointervKHR C.GPGETPOINTERVKHR + gpGetProgramBinary C.GPGETPROGRAMBINARY + gpGetProgramInfoLog C.GPGETPROGRAMINFOLOG + gpGetProgramInterfaceiv C.GPGETPROGRAMINTERFACEIV + gpGetProgramPipelineInfoLog C.GPGETPROGRAMPIPELINEINFOLOG + gpGetProgramPipelineiv C.GPGETPROGRAMPIPELINEIV + gpGetProgramResourceIndex C.GPGETPROGRAMRESOURCEINDEX + gpGetProgramResourceLocation C.GPGETPROGRAMRESOURCELOCATION + gpGetProgramResourceLocationIndex C.GPGETPROGRAMRESOURCELOCATIONINDEX + gpGetProgramResourceName C.GPGETPROGRAMRESOURCENAME + gpGetProgramResourceiv C.GPGETPROGRAMRESOURCEIV + gpGetProgramStageiv C.GPGETPROGRAMSTAGEIV + gpGetProgramiv C.GPGETPROGRAMIV + gpGetQueryIndexediv C.GPGETQUERYINDEXEDIV + gpGetQueryObjecti64v C.GPGETQUERYOBJECTI64V + gpGetQueryObjectiv C.GPGETQUERYOBJECTIV + gpGetQueryObjectui64v C.GPGETQUERYOBJECTUI64V + gpGetQueryObjectuiv C.GPGETQUERYOBJECTUIV + gpGetQueryiv C.GPGETQUERYIV + gpGetRenderbufferParameteriv C.GPGETRENDERBUFFERPARAMETERIV + gpGetSamplerParameterIiv C.GPGETSAMPLERPARAMETERIIV + gpGetSamplerParameterIuiv C.GPGETSAMPLERPARAMETERIUIV + gpGetSamplerParameterfv C.GPGETSAMPLERPARAMETERFV + gpGetSamplerParameteriv C.GPGETSAMPLERPARAMETERIV + gpGetShaderInfoLog C.GPGETSHADERINFOLOG + gpGetShaderPrecisionFormat C.GPGETSHADERPRECISIONFORMAT + gpGetShaderSource C.GPGETSHADERSOURCE + gpGetShaderiv C.GPGETSHADERIV + gpGetString C.GPGETSTRING + gpGetStringi C.GPGETSTRINGI + gpGetSubroutineIndex C.GPGETSUBROUTINEINDEX + gpGetSubroutineUniformLocation C.GPGETSUBROUTINEUNIFORMLOCATION + gpGetSynciv C.GPGETSYNCIV + gpGetTexImage C.GPGETTEXIMAGE + gpGetTexLevelParameterfv C.GPGETTEXLEVELPARAMETERFV + gpGetTexLevelParameteriv C.GPGETTEXLEVELPARAMETERIV + gpGetTexParameterIiv C.GPGETTEXPARAMETERIIV + gpGetTexParameterIuiv C.GPGETTEXPARAMETERIUIV + gpGetTexParameterfv C.GPGETTEXPARAMETERFV + gpGetTexParameteriv C.GPGETTEXPARAMETERIV + gpGetTextureHandleARB C.GPGETTEXTUREHANDLEARB + gpGetTextureImage C.GPGETTEXTUREIMAGE + gpGetTextureLevelParameterfv C.GPGETTEXTURELEVELPARAMETERFV + gpGetTextureLevelParameteriv C.GPGETTEXTURELEVELPARAMETERIV + gpGetTextureParameterIiv C.GPGETTEXTUREPARAMETERIIV + gpGetTextureParameterIuiv C.GPGETTEXTUREPARAMETERIUIV + gpGetTextureParameterfv C.GPGETTEXTUREPARAMETERFV + gpGetTextureParameteriv C.GPGETTEXTUREPARAMETERIV + gpGetTextureSamplerHandleARB C.GPGETTEXTURESAMPLERHANDLEARB + gpGetTextureSubImage C.GPGETTEXTURESUBIMAGE + gpGetTransformFeedbackVarying C.GPGETTRANSFORMFEEDBACKVARYING + gpGetTransformFeedbacki64_v C.GPGETTRANSFORMFEEDBACKI64_V + gpGetTransformFeedbacki_v C.GPGETTRANSFORMFEEDBACKI_V + gpGetTransformFeedbackiv C.GPGETTRANSFORMFEEDBACKIV + gpGetUniformBlockIndex C.GPGETUNIFORMBLOCKINDEX + gpGetUniformIndices C.GPGETUNIFORMINDICES + gpGetUniformLocation C.GPGETUNIFORMLOCATION + gpGetUniformSubroutineuiv C.GPGETUNIFORMSUBROUTINEUIV + gpGetUniformdv C.GPGETUNIFORMDV + gpGetUniformfv C.GPGETUNIFORMFV + gpGetUniformiv C.GPGETUNIFORMIV + gpGetUniformuiv C.GPGETUNIFORMUIV + gpGetVertexArrayIndexed64iv C.GPGETVERTEXARRAYINDEXED64IV + gpGetVertexArrayIndexediv C.GPGETVERTEXARRAYINDEXEDIV + gpGetVertexArrayiv C.GPGETVERTEXARRAYIV + gpGetVertexAttribIiv C.GPGETVERTEXATTRIBIIV + gpGetVertexAttribIuiv C.GPGETVERTEXATTRIBIUIV + gpGetVertexAttribLdv C.GPGETVERTEXATTRIBLDV + gpGetVertexAttribLui64vARB C.GPGETVERTEXATTRIBLUI64VARB + gpGetVertexAttribPointerv C.GPGETVERTEXATTRIBPOINTERV + gpGetVertexAttribdv C.GPGETVERTEXATTRIBDV + gpGetVertexAttribfv C.GPGETVERTEXATTRIBFV + gpGetVertexAttribiv C.GPGETVERTEXATTRIBIV + gpGetnCompressedTexImageARB C.GPGETNCOMPRESSEDTEXIMAGEARB + gpGetnTexImageARB C.GPGETNTEXIMAGEARB + gpGetnUniformdvARB C.GPGETNUNIFORMDVARB + gpGetnUniformfv C.GPGETNUNIFORMFV + gpGetnUniformfvARB C.GPGETNUNIFORMFVARB + gpGetnUniformfvKHR C.GPGETNUNIFORMFVKHR + gpGetnUniformiv C.GPGETNUNIFORMIV + gpGetnUniformivARB C.GPGETNUNIFORMIVARB + gpGetnUniformivKHR C.GPGETNUNIFORMIVKHR + gpGetnUniformuiv C.GPGETNUNIFORMUIV + gpGetnUniformuivARB C.GPGETNUNIFORMUIVARB + gpGetnUniformuivKHR C.GPGETNUNIFORMUIVKHR + gpHint C.GPHINT + gpInvalidateBufferData C.GPINVALIDATEBUFFERDATA + gpInvalidateBufferSubData C.GPINVALIDATEBUFFERSUBDATA + gpInvalidateFramebuffer C.GPINVALIDATEFRAMEBUFFER + gpInvalidateNamedFramebufferData C.GPINVALIDATENAMEDFRAMEBUFFERDATA + gpInvalidateNamedFramebufferSubData C.GPINVALIDATENAMEDFRAMEBUFFERSUBDATA + gpInvalidateSubFramebuffer C.GPINVALIDATESUBFRAMEBUFFER + gpInvalidateTexImage C.GPINVALIDATETEXIMAGE + gpInvalidateTexSubImage C.GPINVALIDATETEXSUBIMAGE + gpIsBuffer C.GPISBUFFER + gpIsEnabled C.GPISENABLED + gpIsEnabledi C.GPISENABLEDI + gpIsFramebuffer C.GPISFRAMEBUFFER + gpIsImageHandleResidentARB C.GPISIMAGEHANDLERESIDENTARB + gpIsNamedStringARB C.GPISNAMEDSTRINGARB + gpIsProgram C.GPISPROGRAM + gpIsProgramPipeline C.GPISPROGRAMPIPELINE + gpIsQuery C.GPISQUERY + gpIsRenderbuffer C.GPISRENDERBUFFER + gpIsSampler C.GPISSAMPLER + gpIsShader C.GPISSHADER + gpIsSync C.GPISSYNC + gpIsTexture C.GPISTEXTURE + gpIsTextureHandleResidentARB C.GPISTEXTUREHANDLERESIDENTARB + gpIsTransformFeedback C.GPISTRANSFORMFEEDBACK + gpIsVertexArray C.GPISVERTEXARRAY + gpLineWidth C.GPLINEWIDTH + gpLinkProgram C.GPLINKPROGRAM + gpLogicOp C.GPLOGICOP + gpMakeImageHandleNonResidentARB C.GPMAKEIMAGEHANDLENONRESIDENTARB + gpMakeImageHandleResidentARB C.GPMAKEIMAGEHANDLERESIDENTARB + gpMakeTextureHandleNonResidentARB C.GPMAKETEXTUREHANDLENONRESIDENTARB + gpMakeTextureHandleResidentARB C.GPMAKETEXTUREHANDLERESIDENTARB + gpMapBuffer C.GPMAPBUFFER + gpMapBufferRange C.GPMAPBUFFERRANGE + gpMapNamedBuffer C.GPMAPNAMEDBUFFER + gpMapNamedBufferRange C.GPMAPNAMEDBUFFERRANGE + gpMemoryBarrier C.GPMEMORYBARRIER + gpMemoryBarrierByRegion C.GPMEMORYBARRIERBYREGION + gpMinSampleShadingARB C.GPMINSAMPLESHADINGARB + gpMultiDrawArrays C.GPMULTIDRAWARRAYS + gpMultiDrawArraysIndirect C.GPMULTIDRAWARRAYSINDIRECT + gpMultiDrawArraysIndirectCountARB C.GPMULTIDRAWARRAYSINDIRECTCOUNTARB + gpMultiDrawElements C.GPMULTIDRAWELEMENTS + gpMultiDrawElementsBaseVertex C.GPMULTIDRAWELEMENTSBASEVERTEX + gpMultiDrawElementsIndirect C.GPMULTIDRAWELEMENTSINDIRECT + gpMultiDrawElementsIndirectCountARB C.GPMULTIDRAWELEMENTSINDIRECTCOUNTARB + gpNamedBufferData C.GPNAMEDBUFFERDATA + gpNamedBufferPageCommitmentARB C.GPNAMEDBUFFERPAGECOMMITMENTARB + gpNamedBufferPageCommitmentEXT C.GPNAMEDBUFFERPAGECOMMITMENTEXT + gpNamedBufferStorage C.GPNAMEDBUFFERSTORAGE + gpNamedBufferSubData C.GPNAMEDBUFFERSUBDATA + gpNamedFramebufferDrawBuffer C.GPNAMEDFRAMEBUFFERDRAWBUFFER + gpNamedFramebufferDrawBuffers C.GPNAMEDFRAMEBUFFERDRAWBUFFERS + gpNamedFramebufferParameteri C.GPNAMEDFRAMEBUFFERPARAMETERI + gpNamedFramebufferReadBuffer C.GPNAMEDFRAMEBUFFERREADBUFFER + gpNamedFramebufferRenderbuffer C.GPNAMEDFRAMEBUFFERRENDERBUFFER + gpNamedFramebufferTexture C.GPNAMEDFRAMEBUFFERTEXTURE + gpNamedFramebufferTextureLayer C.GPNAMEDFRAMEBUFFERTEXTURELAYER + gpNamedRenderbufferStorage C.GPNAMEDRENDERBUFFERSTORAGE + gpNamedRenderbufferStorageMultisample C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE + gpNamedStringARB C.GPNAMEDSTRINGARB + gpObjectLabel C.GPOBJECTLABEL + gpObjectLabelKHR C.GPOBJECTLABELKHR + gpObjectPtrLabel C.GPOBJECTPTRLABEL + gpObjectPtrLabelKHR C.GPOBJECTPTRLABELKHR + gpPatchParameterfv C.GPPATCHPARAMETERFV + gpPatchParameteri C.GPPATCHPARAMETERI + gpPauseTransformFeedback C.GPPAUSETRANSFORMFEEDBACK + gpPixelStoref C.GPPIXELSTOREF + gpPixelStorei C.GPPIXELSTOREI + gpPointParameterf C.GPPOINTPARAMETERF + gpPointParameterfv C.GPPOINTPARAMETERFV + gpPointParameteri C.GPPOINTPARAMETERI + gpPointParameteriv C.GPPOINTPARAMETERIV + gpPointSize C.GPPOINTSIZE + gpPolygonMode C.GPPOLYGONMODE + gpPolygonOffset C.GPPOLYGONOFFSET + gpPopDebugGroup C.GPPOPDEBUGGROUP + gpPopDebugGroupKHR C.GPPOPDEBUGGROUPKHR + gpPrimitiveRestartIndex C.GPPRIMITIVERESTARTINDEX + gpProgramBinary C.GPPROGRAMBINARY + gpProgramParameteri C.GPPROGRAMPARAMETERI + gpProgramUniform1d C.GPPROGRAMUNIFORM1D + gpProgramUniform1dv C.GPPROGRAMUNIFORM1DV + gpProgramUniform1f C.GPPROGRAMUNIFORM1F + gpProgramUniform1fv C.GPPROGRAMUNIFORM1FV + gpProgramUniform1i C.GPPROGRAMUNIFORM1I + gpProgramUniform1iv C.GPPROGRAMUNIFORM1IV + gpProgramUniform1ui C.GPPROGRAMUNIFORM1UI + gpProgramUniform1uiv C.GPPROGRAMUNIFORM1UIV + gpProgramUniform2d C.GPPROGRAMUNIFORM2D + gpProgramUniform2dv C.GPPROGRAMUNIFORM2DV + gpProgramUniform2f C.GPPROGRAMUNIFORM2F + gpProgramUniform2fv C.GPPROGRAMUNIFORM2FV + gpProgramUniform2i C.GPPROGRAMUNIFORM2I + gpProgramUniform2iv C.GPPROGRAMUNIFORM2IV + gpProgramUniform2ui C.GPPROGRAMUNIFORM2UI + gpProgramUniform2uiv C.GPPROGRAMUNIFORM2UIV + gpProgramUniform3d C.GPPROGRAMUNIFORM3D + gpProgramUniform3dv C.GPPROGRAMUNIFORM3DV + gpProgramUniform3f C.GPPROGRAMUNIFORM3F + gpProgramUniform3fv C.GPPROGRAMUNIFORM3FV + gpProgramUniform3i C.GPPROGRAMUNIFORM3I + gpProgramUniform3iv C.GPPROGRAMUNIFORM3IV + gpProgramUniform3ui C.GPPROGRAMUNIFORM3UI + gpProgramUniform3uiv C.GPPROGRAMUNIFORM3UIV + gpProgramUniform4d C.GPPROGRAMUNIFORM4D + gpProgramUniform4dv C.GPPROGRAMUNIFORM4DV + gpProgramUniform4f C.GPPROGRAMUNIFORM4F + gpProgramUniform4fv C.GPPROGRAMUNIFORM4FV + gpProgramUniform4i C.GPPROGRAMUNIFORM4I + gpProgramUniform4iv C.GPPROGRAMUNIFORM4IV + gpProgramUniform4ui C.GPPROGRAMUNIFORM4UI + gpProgramUniform4uiv C.GPPROGRAMUNIFORM4UIV + gpProgramUniformHandleui64ARB C.GPPROGRAMUNIFORMHANDLEUI64ARB + gpProgramUniformHandleui64vARB C.GPPROGRAMUNIFORMHANDLEUI64VARB + gpProgramUniformMatrix2dv C.GPPROGRAMUNIFORMMATRIX2DV + gpProgramUniformMatrix2fv C.GPPROGRAMUNIFORMMATRIX2FV + gpProgramUniformMatrix2x3dv C.GPPROGRAMUNIFORMMATRIX2X3DV + gpProgramUniformMatrix2x3fv C.GPPROGRAMUNIFORMMATRIX2X3FV + gpProgramUniformMatrix2x4dv C.GPPROGRAMUNIFORMMATRIX2X4DV + gpProgramUniformMatrix2x4fv C.GPPROGRAMUNIFORMMATRIX2X4FV + gpProgramUniformMatrix3dv C.GPPROGRAMUNIFORMMATRIX3DV + gpProgramUniformMatrix3fv C.GPPROGRAMUNIFORMMATRIX3FV + gpProgramUniformMatrix3x2dv C.GPPROGRAMUNIFORMMATRIX3X2DV + gpProgramUniformMatrix3x2fv C.GPPROGRAMUNIFORMMATRIX3X2FV + gpProgramUniformMatrix3x4dv C.GPPROGRAMUNIFORMMATRIX3X4DV + gpProgramUniformMatrix3x4fv C.GPPROGRAMUNIFORMMATRIX3X4FV + gpProgramUniformMatrix4dv C.GPPROGRAMUNIFORMMATRIX4DV + gpProgramUniformMatrix4fv C.GPPROGRAMUNIFORMMATRIX4FV + gpProgramUniformMatrix4x2dv C.GPPROGRAMUNIFORMMATRIX4X2DV + gpProgramUniformMatrix4x2fv C.GPPROGRAMUNIFORMMATRIX4X2FV + gpProgramUniformMatrix4x3dv C.GPPROGRAMUNIFORMMATRIX4X3DV + gpProgramUniformMatrix4x3fv C.GPPROGRAMUNIFORMMATRIX4X3FV + gpProvokingVertex C.GPPROVOKINGVERTEX + gpPushDebugGroup C.GPPUSHDEBUGGROUP + gpPushDebugGroupKHR C.GPPUSHDEBUGGROUPKHR + gpQueryCounter C.GPQUERYCOUNTER + gpReadBuffer C.GPREADBUFFER + gpReadPixels C.GPREADPIXELS + gpReadnPixels C.GPREADNPIXELS + gpReadnPixelsARB C.GPREADNPIXELSARB + gpReadnPixelsKHR C.GPREADNPIXELSKHR + gpReleaseShaderCompiler C.GPRELEASESHADERCOMPILER + gpRenderbufferStorage C.GPRENDERBUFFERSTORAGE + gpRenderbufferStorageMultisample C.GPRENDERBUFFERSTORAGEMULTISAMPLE + gpResumeTransformFeedback C.GPRESUMETRANSFORMFEEDBACK + gpSampleCoverage C.GPSAMPLECOVERAGE + gpSampleMaski C.GPSAMPLEMASKI + gpSamplerParameterIiv C.GPSAMPLERPARAMETERIIV + gpSamplerParameterIuiv C.GPSAMPLERPARAMETERIUIV + gpSamplerParameterf C.GPSAMPLERPARAMETERF + gpSamplerParameterfv C.GPSAMPLERPARAMETERFV + gpSamplerParameteri C.GPSAMPLERPARAMETERI + gpSamplerParameteriv C.GPSAMPLERPARAMETERIV + gpScissor C.GPSCISSOR + gpScissorArrayv C.GPSCISSORARRAYV + gpScissorIndexed C.GPSCISSORINDEXED + gpScissorIndexedv C.GPSCISSORINDEXEDV + gpShaderBinary C.GPSHADERBINARY + gpShaderSource C.GPSHADERSOURCE + gpShaderStorageBlockBinding C.GPSHADERSTORAGEBLOCKBINDING + gpStencilFunc C.GPSTENCILFUNC + gpStencilFuncSeparate C.GPSTENCILFUNCSEPARATE + gpStencilMask C.GPSTENCILMASK + gpStencilMaskSeparate C.GPSTENCILMASKSEPARATE + gpStencilOp C.GPSTENCILOP + gpStencilOpSeparate C.GPSTENCILOPSEPARATE + gpTexBuffer C.GPTEXBUFFER + gpTexBufferRange C.GPTEXBUFFERRANGE + gpTexImage1D C.GPTEXIMAGE1D + gpTexImage2D C.GPTEXIMAGE2D + gpTexImage2DMultisample C.GPTEXIMAGE2DMULTISAMPLE + gpTexImage3D C.GPTEXIMAGE3D + gpTexImage3DMultisample C.GPTEXIMAGE3DMULTISAMPLE + gpTexPageCommitmentARB C.GPTEXPAGECOMMITMENTARB + gpTexParameterIiv C.GPTEXPARAMETERIIV + gpTexParameterIuiv C.GPTEXPARAMETERIUIV + gpTexParameterf C.GPTEXPARAMETERF + gpTexParameterfv C.GPTEXPARAMETERFV + gpTexParameteri C.GPTEXPARAMETERI + gpTexParameteriv C.GPTEXPARAMETERIV + gpTexStorage1D C.GPTEXSTORAGE1D + gpTexStorage2D C.GPTEXSTORAGE2D + gpTexStorage2DMultisample C.GPTEXSTORAGE2DMULTISAMPLE + gpTexStorage3D C.GPTEXSTORAGE3D + gpTexStorage3DMultisample C.GPTEXSTORAGE3DMULTISAMPLE + gpTexSubImage1D C.GPTEXSUBIMAGE1D + gpTexSubImage2D C.GPTEXSUBIMAGE2D + gpTexSubImage3D C.GPTEXSUBIMAGE3D + gpTextureBarrier C.GPTEXTUREBARRIER + gpTextureBuffer C.GPTEXTUREBUFFER + gpTextureBufferRange C.GPTEXTUREBUFFERRANGE + gpTextureParameterIiv C.GPTEXTUREPARAMETERIIV + gpTextureParameterIuiv C.GPTEXTUREPARAMETERIUIV + gpTextureParameterf C.GPTEXTUREPARAMETERF + gpTextureParameterfv C.GPTEXTUREPARAMETERFV + gpTextureParameteri C.GPTEXTUREPARAMETERI + gpTextureParameteriv C.GPTEXTUREPARAMETERIV + gpTextureStorage1D C.GPTEXTURESTORAGE1D + gpTextureStorage2D C.GPTEXTURESTORAGE2D + gpTextureStorage2DMultisample C.GPTEXTURESTORAGE2DMULTISAMPLE + gpTextureStorage3D C.GPTEXTURESTORAGE3D + gpTextureStorage3DMultisample C.GPTEXTURESTORAGE3DMULTISAMPLE + gpTextureSubImage1D C.GPTEXTURESUBIMAGE1D + gpTextureSubImage2D C.GPTEXTURESUBIMAGE2D + gpTextureSubImage3D C.GPTEXTURESUBIMAGE3D + gpTextureView C.GPTEXTUREVIEW + gpTransformFeedbackBufferBase C.GPTRANSFORMFEEDBACKBUFFERBASE + gpTransformFeedbackBufferRange C.GPTRANSFORMFEEDBACKBUFFERRANGE + gpTransformFeedbackVaryings C.GPTRANSFORMFEEDBACKVARYINGS + gpUniform1d C.GPUNIFORM1D + gpUniform1dv C.GPUNIFORM1DV + gpUniform1f C.GPUNIFORM1F + gpUniform1fv C.GPUNIFORM1FV + gpUniform1i C.GPUNIFORM1I + gpUniform1iv C.GPUNIFORM1IV + gpUniform1ui C.GPUNIFORM1UI + gpUniform1uiv C.GPUNIFORM1UIV + gpUniform2d C.GPUNIFORM2D + gpUniform2dv C.GPUNIFORM2DV + gpUniform2f C.GPUNIFORM2F + gpUniform2fv C.GPUNIFORM2FV + gpUniform2i C.GPUNIFORM2I + gpUniform2iv C.GPUNIFORM2IV + gpUniform2ui C.GPUNIFORM2UI + gpUniform2uiv C.GPUNIFORM2UIV + gpUniform3d C.GPUNIFORM3D + gpUniform3dv C.GPUNIFORM3DV + gpUniform3f C.GPUNIFORM3F + gpUniform3fv C.GPUNIFORM3FV + gpUniform3i C.GPUNIFORM3I + gpUniform3iv C.GPUNIFORM3IV + gpUniform3ui C.GPUNIFORM3UI + gpUniform3uiv C.GPUNIFORM3UIV + gpUniform4d C.GPUNIFORM4D + gpUniform4dv C.GPUNIFORM4DV + gpUniform4f C.GPUNIFORM4F + gpUniform4fv C.GPUNIFORM4FV + gpUniform4i C.GPUNIFORM4I + gpUniform4iv C.GPUNIFORM4IV + gpUniform4ui C.GPUNIFORM4UI + gpUniform4uiv C.GPUNIFORM4UIV + gpUniformBlockBinding C.GPUNIFORMBLOCKBINDING + gpUniformHandleui64ARB C.GPUNIFORMHANDLEUI64ARB + gpUniformHandleui64vARB C.GPUNIFORMHANDLEUI64VARB + gpUniformMatrix2dv C.GPUNIFORMMATRIX2DV + gpUniformMatrix2fv C.GPUNIFORMMATRIX2FV + gpUniformMatrix2x3dv C.GPUNIFORMMATRIX2X3DV + gpUniformMatrix2x3fv C.GPUNIFORMMATRIX2X3FV + gpUniformMatrix2x4dv C.GPUNIFORMMATRIX2X4DV + gpUniformMatrix2x4fv C.GPUNIFORMMATRIX2X4FV + gpUniformMatrix3dv C.GPUNIFORMMATRIX3DV + gpUniformMatrix3fv C.GPUNIFORMMATRIX3FV + gpUniformMatrix3x2dv C.GPUNIFORMMATRIX3X2DV + gpUniformMatrix3x2fv C.GPUNIFORMMATRIX3X2FV + gpUniformMatrix3x4dv C.GPUNIFORMMATRIX3X4DV + gpUniformMatrix3x4fv C.GPUNIFORMMATRIX3X4FV + gpUniformMatrix4dv C.GPUNIFORMMATRIX4DV + gpUniformMatrix4fv C.GPUNIFORMMATRIX4FV + gpUniformMatrix4x2dv C.GPUNIFORMMATRIX4X2DV + gpUniformMatrix4x2fv C.GPUNIFORMMATRIX4X2FV + gpUniformMatrix4x3dv C.GPUNIFORMMATRIX4X3DV + gpUniformMatrix4x3fv C.GPUNIFORMMATRIX4X3FV + gpUniformSubroutinesuiv C.GPUNIFORMSUBROUTINESUIV + gpUnmapBuffer C.GPUNMAPBUFFER + gpUnmapNamedBuffer C.GPUNMAPNAMEDBUFFER + gpUseProgram C.GPUSEPROGRAM + gpUseProgramStages C.GPUSEPROGRAMSTAGES + gpValidateProgram C.GPVALIDATEPROGRAM + gpValidateProgramPipeline C.GPVALIDATEPROGRAMPIPELINE + gpVertexArrayAttribBinding C.GPVERTEXARRAYATTRIBBINDING + gpVertexArrayAttribFormat C.GPVERTEXARRAYATTRIBFORMAT + gpVertexArrayAttribIFormat C.GPVERTEXARRAYATTRIBIFORMAT + gpVertexArrayAttribLFormat C.GPVERTEXARRAYATTRIBLFORMAT + gpVertexArrayBindingDivisor C.GPVERTEXARRAYBINDINGDIVISOR + gpVertexArrayElementBuffer C.GPVERTEXARRAYELEMENTBUFFER + gpVertexArrayVertexBuffer C.GPVERTEXARRAYVERTEXBUFFER + gpVertexArrayVertexBuffers C.GPVERTEXARRAYVERTEXBUFFERS + gpVertexAttrib1d C.GPVERTEXATTRIB1D + gpVertexAttrib1dv C.GPVERTEXATTRIB1DV + gpVertexAttrib1f C.GPVERTEXATTRIB1F + gpVertexAttrib1fv C.GPVERTEXATTRIB1FV + gpVertexAttrib1s C.GPVERTEXATTRIB1S + gpVertexAttrib1sv C.GPVERTEXATTRIB1SV + gpVertexAttrib2d C.GPVERTEXATTRIB2D + gpVertexAttrib2dv C.GPVERTEXATTRIB2DV + gpVertexAttrib2f C.GPVERTEXATTRIB2F + gpVertexAttrib2fv C.GPVERTEXATTRIB2FV + gpVertexAttrib2s C.GPVERTEXATTRIB2S + gpVertexAttrib2sv C.GPVERTEXATTRIB2SV + gpVertexAttrib3d C.GPVERTEXATTRIB3D + gpVertexAttrib3dv C.GPVERTEXATTRIB3DV + gpVertexAttrib3f C.GPVERTEXATTRIB3F + gpVertexAttrib3fv C.GPVERTEXATTRIB3FV + gpVertexAttrib3s C.GPVERTEXATTRIB3S + gpVertexAttrib3sv C.GPVERTEXATTRIB3SV + gpVertexAttrib4Nbv C.GPVERTEXATTRIB4NBV + gpVertexAttrib4Niv C.GPVERTEXATTRIB4NIV + gpVertexAttrib4Nsv C.GPVERTEXATTRIB4NSV + gpVertexAttrib4Nub C.GPVERTEXATTRIB4NUB + gpVertexAttrib4Nubv C.GPVERTEXATTRIB4NUBV + gpVertexAttrib4Nuiv C.GPVERTEXATTRIB4NUIV + gpVertexAttrib4Nusv C.GPVERTEXATTRIB4NUSV + gpVertexAttrib4bv C.GPVERTEXATTRIB4BV + gpVertexAttrib4d C.GPVERTEXATTRIB4D + gpVertexAttrib4dv C.GPVERTEXATTRIB4DV + gpVertexAttrib4f C.GPVERTEXATTRIB4F + gpVertexAttrib4fv C.GPVERTEXATTRIB4FV + gpVertexAttrib4iv C.GPVERTEXATTRIB4IV + gpVertexAttrib4s C.GPVERTEXATTRIB4S + gpVertexAttrib4sv C.GPVERTEXATTRIB4SV + gpVertexAttrib4ubv C.GPVERTEXATTRIB4UBV + gpVertexAttrib4uiv C.GPVERTEXATTRIB4UIV + gpVertexAttrib4usv C.GPVERTEXATTRIB4USV + gpVertexAttribBinding C.GPVERTEXATTRIBBINDING + gpVertexAttribDivisor C.GPVERTEXATTRIBDIVISOR + gpVertexAttribFormat C.GPVERTEXATTRIBFORMAT + gpVertexAttribI1i C.GPVERTEXATTRIBI1I + gpVertexAttribI1iv C.GPVERTEXATTRIBI1IV + gpVertexAttribI1ui C.GPVERTEXATTRIBI1UI + gpVertexAttribI1uiv C.GPVERTEXATTRIBI1UIV + gpVertexAttribI2i C.GPVERTEXATTRIBI2I + gpVertexAttribI2iv C.GPVERTEXATTRIBI2IV + gpVertexAttribI2ui C.GPVERTEXATTRIBI2UI + gpVertexAttribI2uiv C.GPVERTEXATTRIBI2UIV + gpVertexAttribI3i C.GPVERTEXATTRIBI3I + gpVertexAttribI3iv C.GPVERTEXATTRIBI3IV + gpVertexAttribI3ui C.GPVERTEXATTRIBI3UI + gpVertexAttribI3uiv C.GPVERTEXATTRIBI3UIV + gpVertexAttribI4bv C.GPVERTEXATTRIBI4BV + gpVertexAttribI4i C.GPVERTEXATTRIBI4I + gpVertexAttribI4iv C.GPVERTEXATTRIBI4IV + gpVertexAttribI4sv C.GPVERTEXATTRIBI4SV + gpVertexAttribI4ubv C.GPVERTEXATTRIBI4UBV + gpVertexAttribI4ui C.GPVERTEXATTRIBI4UI + gpVertexAttribI4uiv C.GPVERTEXATTRIBI4UIV + gpVertexAttribI4usv C.GPVERTEXATTRIBI4USV + gpVertexAttribIFormat C.GPVERTEXATTRIBIFORMAT + gpVertexAttribIPointer C.GPVERTEXATTRIBIPOINTER + gpVertexAttribL1d C.GPVERTEXATTRIBL1D + gpVertexAttribL1dv C.GPVERTEXATTRIBL1DV + gpVertexAttribL1ui64ARB C.GPVERTEXATTRIBL1UI64ARB + gpVertexAttribL1ui64vARB C.GPVERTEXATTRIBL1UI64VARB + gpVertexAttribL2d C.GPVERTEXATTRIBL2D + gpVertexAttribL2dv C.GPVERTEXATTRIBL2DV + gpVertexAttribL3d C.GPVERTEXATTRIBL3D + gpVertexAttribL3dv C.GPVERTEXATTRIBL3DV + gpVertexAttribL4d C.GPVERTEXATTRIBL4D + gpVertexAttribL4dv C.GPVERTEXATTRIBL4DV + gpVertexAttribLFormat C.GPVERTEXATTRIBLFORMAT + gpVertexAttribLPointer C.GPVERTEXATTRIBLPOINTER + gpVertexAttribP1ui C.GPVERTEXATTRIBP1UI + gpVertexAttribP1uiv C.GPVERTEXATTRIBP1UIV + gpVertexAttribP2ui C.GPVERTEXATTRIBP2UI + gpVertexAttribP2uiv C.GPVERTEXATTRIBP2UIV + gpVertexAttribP3ui C.GPVERTEXATTRIBP3UI + gpVertexAttribP3uiv C.GPVERTEXATTRIBP3UIV + gpVertexAttribP4ui C.GPVERTEXATTRIBP4UI + gpVertexAttribP4uiv C.GPVERTEXATTRIBP4UIV + gpVertexAttribPointer C.GPVERTEXATTRIBPOINTER + gpVertexBindingDivisor C.GPVERTEXBINDINGDIVISOR + gpViewport C.GPVIEWPORT + gpViewportArrayv C.GPVIEWPORTARRAYV + gpViewportIndexedf C.GPVIEWPORTINDEXEDF + gpViewportIndexedfv C.GPVIEWPORTINDEXEDFV + gpWaitSync C.GPWAITSYNC +) + +// Helper functions +func boolToInt(b bool) int { + if b { + return 1 + } + return 0 +} + +// set the active program object for a program pipeline object +func ActiveShaderProgram(pipeline uint32, program uint32) { + C.glowActiveShaderProgram(gpActiveShaderProgram, (C.GLuint)(pipeline), (C.GLuint)(program)) +} + +// select active texture unit +func ActiveTexture(texture uint32) { + C.glowActiveTexture(gpActiveTexture, (C.GLenum)(texture)) +} + +// Attaches a shader object to a program object +func AttachShader(program uint32, shader uint32) { + C.glowAttachShader(gpAttachShader, (C.GLuint)(program), (C.GLuint)(shader)) +} + +// start conditional rendering +func BeginConditionalRender(id uint32, mode uint32) { + C.glowBeginConditionalRender(gpBeginConditionalRender, (C.GLuint)(id), (C.GLenum)(mode)) +} + +// delimit the boundaries of a query object +func BeginQuery(target uint32, id uint32) { + C.glowBeginQuery(gpBeginQuery, (C.GLenum)(target), (C.GLuint)(id)) +} +func BeginQueryIndexed(target uint32, index uint32, id uint32) { + C.glowBeginQueryIndexed(gpBeginQueryIndexed, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(id)) +} + +// start transform feedback operation +func BeginTransformFeedback(primitiveMode uint32) { + C.glowBeginTransformFeedback(gpBeginTransformFeedback, (C.GLenum)(primitiveMode)) +} + +// Associates a generic vertex attribute index with a named attribute variable +func BindAttribLocation(program uint32, index uint32, name *uint8) { + C.glowBindAttribLocation(gpBindAttribLocation, (C.GLuint)(program), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name))) +} + +// bind a named buffer object +func BindBuffer(target uint32, buffer uint32) { + C.glowBindBuffer(gpBindBuffer, (C.GLenum)(target), (C.GLuint)(buffer)) +} + +// bind a buffer object to an indexed buffer target +func BindBufferBase(target uint32, index uint32, buffer uint32) { + C.glowBindBufferBase(gpBindBufferBase, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer)) +} + +// bind a range within a buffer object to an indexed buffer target +func BindBufferRange(target uint32, index uint32, buffer uint32, offset int, size int) { + C.glowBindBufferRange(gpBindBufferRange, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size)) +} + +// bind one or more buffer objects to a sequence of indexed buffer targets +func BindBuffersBase(target uint32, first uint32, count int32, buffers *uint32) { + C.glowBindBuffersBase(gpBindBuffersBase, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers))) +} + +// bind ranges of one or more buffer objects to a sequence of indexed buffer targets +func BindBuffersRange(target uint32, first uint32, count int32, buffers *uint32, offsets *int, sizes *int) { + C.glowBindBuffersRange(gpBindBuffersRange, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizeiptr)(unsafe.Pointer(sizes))) +} + +// bind a user-defined varying out variable to a fragment shader color number +func BindFragDataLocation(program uint32, color uint32, name *uint8) { + C.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name))) +} + +// bind a user-defined varying out variable to a fragment shader color number and index +func BindFragDataLocationIndexed(program uint32, colorNumber uint32, index uint32, name *uint8) { + C.glowBindFragDataLocationIndexed(gpBindFragDataLocationIndexed, (C.GLuint)(program), (C.GLuint)(colorNumber), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name))) +} + +// bind a framebuffer to a framebuffer target +func BindFramebuffer(target uint32, framebuffer uint32) { + C.glowBindFramebuffer(gpBindFramebuffer, (C.GLenum)(target), (C.GLuint)(framebuffer)) +} + +// bind a level of a texture to an image unit +func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) { + C.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format)) +} + +// bind one or more named texture images to a sequence of consecutive image units +func BindImageTextures(first uint32, count int32, textures *uint32) { + C.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures))) +} + +// bind a program pipeline to the current context +func BindProgramPipeline(pipeline uint32) { + C.glowBindProgramPipeline(gpBindProgramPipeline, (C.GLuint)(pipeline)) +} + +// bind a renderbuffer to a renderbuffer target +func BindRenderbuffer(target uint32, renderbuffer uint32) { + C.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer)) +} + +// bind a named sampler to a texturing target +func BindSampler(unit uint32, sampler uint32) { + C.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler)) +} + +// bind one or more named sampler objects to a sequence of consecutive sampler units +func BindSamplers(first uint32, count int32, samplers *uint32) { + C.glowBindSamplers(gpBindSamplers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers))) +} + +// bind a named texture to a texturing target +func BindTexture(target uint32, texture uint32) { + C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture)) +} + +// bind an existing texture object to the specified texture unit +func BindTextureUnit(unit uint32, texture uint32) { + C.glowBindTextureUnit(gpBindTextureUnit, (C.GLuint)(unit), (C.GLuint)(texture)) +} + +// bind one or more named textures to a sequence of consecutive texture units +func BindTextures(first uint32, count int32, textures *uint32) { + C.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures))) +} + +// bind a transform feedback object +func BindTransformFeedback(target uint32, id uint32) { + C.glowBindTransformFeedback(gpBindTransformFeedback, (C.GLenum)(target), (C.GLuint)(id)) +} + +// bind a vertex array object +func BindVertexArray(array uint32) { + C.glowBindVertexArray(gpBindVertexArray, (C.GLuint)(array)) +} + +// bind a buffer to a vertex buffer bind point +func BindVertexBuffer(bindingindex uint32, buffer uint32, offset int, stride int32) { + C.glowBindVertexBuffer(gpBindVertexBuffer, (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride)) +} + +// attach multiple buffer objects to a vertex array object +func BindVertexBuffers(first uint32, count int32, buffers *uint32, offsets *int, strides *int32) { + C.glowBindVertexBuffers(gpBindVertexBuffers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizei)(unsafe.Pointer(strides))) +} + +// set the blend color +func BlendColor(red float32, green float32, blue float32, alpha float32) { + C.glowBlendColor(gpBlendColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha)) +} + +// specify the equation used for both the RGB blend equation and the Alpha blend equation +func BlendEquation(mode uint32) { + C.glowBlendEquation(gpBlendEquation, (C.GLenum)(mode)) +} + +// set the RGB blend equation and the alpha blend equation separately +func BlendEquationSeparate(modeRGB uint32, modeAlpha uint32) { + C.glowBlendEquationSeparate(gpBlendEquationSeparate, (C.GLenum)(modeRGB), (C.GLenum)(modeAlpha)) +} +func BlendEquationSeparateiARB(buf uint32, modeRGB uint32, modeAlpha uint32) { + C.glowBlendEquationSeparateiARB(gpBlendEquationSeparateiARB, (C.GLuint)(buf), (C.GLenum)(modeRGB), (C.GLenum)(modeAlpha)) +} +func BlendEquationiARB(buf uint32, mode uint32) { + C.glowBlendEquationiARB(gpBlendEquationiARB, (C.GLuint)(buf), (C.GLenum)(mode)) +} + +// specify pixel arithmetic +func BlendFunc(sfactor uint32, dfactor uint32) { + C.glowBlendFunc(gpBlendFunc, (C.GLenum)(sfactor), (C.GLenum)(dfactor)) +} + +// specify pixel arithmetic for RGB and alpha components separately +func BlendFuncSeparate(sfactorRGB uint32, dfactorRGB uint32, sfactorAlpha uint32, dfactorAlpha uint32) { + C.glowBlendFuncSeparate(gpBlendFuncSeparate, (C.GLenum)(sfactorRGB), (C.GLenum)(dfactorRGB), (C.GLenum)(sfactorAlpha), (C.GLenum)(dfactorAlpha)) +} +func BlendFuncSeparateiARB(buf uint32, srcRGB uint32, dstRGB uint32, srcAlpha uint32, dstAlpha uint32) { + C.glowBlendFuncSeparateiARB(gpBlendFuncSeparateiARB, (C.GLuint)(buf), (C.GLenum)(srcRGB), (C.GLenum)(dstRGB), (C.GLenum)(srcAlpha), (C.GLenum)(dstAlpha)) +} +func BlendFunciARB(buf uint32, src uint32, dst uint32) { + C.glowBlendFunciARB(gpBlendFunciARB, (C.GLuint)(buf), (C.GLenum)(src), (C.GLenum)(dst)) +} + +// copy a block of pixels from one framebuffer object to another +func BlitFramebuffer(srcX0 int32, srcY0 int32, srcX1 int32, srcY1 int32, dstX0 int32, dstY0 int32, dstX1 int32, dstY1 int32, mask uint32, filter uint32) { + C.glowBlitFramebuffer(gpBlitFramebuffer, (C.GLint)(srcX0), (C.GLint)(srcY0), (C.GLint)(srcX1), (C.GLint)(srcY1), (C.GLint)(dstX0), (C.GLint)(dstY0), (C.GLint)(dstX1), (C.GLint)(dstY1), (C.GLbitfield)(mask), (C.GLenum)(filter)) +} + +// copy a block of pixels from one framebuffer object to another +func BlitNamedFramebuffer(readFramebuffer uint32, drawFramebuffer uint32, srcX0 int32, srcY0 int32, srcX1 int32, srcY1 int32, dstX0 int32, dstY0 int32, dstX1 int32, dstY1 int32, mask uint32, filter uint32) { + C.glowBlitNamedFramebuffer(gpBlitNamedFramebuffer, (C.GLuint)(readFramebuffer), (C.GLuint)(drawFramebuffer), (C.GLint)(srcX0), (C.GLint)(srcY0), (C.GLint)(srcX1), (C.GLint)(srcY1), (C.GLint)(dstX0), (C.GLint)(dstY0), (C.GLint)(dstX1), (C.GLint)(dstY1), (C.GLbitfield)(mask), (C.GLenum)(filter)) +} + +// creates and initializes a buffer object's data store +func BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) { + C.glowBufferData(gpBufferData, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLenum)(usage)) +} +func BufferPageCommitmentARB(target uint32, offset int, size int32, commit bool) { + C.glowBufferPageCommitmentARB(gpBufferPageCommitmentARB, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizei)(size), (C.GLboolean)(boolToInt(commit))) +} + +// creates and initializes a buffer object's immutable data store +func BufferStorage(target uint32, size int, data unsafe.Pointer, flags uint32) { + C.glowBufferStorage(gpBufferStorage, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLbitfield)(flags)) +} + +// updates a subset of a buffer object's data store +func BufferSubData(target uint32, offset int, size int, data unsafe.Pointer) { + C.glowBufferSubData(gpBufferSubData, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data) +} + +// check the completeness status of a framebuffer +func CheckFramebufferStatus(target uint32) uint32 { + ret := C.glowCheckFramebufferStatus(gpCheckFramebufferStatus, (C.GLenum)(target)) + return (uint32)(ret) +} + +// check the completeness status of a framebuffer +func CheckNamedFramebufferStatus(framebuffer uint32, target uint32) uint32 { + ret := C.glowCheckNamedFramebufferStatus(gpCheckNamedFramebufferStatus, (C.GLuint)(framebuffer), (C.GLenum)(target)) + return (uint32)(ret) +} + +// specify whether data read via should be clamped +func ClampColor(target uint32, clamp uint32) { + C.glowClampColor(gpClampColor, (C.GLenum)(target), (C.GLenum)(clamp)) +} + +// clear buffers to preset values +func Clear(mask uint32) { + C.glowClear(gpClear, (C.GLbitfield)(mask)) +} + +// fill a buffer object's data store with a fixed value +func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) { + C.glowClearBufferData(gpClearBufferData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data) +} + +// fill all or part of buffer object's data store with a fixed value +func ClearBufferSubData(target uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) { + C.glowClearBufferSubData(gpClearBufferSubData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data) +} +func ClearBufferfi(buffer uint32, drawbuffer int32, depth float32, stencil int32) { + C.glowClearBufferfi(gpClearBufferfi, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (C.GLfloat)(depth), (C.GLint)(stencil)) +} +func ClearBufferfv(buffer uint32, drawbuffer int32, value *float32) { + C.glowClearBufferfv(gpClearBufferfv, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ClearBufferiv(buffer uint32, drawbuffer int32, value *int32) { + C.glowClearBufferiv(gpClearBufferiv, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLint)(unsafe.Pointer(value))) +} +func ClearBufferuiv(buffer uint32, drawbuffer int32, value *uint32) { + C.glowClearBufferuiv(gpClearBufferuiv, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLuint)(unsafe.Pointer(value))) +} + +// specify clear values for the color buffers +func ClearColor(red float32, green float32, blue float32, alpha float32) { + C.glowClearColor(gpClearColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha)) +} + +// specify the clear value for the depth buffer +func ClearDepth(depth float64) { + C.glowClearDepth(gpClearDepth, (C.GLdouble)(depth)) +} +func ClearDepthf(d float32) { + C.glowClearDepthf(gpClearDepthf, (C.GLfloat)(d)) +} + +// fill a buffer object's data store with a fixed value +func ClearNamedBufferData(buffer uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) { + C.glowClearNamedBufferData(gpClearNamedBufferData, (C.GLuint)(buffer), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data) +} + +// fill all or part of buffer object's data store with a fixed value +func ClearNamedBufferSubData(buffer uint32, internalformat uint32, offset int, size int32, format uint32, xtype uint32, data unsafe.Pointer) { + C.glowClearNamedBufferSubData(gpClearNamedBufferSubData, (C.GLuint)(buffer), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizei)(size), (C.GLenum)(format), (C.GLenum)(xtype), data) +} +func ClearNamedFramebufferfi(framebuffer uint32, buffer uint32, depth float32, stencil int32) { + C.glowClearNamedFramebufferfi(gpClearNamedFramebufferfi, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLfloat)(depth), (C.GLint)(stencil)) +} +func ClearNamedFramebufferfv(framebuffer uint32, buffer uint32, drawbuffer int32, value *float32) { + C.glowClearNamedFramebufferfv(gpClearNamedFramebufferfv, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ClearNamedFramebufferiv(framebuffer uint32, buffer uint32, drawbuffer int32, value *int32) { + C.glowClearNamedFramebufferiv(gpClearNamedFramebufferiv, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLint)(unsafe.Pointer(value))) +} +func ClearNamedFramebufferuiv(framebuffer uint32, buffer uint32, drawbuffer int32, value *uint32) { + C.glowClearNamedFramebufferuiv(gpClearNamedFramebufferuiv, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLuint)(unsafe.Pointer(value))) +} + +// specify the clear value for the stencil buffer +func ClearStencil(s int32) { + C.glowClearStencil(gpClearStencil, (C.GLint)(s)) +} + +// fills all a texture image with a constant value +func ClearTexImage(texture uint32, level int32, format uint32, xtype uint32, data unsafe.Pointer) { + C.glowClearTexImage(gpClearTexImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), data) +} + +// fills all or part of a texture image with a constant value +func ClearTexSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, data unsafe.Pointer) { + C.glowClearTexSubImage(gpClearTexSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), data) +} + +// block and wait for a sync object to become signaled +func ClientWaitSync(sync unsafe.Pointer, flags uint32, timeout uint64) uint32 { + ret := C.glowClientWaitSync(gpClientWaitSync, (C.GLsync)(sync), (C.GLbitfield)(flags), (C.GLuint64)(timeout)) + return (uint32)(ret) +} + +// control clip coordinate to window coordinate behavior +func ClipControl(origin uint32, depth uint32) { + C.glowClipControl(gpClipControl, (C.GLenum)(origin), (C.GLenum)(depth)) +} +func ColorMask(red bool, green bool, blue bool, alpha bool) { + C.glowColorMask(gpColorMask, (C.GLboolean)(boolToInt(red)), (C.GLboolean)(boolToInt(green)), (C.GLboolean)(boolToInt(blue)), (C.GLboolean)(boolToInt(alpha))) +} +func ColorMaski(index uint32, r bool, g bool, b bool, a bool) { + C.glowColorMaski(gpColorMaski, (C.GLuint)(index), (C.GLboolean)(boolToInt(r)), (C.GLboolean)(boolToInt(g)), (C.GLboolean)(boolToInt(b)), (C.GLboolean)(boolToInt(a))) +} + +// Compiles a shader object +func CompileShader(shader uint32) { + C.glowCompileShader(gpCompileShader, (C.GLuint)(shader)) +} +func CompileShaderIncludeARB(shader uint32, count int32, path **uint8, length *int32) { + C.glowCompileShaderIncludeARB(gpCompileShaderIncludeARB, (C.GLuint)(shader), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(path)), (*C.GLint)(unsafe.Pointer(length))) +} + +// specify a one-dimensional texture image in a compressed format +func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data) +} + +// specify a two-dimensional texture image in a compressed format +func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data) +} + +// specify a three-dimensional texture image in a compressed format +func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data) +} + +// specify a one-dimensional texture subimage in a compressed format +func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data) +} + +// specify a two-dimensional texture subimage in a compressed format +func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data) +} + +// specify a three-dimensional texture subimage in a compressed format +func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data) +} + +// specify a one-dimensional texture subimage in a compressed format +func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data) +} + +// specify a two-dimensional texture subimage in a compressed format +func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data) +} + +// specify a three-dimensional texture subimage in a compressed format +func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) { + C.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data) +} + +// copy all or part of the data store of a buffer object to the data store of another buffer object +func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) { + C.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size)) +} + +// perform a raw data copy between two images +func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) { + C.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth)) +} + +// copy all or part of the data store of a buffer object to the data store of another buffer object +func CopyNamedBufferSubData(readBuffer uint32, writeBuffer uint32, readOffset int, writeOffset int, size int32) { + C.glowCopyNamedBufferSubData(gpCopyNamedBufferSubData, (C.GLuint)(readBuffer), (C.GLuint)(writeBuffer), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizei)(size)) +} + +// copy pixels into a 1D texture image +func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) { + C.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border)) +} + +// copy pixels into a 2D texture image +func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) { + C.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border)) +} + +// copy a one-dimensional texture subimage +func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) { + C.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width)) +} + +// copy a two-dimensional texture subimage +func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) { + C.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// copy a three-dimensional texture subimage +func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) { + C.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// copy a one-dimensional texture subimage +func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) { + C.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width)) +} + +// copy a two-dimensional texture subimage +func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) { + C.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// copy a three-dimensional texture subimage +func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) { + C.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// create buffer objects +func CreateBuffers(n int32, buffers *uint32) { + C.glowCreateBuffers(gpCreateBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers))) +} + +// create framebuffer objects +func CreateFramebuffers(n int32, framebuffers *uint32) { + C.glowCreateFramebuffers(gpCreateFramebuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers))) +} + +// Creates a program object +func CreateProgram() uint32 { + ret := C.glowCreateProgram(gpCreateProgram) + return (uint32)(ret) +} + +// create program pipeline objects +func CreateProgramPipelines(n int32, pipelines *uint32) { + C.glowCreateProgramPipelines(gpCreateProgramPipelines, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines))) +} + +// create query objects +func CreateQueries(target uint32, n int32, ids *uint32) { + C.glowCreateQueries(gpCreateQueries, (C.GLenum)(target), (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids))) +} + +// create renderbuffer objects +func CreateRenderbuffers(n int32, renderbuffers *uint32) { + C.glowCreateRenderbuffers(gpCreateRenderbuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers))) +} + +// create sampler objects +func CreateSamplers(n int32, samplers *uint32) { + C.glowCreateSamplers(gpCreateSamplers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(samplers))) +} + +// Creates a shader object +func CreateShader(xtype uint32) uint32 { + ret := C.glowCreateShader(gpCreateShader, (C.GLenum)(xtype)) + return (uint32)(ret) +} + +// create a stand-alone program from an array of null-terminated source code strings +func CreateShaderProgramv(xtype uint32, count int32, strings **uint8) uint32 { + ret := C.glowCreateShaderProgramv(gpCreateShaderProgramv, (C.GLenum)(xtype), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(strings))) + return (uint32)(ret) +} +func CreateSyncFromCLeventARB(context *C.struct__cl_context, event *C.struct__cl_event, flags uint32) unsafe.Pointer { + ret := C.glowCreateSyncFromCLeventARB(gpCreateSyncFromCLeventARB, (*C.struct__cl_context)(unsafe.Pointer(context)), (*C.struct__cl_event)(unsafe.Pointer(event)), (C.GLbitfield)(flags)) + return (unsafe.Pointer)(ret) +} + +// create texture objects +func CreateTextures(target uint32, n int32, textures *uint32) { + C.glowCreateTextures(gpCreateTextures, (C.GLenum)(target), (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures))) +} + +// create transform feedback objects +func CreateTransformFeedbacks(n int32, ids *uint32) { + C.glowCreateTransformFeedbacks(gpCreateTransformFeedbacks, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids))) +} + +// create vertex array objects +func CreateVertexArrays(n int32, arrays *uint32) { + C.glowCreateVertexArrays(gpCreateVertexArrays, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays))) +} + +// specify whether front- or back-facing facets can be culled +func CullFace(mode uint32) { + C.glowCullFace(gpCullFace, (C.GLenum)(mode)) +} + +// specify a callback to receive debugging messages from the GL +func DebugMessageCallback(callback DebugProc, userParam unsafe.Pointer) { + userDebugCallback = callback + C.glowDebugMessageCallback(gpDebugMessageCallback, (C.GLDEBUGPROC)(unsafe.Pointer(&callback)), userParam) +} +func DebugMessageCallbackARB(callback DebugProc, userParam unsafe.Pointer) { + userDebugCallback = callback + C.glowDebugMessageCallbackARB(gpDebugMessageCallbackARB, (C.GLDEBUGPROCARB)(unsafe.Pointer(&callback)), userParam) +} +func DebugMessageCallbackKHR(callback DebugProc, userParam unsafe.Pointer) { + userDebugCallback = callback + C.glowDebugMessageCallbackKHR(gpDebugMessageCallbackKHR, (C.GLDEBUGPROCKHR)(unsafe.Pointer(&callback)), userParam) +} + +// control the reporting of debug messages in a debug context +func DebugMessageControl(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) { + C.glowDebugMessageControl(gpDebugMessageControl, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled))) +} +func DebugMessageControlARB(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) { + C.glowDebugMessageControlARB(gpDebugMessageControlARB, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled))) +} +func DebugMessageControlKHR(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) { + C.glowDebugMessageControlKHR(gpDebugMessageControlKHR, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled))) +} + +// inject an application-supplied message into the debug message queue +func DebugMessageInsert(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) { + C.glowDebugMessageInsert(gpDebugMessageInsert, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf))) +} +func DebugMessageInsertARB(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) { + C.glowDebugMessageInsertARB(gpDebugMessageInsertARB, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf))) +} +func DebugMessageInsertKHR(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) { + C.glowDebugMessageInsertKHR(gpDebugMessageInsertKHR, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf))) +} + +// delete named buffer objects +func DeleteBuffers(n int32, buffers *uint32) { + C.glowDeleteBuffers(gpDeleteBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers))) +} + +// delete framebuffer objects +func DeleteFramebuffers(n int32, framebuffers *uint32) { + C.glowDeleteFramebuffers(gpDeleteFramebuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers))) +} +func DeleteNamedStringARB(namelen int32, name *uint8) { + C.glowDeleteNamedStringARB(gpDeleteNamedStringARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name))) +} + +// Deletes a program object +func DeleteProgram(program uint32) { + C.glowDeleteProgram(gpDeleteProgram, (C.GLuint)(program)) +} + +// delete program pipeline objects +func DeleteProgramPipelines(n int32, pipelines *uint32) { + C.glowDeleteProgramPipelines(gpDeleteProgramPipelines, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines))) +} + +// delete named query objects +func DeleteQueries(n int32, ids *uint32) { + C.glowDeleteQueries(gpDeleteQueries, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids))) +} + +// delete renderbuffer objects +func DeleteRenderbuffers(n int32, renderbuffers *uint32) { + C.glowDeleteRenderbuffers(gpDeleteRenderbuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers))) +} + +// delete named sampler objects +func DeleteSamplers(count int32, samplers *uint32) { + C.glowDeleteSamplers(gpDeleteSamplers, (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers))) +} + +// Deletes a shader object +func DeleteShader(shader uint32) { + C.glowDeleteShader(gpDeleteShader, (C.GLuint)(shader)) +} + +// delete a sync object +func DeleteSync(sync unsafe.Pointer) { + C.glowDeleteSync(gpDeleteSync, (C.GLsync)(sync)) +} + +// delete named textures +func DeleteTextures(n int32, textures *uint32) { + C.glowDeleteTextures(gpDeleteTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures))) +} + +// delete transform feedback objects +func DeleteTransformFeedbacks(n int32, ids *uint32) { + C.glowDeleteTransformFeedbacks(gpDeleteTransformFeedbacks, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids))) +} + +// delete vertex array objects +func DeleteVertexArrays(n int32, arrays *uint32) { + C.glowDeleteVertexArrays(gpDeleteVertexArrays, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays))) +} + +// specify the value used for depth buffer comparisons +func DepthFunc(xfunc uint32) { + C.glowDepthFunc(gpDepthFunc, (C.GLenum)(xfunc)) +} + +// enable or disable writing into the depth buffer +func DepthMask(flag bool) { + C.glowDepthMask(gpDepthMask, (C.GLboolean)(boolToInt(flag))) +} + +// specify mapping of depth values from normalized device coordinates to window coordinates +func DepthRange(near float64, far float64) { + C.glowDepthRange(gpDepthRange, (C.GLdouble)(near), (C.GLdouble)(far)) +} +func DepthRangeArrayv(first uint32, count int32, v *float64) { + C.glowDepthRangeArrayv(gpDepthRangeArrayv, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(v))) +} + +// specify mapping of depth values from normalized device coordinates to window coordinates for a specified viewport +func DepthRangeIndexed(index uint32, n float64, f float64) { + C.glowDepthRangeIndexed(gpDepthRangeIndexed, (C.GLuint)(index), (C.GLdouble)(n), (C.GLdouble)(f)) +} +func DepthRangef(n float32, f float32) { + C.glowDepthRangef(gpDepthRangef, (C.GLfloat)(n), (C.GLfloat)(f)) +} + +// Detaches a shader object from a program object to which it is attached +func DetachShader(program uint32, shader uint32) { + C.glowDetachShader(gpDetachShader, (C.GLuint)(program), (C.GLuint)(shader)) +} +func Disable(cap uint32) { + C.glowDisable(gpDisable, (C.GLenum)(cap)) +} + +// Enable or disable a generic vertex attribute array +func DisableVertexArrayAttrib(vaobj uint32, index uint32) { + C.glowDisableVertexArrayAttrib(gpDisableVertexArrayAttrib, (C.GLuint)(vaobj), (C.GLuint)(index)) +} + +// Enable or disable a generic vertex attribute array +func DisableVertexAttribArray(index uint32) { + C.glowDisableVertexAttribArray(gpDisableVertexAttribArray, (C.GLuint)(index)) +} +func Disablei(target uint32, index uint32) { + C.glowDisablei(gpDisablei, (C.GLenum)(target), (C.GLuint)(index)) +} + +// launch one or more compute work groups +func DispatchCompute(num_groups_x uint32, num_groups_y uint32, num_groups_z uint32) { + C.glowDispatchCompute(gpDispatchCompute, (C.GLuint)(num_groups_x), (C.GLuint)(num_groups_y), (C.GLuint)(num_groups_z)) +} +func DispatchComputeGroupSizeARB(num_groups_x uint32, num_groups_y uint32, num_groups_z uint32, group_size_x uint32, group_size_y uint32, group_size_z uint32) { + C.glowDispatchComputeGroupSizeARB(gpDispatchComputeGroupSizeARB, (C.GLuint)(num_groups_x), (C.GLuint)(num_groups_y), (C.GLuint)(num_groups_z), (C.GLuint)(group_size_x), (C.GLuint)(group_size_y), (C.GLuint)(group_size_z)) +} + +// launch one or more compute work groups using parameters stored in a buffer +func DispatchComputeIndirect(indirect int) { + C.glowDispatchComputeIndirect(gpDispatchComputeIndirect, (C.GLintptr)(indirect)) +} + +// render primitives from array data +func DrawArrays(mode uint32, first int32, count int32) { + C.glowDrawArrays(gpDrawArrays, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count)) +} + +// render primitives from array data, taking parameters from memory +func DrawArraysIndirect(mode uint32, indirect unsafe.Pointer) { + C.glowDrawArraysIndirect(gpDrawArraysIndirect, (C.GLenum)(mode), indirect) +} + +// draw multiple instances of a range of elements +func DrawArraysInstanced(mode uint32, first int32, count int32, instancecount int32) { + C.glowDrawArraysInstanced(gpDrawArraysInstanced, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count), (C.GLsizei)(instancecount)) +} + +// draw multiple instances of a range of elements with offset applied to instanced attributes +func DrawArraysInstancedBaseInstance(mode uint32, first int32, count int32, instancecount int32, baseinstance uint32) { + C.glowDrawArraysInstancedBaseInstance(gpDrawArraysInstancedBaseInstance, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count), (C.GLsizei)(instancecount), (C.GLuint)(baseinstance)) +} + +// specify which color buffers are to be drawn into +func DrawBuffer(buf uint32) { + C.glowDrawBuffer(gpDrawBuffer, (C.GLenum)(buf)) +} + +// Specifies a list of color buffers to be drawn into +func DrawBuffers(n int32, bufs *uint32) { + C.glowDrawBuffers(gpDrawBuffers, (C.GLsizei)(n), (*C.GLenum)(unsafe.Pointer(bufs))) +} + +// render primitives from array data +func DrawElements(mode uint32, count int32, xtype uint32, indices unsafe.Pointer) { + C.glowDrawElements(gpDrawElements, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices) +} + +// render primitives from array data with a per-element offset +func DrawElementsBaseVertex(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, basevertex int32) { + C.glowDrawElementsBaseVertex(gpDrawElementsBaseVertex, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLint)(basevertex)) +} + +// render indexed primitives from array data, taking parameters from memory +func DrawElementsIndirect(mode uint32, xtype uint32, indirect unsafe.Pointer) { + C.glowDrawElementsIndirect(gpDrawElementsIndirect, (C.GLenum)(mode), (C.GLenum)(xtype), indirect) +} + +// draw multiple instances of a set of elements +func DrawElementsInstanced(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32) { + C.glowDrawElementsInstanced(gpDrawElementsInstanced, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount)) +} + +// draw multiple instances of a set of elements with offset applied to instanced attributes +func DrawElementsInstancedBaseInstance(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, baseinstance uint32) { + C.glowDrawElementsInstancedBaseInstance(gpDrawElementsInstancedBaseInstance, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount), (C.GLuint)(baseinstance)) +} + +// render multiple instances of a set of primitives from array data with a per-element offset +func DrawElementsInstancedBaseVertex(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, basevertex int32) { + C.glowDrawElementsInstancedBaseVertex(gpDrawElementsInstancedBaseVertex, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount), (C.GLint)(basevertex)) +} + +// render multiple instances of a set of primitives from array data with a per-element offset +func DrawElementsInstancedBaseVertexBaseInstance(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, basevertex int32, baseinstance uint32) { + C.glowDrawElementsInstancedBaseVertexBaseInstance(gpDrawElementsInstancedBaseVertexBaseInstance, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount), (C.GLint)(basevertex), (C.GLuint)(baseinstance)) +} + +// render primitives from array data +func DrawRangeElements(mode uint32, start uint32, end uint32, count int32, xtype uint32, indices unsafe.Pointer) { + C.glowDrawRangeElements(gpDrawRangeElements, (C.GLenum)(mode), (C.GLuint)(start), (C.GLuint)(end), (C.GLsizei)(count), (C.GLenum)(xtype), indices) +} + +// render primitives from array data with a per-element offset +func DrawRangeElementsBaseVertex(mode uint32, start uint32, end uint32, count int32, xtype uint32, indices unsafe.Pointer, basevertex int32) { + C.glowDrawRangeElementsBaseVertex(gpDrawRangeElementsBaseVertex, (C.GLenum)(mode), (C.GLuint)(start), (C.GLuint)(end), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLint)(basevertex)) +} + +// render primitives using a count derived from a transform feedback object +func DrawTransformFeedback(mode uint32, id uint32) { + C.glowDrawTransformFeedback(gpDrawTransformFeedback, (C.GLenum)(mode), (C.GLuint)(id)) +} + +// render multiple instances of primitives using a count derived from a transform feedback object +func DrawTransformFeedbackInstanced(mode uint32, id uint32, instancecount int32) { + C.glowDrawTransformFeedbackInstanced(gpDrawTransformFeedbackInstanced, (C.GLenum)(mode), (C.GLuint)(id), (C.GLsizei)(instancecount)) +} + +// render primitives using a count derived from a specifed stream of a transform feedback object +func DrawTransformFeedbackStream(mode uint32, id uint32, stream uint32) { + C.glowDrawTransformFeedbackStream(gpDrawTransformFeedbackStream, (C.GLenum)(mode), (C.GLuint)(id), (C.GLuint)(stream)) +} + +// render multiple instances of primitives using a count derived from a specifed stream of a transform feedback object +func DrawTransformFeedbackStreamInstanced(mode uint32, id uint32, stream uint32, instancecount int32) { + C.glowDrawTransformFeedbackStreamInstanced(gpDrawTransformFeedbackStreamInstanced, (C.GLenum)(mode), (C.GLuint)(id), (C.GLuint)(stream), (C.GLsizei)(instancecount)) +} + +// enable or disable server-side GL capabilities +func Enable(cap uint32) { + C.glowEnable(gpEnable, (C.GLenum)(cap)) +} + +// Enable or disable a generic vertex attribute array +func EnableVertexArrayAttrib(vaobj uint32, index uint32) { + C.glowEnableVertexArrayAttrib(gpEnableVertexArrayAttrib, (C.GLuint)(vaobj), (C.GLuint)(index)) +} + +// Enable or disable a generic vertex attribute array +func EnableVertexAttribArray(index uint32) { + C.glowEnableVertexAttribArray(gpEnableVertexAttribArray, (C.GLuint)(index)) +} +func Enablei(target uint32, index uint32) { + C.glowEnablei(gpEnablei, (C.GLenum)(target), (C.GLuint)(index)) +} +func EndConditionalRender() { + C.glowEndConditionalRender(gpEndConditionalRender) +} +func EndQuery(target uint32) { + C.glowEndQuery(gpEndQuery, (C.GLenum)(target)) +} +func EndQueryIndexed(target uint32, index uint32) { + C.glowEndQueryIndexed(gpEndQueryIndexed, (C.GLenum)(target), (C.GLuint)(index)) +} +func EndTransformFeedback() { + C.glowEndTransformFeedback(gpEndTransformFeedback) +} + +// create a new sync object and insert it into the GL command stream +func FenceSync(condition uint32, flags uint32) unsafe.Pointer { + ret := C.glowFenceSync(gpFenceSync, (C.GLenum)(condition), (C.GLbitfield)(flags)) + return (unsafe.Pointer)(ret) +} + +// block until all GL execution is complete +func Finish() { + C.glowFinish(gpFinish) +} + +// force execution of GL commands in finite time +func Flush() { + C.glowFlush(gpFlush) +} + +// indicate modifications to a range of a mapped buffer +func FlushMappedBufferRange(target uint32, offset int, length int) { + C.glowFlushMappedBufferRange(gpFlushMappedBufferRange, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(length)) +} + +// indicate modifications to a range of a mapped buffer +func FlushMappedNamedBufferRange(buffer uint32, offset int, length int32) { + C.glowFlushMappedNamedBufferRange(gpFlushMappedNamedBufferRange, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(length)) +} + +// set a named parameter of a framebuffer object +func FramebufferParameteri(target uint32, pname uint32, param int32) { + C.glowFramebufferParameteri(gpFramebufferParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param)) +} + +// attach a renderbuffer as a logical buffer of a framebuffer object +func FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) { + C.glowFramebufferRenderbuffer(gpFramebufferRenderbuffer, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(renderbuffertarget), (C.GLuint)(renderbuffer)) +} + +// attach a level of a texture object as a logical buffer of a framebuffer object +func FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) { + C.glowFramebufferTexture(gpFramebufferTexture, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level)) +} +func FramebufferTexture1D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32) { + C.glowFramebufferTexture1D(gpFramebufferTexture1D, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level)) +} +func FramebufferTexture2D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32) { + C.glowFramebufferTexture2D(gpFramebufferTexture2D, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level)) +} +func FramebufferTexture3D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32, zoffset int32) { + C.glowFramebufferTexture3D(gpFramebufferTexture3D, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(zoffset)) +} + +// attach a single layer of a texture object as a logical buffer of a framebuffer object +func FramebufferTextureLayer(target uint32, attachment uint32, texture uint32, level int32, layer int32) { + C.glowFramebufferTextureLayer(gpFramebufferTextureLayer, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer)) +} + +// define front- and back-facing polygons +func FrontFace(mode uint32) { + C.glowFrontFace(gpFrontFace, (C.GLenum)(mode)) +} + +// generate buffer object names +func GenBuffers(n int32, buffers *uint32) { + C.glowGenBuffers(gpGenBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers))) +} + +// generate framebuffer object names +func GenFramebuffers(n int32, framebuffers *uint32) { + C.glowGenFramebuffers(gpGenFramebuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers))) +} + +// reserve program pipeline object names +func GenProgramPipelines(n int32, pipelines *uint32) { + C.glowGenProgramPipelines(gpGenProgramPipelines, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines))) +} + +// generate query object names +func GenQueries(n int32, ids *uint32) { + C.glowGenQueries(gpGenQueries, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids))) +} + +// generate renderbuffer object names +func GenRenderbuffers(n int32, renderbuffers *uint32) { + C.glowGenRenderbuffers(gpGenRenderbuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers))) +} + +// generate sampler object names +func GenSamplers(count int32, samplers *uint32) { + C.glowGenSamplers(gpGenSamplers, (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers))) +} + +// generate texture names +func GenTextures(n int32, textures *uint32) { + C.glowGenTextures(gpGenTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures))) +} + +// reserve transform feedback object names +func GenTransformFeedbacks(n int32, ids *uint32) { + C.glowGenTransformFeedbacks(gpGenTransformFeedbacks, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids))) +} + +// generate vertex array object names +func GenVertexArrays(n int32, arrays *uint32) { + C.glowGenVertexArrays(gpGenVertexArrays, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays))) +} + +// generate mipmaps for a specified texture object +func GenerateMipmap(target uint32) { + C.glowGenerateMipmap(gpGenerateMipmap, (C.GLenum)(target)) +} + +// generate mipmaps for a specified texture object +func GenerateTextureMipmap(texture uint32) { + C.glowGenerateTextureMipmap(gpGenerateTextureMipmap, (C.GLuint)(texture)) +} + +// retrieve information about the set of active atomic counter buffers for a program +func GetActiveAtomicCounterBufferiv(program uint32, bufferIndex uint32, pname uint32, params *int32) { + C.glowGetActiveAtomicCounterBufferiv(gpGetActiveAtomicCounterBufferiv, (C.GLuint)(program), (C.GLuint)(bufferIndex), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// Returns information about an active attribute variable for the specified program object +func GetActiveAttrib(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8) { + C.glowGetActiveAttrib(gpGetActiveAttrib, (C.GLuint)(program), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(size)), (*C.GLenum)(unsafe.Pointer(xtype)), (*C.GLchar)(unsafe.Pointer(name))) +} + +// query the name of an active shader subroutine +func GetActiveSubroutineName(program uint32, shadertype uint32, index uint32, bufsize int32, length *int32, name *uint8) { + C.glowGetActiveSubroutineName(gpGetActiveSubroutineName, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLuint)(index), (C.GLsizei)(bufsize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(name))) +} + +// query the name of an active shader subroutine uniform +func GetActiveSubroutineUniformName(program uint32, shadertype uint32, index uint32, bufsize int32, length *int32, name *uint8) { + C.glowGetActiveSubroutineUniformName(gpGetActiveSubroutineUniformName, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLuint)(index), (C.GLsizei)(bufsize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(name))) +} +func GetActiveSubroutineUniformiv(program uint32, shadertype uint32, index uint32, pname uint32, values *int32) { + C.glowGetActiveSubroutineUniformiv(gpGetActiveSubroutineUniformiv, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(values))) +} + +// Returns information about an active uniform variable for the specified program object +func GetActiveUniform(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8) { + C.glowGetActiveUniform(gpGetActiveUniform, (C.GLuint)(program), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(size)), (*C.GLenum)(unsafe.Pointer(xtype)), (*C.GLchar)(unsafe.Pointer(name))) +} + +// retrieve the name of an active uniform block +func GetActiveUniformBlockName(program uint32, uniformBlockIndex uint32, bufSize int32, length *int32, uniformBlockName *uint8) { + C.glowGetActiveUniformBlockName(gpGetActiveUniformBlockName, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(uniformBlockName))) +} +func GetActiveUniformBlockiv(program uint32, uniformBlockIndex uint32, pname uint32, params *int32) { + C.glowGetActiveUniformBlockiv(gpGetActiveUniformBlockiv, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// query the name of an active uniform +func GetActiveUniformName(program uint32, uniformIndex uint32, bufSize int32, length *int32, uniformName *uint8) { + C.glowGetActiveUniformName(gpGetActiveUniformName, (C.GLuint)(program), (C.GLuint)(uniformIndex), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(uniformName))) +} + +// Returns information about several active uniform variables for the specified program object +func GetActiveUniformsiv(program uint32, uniformCount int32, uniformIndices *uint32, pname uint32, params *int32) { + C.glowGetActiveUniformsiv(gpGetActiveUniformsiv, (C.GLuint)(program), (C.GLsizei)(uniformCount), (*C.GLuint)(unsafe.Pointer(uniformIndices)), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// Returns the handles of the shader objects attached to a program object +func GetAttachedShaders(program uint32, maxCount int32, count *int32, shaders *uint32) { + C.glowGetAttachedShaders(gpGetAttachedShaders, (C.GLuint)(program), (C.GLsizei)(maxCount), (*C.GLsizei)(unsafe.Pointer(count)), (*C.GLuint)(unsafe.Pointer(shaders))) +} + +// Returns the location of an attribute variable +func GetAttribLocation(program uint32, name *uint8) int32 { + ret := C.glowGetAttribLocation(gpGetAttribLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} +func GetBooleani_v(target uint32, index uint32, data *bool) { + C.glowGetBooleani_v(gpGetBooleani_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLboolean)(unsafe.Pointer(data))) +} +func GetBooleanv(pname uint32, data *bool) { + C.glowGetBooleanv(gpGetBooleanv, (C.GLenum)(pname), (*C.GLboolean)(unsafe.Pointer(data))) +} + +// return parameters of a buffer object +func GetBufferParameteri64v(target uint32, pname uint32, params *int64) { + C.glowGetBufferParameteri64v(gpGetBufferParameteri64v, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(params))) +} + +// return parameters of a buffer object +func GetBufferParameteriv(target uint32, pname uint32, params *int32) { + C.glowGetBufferParameteriv(gpGetBufferParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// return the pointer to a mapped buffer object's data store +func GetBufferPointerv(target uint32, pname uint32, params *unsafe.Pointer) { + C.glowGetBufferPointerv(gpGetBufferPointerv, (C.GLenum)(target), (C.GLenum)(pname), params) +} + +// returns a subset of a buffer object's data store +func GetBufferSubData(target uint32, offset int, size int, data unsafe.Pointer) { + C.glowGetBufferSubData(gpGetBufferSubData, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data) +} + +// return a compressed texture image +func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) { + C.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img) +} + +// return a compressed texture image +func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) { + C.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels) +} + +// retrieve a sub-region of a compressed texture image from a compressed texture object +func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) { + C.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels) +} + +// retrieve messages from the debug message log +func GetDebugMessageLog(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *uint8) uint32 { + ret := C.glowGetDebugMessageLog(gpGetDebugMessageLog, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog))) + return (uint32)(ret) +} +func GetDebugMessageLogARB(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *uint8) uint32 { + ret := C.glowGetDebugMessageLogARB(gpGetDebugMessageLogARB, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog))) + return (uint32)(ret) +} +func GetDebugMessageLogKHR(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *uint8) uint32 { + ret := C.glowGetDebugMessageLogKHR(gpGetDebugMessageLogKHR, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog))) + return (uint32)(ret) +} +func GetDoublei_v(target uint32, index uint32, data *float64) { + C.glowGetDoublei_v(gpGetDoublei_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(data))) +} +func GetDoublev(pname uint32, data *float64) { + C.glowGetDoublev(gpGetDoublev, (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(data))) +} + +// return error information +func GetError() uint32 { + ret := C.glowGetError(gpGetError) + return (uint32)(ret) +} +func GetFloati_v(target uint32, index uint32, data *float32) { + C.glowGetFloati_v(gpGetFloati_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(data))) +} +func GetFloatv(pname uint32, data *float32) { + C.glowGetFloatv(gpGetFloatv, (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(data))) +} + +// query the bindings of color indices to user-defined varying out variables +func GetFragDataIndex(program uint32, name *uint8) int32 { + ret := C.glowGetFragDataIndex(gpGetFragDataIndex, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} + +// query the bindings of color numbers to user-defined varying out variables +func GetFragDataLocation(program uint32, name *uint8) int32 { + ret := C.glowGetFragDataLocation(gpGetFragDataLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} + +// retrieve information about attachments of a framebuffer object +func GetFramebufferAttachmentParameteriv(target uint32, attachment uint32, pname uint32, params *int32) { + C.glowGetFramebufferAttachmentParameteriv(gpGetFramebufferAttachmentParameteriv, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// query a named parameter of a framebuffer object +func GetFramebufferParameteriv(target uint32, pname uint32, params *int32) { + C.glowGetFramebufferParameteriv(gpGetFramebufferParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// check if the rendering context has not been lost due to software or hardware issues +func GetGraphicsResetStatus() uint32 { + ret := C.glowGetGraphicsResetStatus(gpGetGraphicsResetStatus) + return (uint32)(ret) +} +func GetGraphicsResetStatusARB() uint32 { + ret := C.glowGetGraphicsResetStatusARB(gpGetGraphicsResetStatusARB) + return (uint32)(ret) +} +func GetGraphicsResetStatusKHR() uint32 { + ret := C.glowGetGraphicsResetStatusKHR(gpGetGraphicsResetStatusKHR) + return (uint32)(ret) +} +func GetImageHandleARB(texture uint32, level int32, layered bool, layer int32, format uint32) uint64 { + ret := C.glowGetImageHandleARB(gpGetImageHandleARB, (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(format)) + return (uint64)(ret) +} +func GetInteger64i_v(target uint32, index uint32, data *int64) { + C.glowGetInteger64i_v(gpGetInteger64i_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLint64)(unsafe.Pointer(data))) +} +func GetInteger64v(pname uint32, data *int64) { + C.glowGetInteger64v(gpGetInteger64v, (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(data))) +} +func GetIntegeri_v(target uint32, index uint32, data *int32) { + C.glowGetIntegeri_v(gpGetIntegeri_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(data))) +} +func GetIntegerv(pname uint32, data *int32) { + C.glowGetIntegerv(gpGetIntegerv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(data))) +} +func GetInternalformati64v(target uint32, internalformat uint32, pname uint32, bufSize int32, params *int64) { + C.glowGetInternalformati64v(gpGetInternalformati64v, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(pname), (C.GLsizei)(bufSize), (*C.GLint64)(unsafe.Pointer(params))) +} +func GetInternalformativ(target uint32, internalformat uint32, pname uint32, bufSize int32, params *int32) { + C.glowGetInternalformativ(gpGetInternalformativ, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(pname), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params))) +} + +// retrieve the location of a sample +func GetMultisamplefv(pname uint32, index uint32, val *float32) { + C.glowGetMultisamplefv(gpGetMultisamplefv, (C.GLenum)(pname), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(val))) +} + +// return parameters of a buffer object +func GetNamedBufferParameteri64v(buffer uint32, pname uint32, params *int64) { + C.glowGetNamedBufferParameteri64v(gpGetNamedBufferParameteri64v, (C.GLuint)(buffer), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(params))) +} + +// return parameters of a buffer object +func GetNamedBufferParameteriv(buffer uint32, pname uint32, params *int32) { + C.glowGetNamedBufferParameteriv(gpGetNamedBufferParameteriv, (C.GLuint)(buffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// return the pointer to a mapped buffer object's data store +func GetNamedBufferPointerv(buffer uint32, pname uint32, params *unsafe.Pointer) { + C.glowGetNamedBufferPointerv(gpGetNamedBufferPointerv, (C.GLuint)(buffer), (C.GLenum)(pname), params) +} + +// returns a subset of a buffer object's data store +func GetNamedBufferSubData(buffer uint32, offset int, size int32, data unsafe.Pointer) { + C.glowGetNamedBufferSubData(gpGetNamedBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(size), data) +} + +// retrieve information about attachments of a framebuffer object +func GetNamedFramebufferAttachmentParameteriv(framebuffer uint32, attachment uint32, pname uint32, params *int32) { + C.glowGetNamedFramebufferAttachmentParameteriv(gpGetNamedFramebufferAttachmentParameteriv, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// query a named parameter of a framebuffer object +func GetNamedFramebufferParameteriv(framebuffer uint32, pname uint32, param *int32) { + C.glowGetNamedFramebufferParameteriv(gpGetNamedFramebufferParameteriv, (C.GLuint)(framebuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} + +// query a named parameter of a renderbuffer object +func GetNamedRenderbufferParameteriv(renderbuffer uint32, pname uint32, params *int32) { + C.glowGetNamedRenderbufferParameteriv(gpGetNamedRenderbufferParameteriv, (C.GLuint)(renderbuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetNamedStringARB(namelen int32, name *uint8, bufSize int32, stringlen *int32, xstring *uint8) { + C.glowGetNamedStringARB(gpGetNamedStringARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(stringlen)), (*C.GLchar)(unsafe.Pointer(xstring))) +} +func GetNamedStringivARB(namelen int32, name *uint8, pname uint32, params *int32) { + C.glowGetNamedStringivARB(gpGetNamedStringivARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// retrieve the label of a named object identified within a namespace +func GetObjectLabel(identifier uint32, name uint32, bufSize int32, length *int32, label *uint8) { + C.glowGetObjectLabel(gpGetObjectLabel, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label))) +} +func GetObjectLabelKHR(identifier uint32, name uint32, bufSize int32, length *int32, label *uint8) { + C.glowGetObjectLabelKHR(gpGetObjectLabelKHR, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label))) +} + +// retrieve the label of a sync object identified by a pointer +func GetObjectPtrLabel(ptr unsafe.Pointer, bufSize int32, length *int32, label *uint8) { + C.glowGetObjectPtrLabel(gpGetObjectPtrLabel, ptr, (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label))) +} +func GetObjectPtrLabelKHR(ptr unsafe.Pointer, bufSize int32, length *int32, label *uint8) { + C.glowGetObjectPtrLabelKHR(gpGetObjectPtrLabelKHR, ptr, (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label))) +} + +// return the address of the specified pointer +func GetPointerv(pname uint32, params *unsafe.Pointer) { + C.glowGetPointerv(gpGetPointerv, (C.GLenum)(pname), params) +} +func GetPointervKHR(pname uint32, params *unsafe.Pointer) { + C.glowGetPointervKHR(gpGetPointervKHR, (C.GLenum)(pname), params) +} + +// return a binary representation of a program object's compiled and linked executable source +func GetProgramBinary(program uint32, bufSize int32, length *int32, binaryFormat *uint32, binary unsafe.Pointer) { + C.glowGetProgramBinary(gpGetProgramBinary, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLenum)(unsafe.Pointer(binaryFormat)), binary) +} + +// Returns the information log for a program object +func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) { + C.glowGetProgramInfoLog(gpGetProgramInfoLog, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog))) +} +func GetProgramInterfaceiv(program uint32, programInterface uint32, pname uint32, params *int32) { + C.glowGetProgramInterfaceiv(gpGetProgramInterfaceiv, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// retrieve the info log string from a program pipeline object +func GetProgramPipelineInfoLog(pipeline uint32, bufSize int32, length *int32, infoLog *uint8) { + C.glowGetProgramPipelineInfoLog(gpGetProgramPipelineInfoLog, (C.GLuint)(pipeline), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog))) +} +func GetProgramPipelineiv(pipeline uint32, pname uint32, params *int32) { + C.glowGetProgramPipelineiv(gpGetProgramPipelineiv, (C.GLuint)(pipeline), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// query the index of a named resource within a program +func GetProgramResourceIndex(program uint32, programInterface uint32, name *uint8) uint32 { + ret := C.glowGetProgramResourceIndex(gpGetProgramResourceIndex, (C.GLuint)(program), (C.GLenum)(programInterface), (*C.GLchar)(unsafe.Pointer(name))) + return (uint32)(ret) +} + +// query the location of a named resource within a program +func GetProgramResourceLocation(program uint32, programInterface uint32, name *uint8) int32 { + ret := C.glowGetProgramResourceLocation(gpGetProgramResourceLocation, (C.GLuint)(program), (C.GLenum)(programInterface), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} + +// query the fragment color index of a named variable within a program +func GetProgramResourceLocationIndex(program uint32, programInterface uint32, name *uint8) int32 { + ret := C.glowGetProgramResourceLocationIndex(gpGetProgramResourceLocationIndex, (C.GLuint)(program), (C.GLenum)(programInterface), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} + +// query the name of an indexed resource within a program +func GetProgramResourceName(program uint32, programInterface uint32, index uint32, bufSize int32, length *int32, name *uint8) { + C.glowGetProgramResourceName(gpGetProgramResourceName, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(name))) +} +func GetProgramResourceiv(program uint32, programInterface uint32, index uint32, propCount int32, props *uint32, bufSize int32, length *int32, params *int32) { + C.glowGetProgramResourceiv(gpGetProgramResourceiv, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLuint)(index), (C.GLsizei)(propCount), (*C.GLenum)(unsafe.Pointer(props)), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(params))) +} +func GetProgramStageiv(program uint32, shadertype uint32, pname uint32, values *int32) { + C.glowGetProgramStageiv(gpGetProgramStageiv, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(values))) +} + +// Returns a parameter from a program object +func GetProgramiv(program uint32, pname uint32, params *int32) { + C.glowGetProgramiv(gpGetProgramiv, (C.GLuint)(program), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// return parameters of an indexed query object target +func GetQueryIndexediv(target uint32, index uint32, pname uint32, params *int32) { + C.glowGetQueryIndexediv(gpGetQueryIndexediv, (C.GLenum)(target), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetQueryObjecti64v(id uint32, pname uint32, params *int64) { + C.glowGetQueryObjecti64v(gpGetQueryObjecti64v, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(params))) +} +func GetQueryObjectiv(id uint32, pname uint32, params *int32) { + C.glowGetQueryObjectiv(gpGetQueryObjectiv, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetQueryObjectui64v(id uint32, pname uint32, params *uint64) { + C.glowGetQueryObjectui64v(gpGetQueryObjectui64v, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLuint64)(unsafe.Pointer(params))) +} +func GetQueryObjectuiv(id uint32, pname uint32, params *uint32) { + C.glowGetQueryObjectuiv(gpGetQueryObjectuiv, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} + +// return parameters of a query object target +func GetQueryiv(target uint32, pname uint32, params *int32) { + C.glowGetQueryiv(gpGetQueryiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// query a named parameter of a renderbuffer object +func GetRenderbufferParameteriv(target uint32, pname uint32, params *int32) { + C.glowGetRenderbufferParameteriv(gpGetRenderbufferParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetSamplerParameterIiv(sampler uint32, pname uint32, params *int32) { + C.glowGetSamplerParameterIiv(gpGetSamplerParameterIiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetSamplerParameterIuiv(sampler uint32, pname uint32, params *uint32) { + C.glowGetSamplerParameterIuiv(gpGetSamplerParameterIuiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetSamplerParameterfv(sampler uint32, pname uint32, params *float32) { + C.glowGetSamplerParameterfv(gpGetSamplerParameterfv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetSamplerParameteriv(sampler uint32, pname uint32, params *int32) { + C.glowGetSamplerParameteriv(gpGetSamplerParameteriv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// Returns the information log for a shader object +func GetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *uint8) { + C.glowGetShaderInfoLog(gpGetShaderInfoLog, (C.GLuint)(shader), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog))) +} + +// retrieve the range and precision for numeric formats supported by the shader compiler +func GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32, xrange *int32, precision *int32) { + C.glowGetShaderPrecisionFormat(gpGetShaderPrecisionFormat, (C.GLenum)(shadertype), (C.GLenum)(precisiontype), (*C.GLint)(unsafe.Pointer(xrange)), (*C.GLint)(unsafe.Pointer(precision))) +} + +// Returns the source code string from a shader object +func GetShaderSource(shader uint32, bufSize int32, length *int32, source *uint8) { + C.glowGetShaderSource(gpGetShaderSource, (C.GLuint)(shader), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(source))) +} + +// Returns a parameter from a shader object +func GetShaderiv(shader uint32, pname uint32, params *int32) { + C.glowGetShaderiv(gpGetShaderiv, (C.GLuint)(shader), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// return a string describing the current GL connection +func GetString(name uint32) *uint8 { + ret := C.glowGetString(gpGetString, (C.GLenum)(name)) + return (*uint8)(ret) +} +func GetStringi(name uint32, index uint32) *uint8 { + ret := C.glowGetStringi(gpGetStringi, (C.GLenum)(name), (C.GLuint)(index)) + return (*uint8)(ret) +} + +// retrieve the index of a subroutine uniform of a given shader stage within a program +func GetSubroutineIndex(program uint32, shadertype uint32, name *uint8) uint32 { + ret := C.glowGetSubroutineIndex(gpGetSubroutineIndex, (C.GLuint)(program), (C.GLenum)(shadertype), (*C.GLchar)(unsafe.Pointer(name))) + return (uint32)(ret) +} + +// retrieve the location of a subroutine uniform of a given shader stage within a program +func GetSubroutineUniformLocation(program uint32, shadertype uint32, name *uint8) int32 { + ret := C.glowGetSubroutineUniformLocation(gpGetSubroutineUniformLocation, (C.GLuint)(program), (C.GLenum)(shadertype), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} + +// query the properties of a sync object +func GetSynciv(sync unsafe.Pointer, pname uint32, bufSize int32, length *int32, values *int32) { + C.glowGetSynciv(gpGetSynciv, (C.GLsync)(sync), (C.GLenum)(pname), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(values))) +} + +// return a texture image +func GetTexImage(target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowGetTexImage(gpGetTexImage, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} +func GetTexLevelParameterfv(target uint32, level int32, pname uint32, params *float32) { + C.glowGetTexLevelParameterfv(gpGetTexLevelParameterfv, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetTexLevelParameteriv(target uint32, level int32, pname uint32, params *int32) { + C.glowGetTexLevelParameteriv(gpGetTexLevelParameteriv, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetTexParameterIiv(target uint32, pname uint32, params *int32) { + C.glowGetTexParameterIiv(gpGetTexParameterIiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetTexParameterIuiv(target uint32, pname uint32, params *uint32) { + C.glowGetTexParameterIuiv(gpGetTexParameterIuiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetTexParameterfv(target uint32, pname uint32, params *float32) { + C.glowGetTexParameterfv(gpGetTexParameterfv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetTexParameteriv(target uint32, pname uint32, params *int32) { + C.glowGetTexParameteriv(gpGetTexParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetTextureHandleARB(texture uint32) uint64 { + ret := C.glowGetTextureHandleARB(gpGetTextureHandleARB, (C.GLuint)(texture)) + return (uint64)(ret) +} + +// return a texture image +func GetTextureImage(texture uint32, level int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) { + C.glowGetTextureImage(gpGetTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels) +} +func GetTextureLevelParameterfv(texture uint32, level int32, pname uint32, params *float32) { + C.glowGetTextureLevelParameterfv(gpGetTextureLevelParameterfv, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetTextureLevelParameteriv(texture uint32, level int32, pname uint32, params *int32) { + C.glowGetTextureLevelParameteriv(gpGetTextureLevelParameteriv, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetTextureParameterIiv(texture uint32, pname uint32, params *int32) { + C.glowGetTextureParameterIiv(gpGetTextureParameterIiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetTextureParameterIuiv(texture uint32, pname uint32, params *uint32) { + C.glowGetTextureParameterIuiv(gpGetTextureParameterIuiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetTextureParameterfv(texture uint32, pname uint32, params *float32) { + C.glowGetTextureParameterfv(gpGetTextureParameterfv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetTextureParameteriv(texture uint32, pname uint32, params *int32) { + C.glowGetTextureParameteriv(gpGetTextureParameteriv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetTextureSamplerHandleARB(texture uint32, sampler uint32) uint64 { + ret := C.glowGetTextureSamplerHandleARB(gpGetTextureSamplerHandleARB, (C.GLuint)(texture), (C.GLuint)(sampler)) + return (uint64)(ret) +} + +// retrieve a sub-region of a texture image from a texture object +func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) { + C.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels) +} + +// retrieve information about varying variables selected for transform feedback +func GetTransformFeedbackVarying(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8) { + C.glowGetTransformFeedbackVarying(gpGetTransformFeedbackVarying, (C.GLuint)(program), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLsizei)(unsafe.Pointer(size)), (*C.GLenum)(unsafe.Pointer(xtype)), (*C.GLchar)(unsafe.Pointer(name))) +} +func GetTransformFeedbacki64_v(xfb uint32, pname uint32, index uint32, param *int64) { + C.glowGetTransformFeedbacki64_v(gpGetTransformFeedbacki64_v, (C.GLuint)(xfb), (C.GLenum)(pname), (C.GLuint)(index), (*C.GLint64)(unsafe.Pointer(param))) +} +func GetTransformFeedbacki_v(xfb uint32, pname uint32, index uint32, param *int32) { + C.glowGetTransformFeedbacki_v(gpGetTransformFeedbacki_v, (C.GLuint)(xfb), (C.GLenum)(pname), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(param))) +} + +// query the state of a transform feedback object. +func GetTransformFeedbackiv(xfb uint32, pname uint32, param *int32) { + C.glowGetTransformFeedbackiv(gpGetTransformFeedbackiv, (C.GLuint)(xfb), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} + +// retrieve the index of a named uniform block +func GetUniformBlockIndex(program uint32, uniformBlockName *uint8) uint32 { + ret := C.glowGetUniformBlockIndex(gpGetUniformBlockIndex, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(uniformBlockName))) + return (uint32)(ret) +} + +// retrieve the index of a named uniform block +func GetUniformIndices(program uint32, uniformCount int32, uniformNames **uint8, uniformIndices *uint32) { + C.glowGetUniformIndices(gpGetUniformIndices, (C.GLuint)(program), (C.GLsizei)(uniformCount), (**C.GLchar)(unsafe.Pointer(uniformNames)), (*C.GLuint)(unsafe.Pointer(uniformIndices))) +} + +// Returns the location of a uniform variable +func GetUniformLocation(program uint32, name *uint8) int32 { + ret := C.glowGetUniformLocation(gpGetUniformLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name))) + return (int32)(ret) +} +func GetUniformSubroutineuiv(shadertype uint32, location int32, params *uint32) { + C.glowGetUniformSubroutineuiv(gpGetUniformSubroutineuiv, (C.GLenum)(shadertype), (C.GLint)(location), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetUniformdv(program uint32, location int32, params *float64) { + C.glowGetUniformdv(gpGetUniformdv, (C.GLuint)(program), (C.GLint)(location), (*C.GLdouble)(unsafe.Pointer(params))) +} + +// Returns the value of a uniform variable +func GetUniformfv(program uint32, location int32, params *float32) { + C.glowGetUniformfv(gpGetUniformfv, (C.GLuint)(program), (C.GLint)(location), (*C.GLfloat)(unsafe.Pointer(params))) +} + +// Returns the value of a uniform variable +func GetUniformiv(program uint32, location int32, params *int32) { + C.glowGetUniformiv(gpGetUniformiv, (C.GLuint)(program), (C.GLint)(location), (*C.GLint)(unsafe.Pointer(params))) +} +func GetUniformuiv(program uint32, location int32, params *uint32) { + C.glowGetUniformuiv(gpGetUniformuiv, (C.GLuint)(program), (C.GLint)(location), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetVertexArrayIndexed64iv(vaobj uint32, index uint32, pname uint32, param *int64) { + C.glowGetVertexArrayIndexed64iv(gpGetVertexArrayIndexed64iv, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(param))) +} +func GetVertexArrayIndexediv(vaobj uint32, index uint32, pname uint32, param *int32) { + C.glowGetVertexArrayIndexediv(gpGetVertexArrayIndexediv, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} + +// retrieve parameters of a vertex array object +func GetVertexArrayiv(vaobj uint32, pname uint32, param *int32) { + C.glowGetVertexArrayiv(gpGetVertexArrayiv, (C.GLuint)(vaobj), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} + +// Return a generic vertex attribute parameter +func GetVertexAttribIiv(index uint32, pname uint32, params *int32) { + C.glowGetVertexAttribIiv(gpGetVertexAttribIiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// Return a generic vertex attribute parameter +func GetVertexAttribIuiv(index uint32, pname uint32, params *uint32) { + C.glowGetVertexAttribIuiv(gpGetVertexAttribIuiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} + +// Return a generic vertex attribute parameter +func GetVertexAttribLdv(index uint32, pname uint32, params *float64) { + C.glowGetVertexAttribLdv(gpGetVertexAttribLdv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params))) +} +func GetVertexAttribLui64vARB(index uint32, pname uint32, params *uint64) { + C.glowGetVertexAttribLui64vARB(gpGetVertexAttribLui64vARB, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLuint64EXT)(unsafe.Pointer(params))) +} + +// return the address of the specified generic vertex attribute pointer +func GetVertexAttribPointerv(index uint32, pname uint32, pointer *unsafe.Pointer) { + C.glowGetVertexAttribPointerv(gpGetVertexAttribPointerv, (C.GLuint)(index), (C.GLenum)(pname), pointer) +} + +// Return a generic vertex attribute parameter +func GetVertexAttribdv(index uint32, pname uint32, params *float64) { + C.glowGetVertexAttribdv(gpGetVertexAttribdv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params))) +} + +// Return a generic vertex attribute parameter +func GetVertexAttribfv(index uint32, pname uint32, params *float32) { + C.glowGetVertexAttribfv(gpGetVertexAttribfv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} + +// Return a generic vertex attribute parameter +func GetVertexAttribiv(index uint32, pname uint32, params *int32) { + C.glowGetVertexAttribiv(gpGetVertexAttribiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func GetnCompressedTexImageARB(target uint32, lod int32, bufSize int32, img unsafe.Pointer) { + C.glowGetnCompressedTexImageARB(gpGetnCompressedTexImageARB, (C.GLenum)(target), (C.GLint)(lod), (C.GLsizei)(bufSize), img) +} +func GetnTexImageARB(target uint32, level int32, format uint32, xtype uint32, bufSize int32, img unsafe.Pointer) { + C.glowGetnTexImageARB(gpGetnTexImageARB, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), img) +} +func GetnUniformdvARB(program uint32, location int32, bufSize int32, params *float64) { + C.glowGetnUniformdvARB(gpGetnUniformdvARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLdouble)(unsafe.Pointer(params))) +} +func GetnUniformfv(program uint32, location int32, bufSize int32, params *float32) { + C.glowGetnUniformfv(gpGetnUniformfv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetnUniformfvARB(program uint32, location int32, bufSize int32, params *float32) { + C.glowGetnUniformfvARB(gpGetnUniformfvARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetnUniformfvKHR(program uint32, location int32, bufSize int32, params *float32) { + C.glowGetnUniformfvKHR(gpGetnUniformfvKHR, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(params))) +} +func GetnUniformiv(program uint32, location int32, bufSize int32, params *int32) { + C.glowGetnUniformiv(gpGetnUniformiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params))) +} +func GetnUniformivARB(program uint32, location int32, bufSize int32, params *int32) { + C.glowGetnUniformivARB(gpGetnUniformivARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params))) +} +func GetnUniformivKHR(program uint32, location int32, bufSize int32, params *int32) { + C.glowGetnUniformivKHR(gpGetnUniformivKHR, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params))) +} +func GetnUniformuiv(program uint32, location int32, bufSize int32, params *uint32) { + C.glowGetnUniformuiv(gpGetnUniformuiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetnUniformuivARB(program uint32, location int32, bufSize int32, params *uint32) { + C.glowGetnUniformuivARB(gpGetnUniformuivARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint)(unsafe.Pointer(params))) +} +func GetnUniformuivKHR(program uint32, location int32, bufSize int32, params *uint32) { + C.glowGetnUniformuivKHR(gpGetnUniformuivKHR, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint)(unsafe.Pointer(params))) +} + +// specify implementation-specific hints +func Hint(target uint32, mode uint32) { + C.glowHint(gpHint, (C.GLenum)(target), (C.GLenum)(mode)) +} + +// invalidate the content of a buffer object's data store +func InvalidateBufferData(buffer uint32) { + C.glowInvalidateBufferData(gpInvalidateBufferData, (C.GLuint)(buffer)) +} + +// invalidate a region of a buffer object's data store +func InvalidateBufferSubData(buffer uint32, offset int, length int) { + C.glowInvalidateBufferSubData(gpInvalidateBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(length)) +} + +// invalidate the content of some or all of a framebuffer's attachments +func InvalidateFramebuffer(target uint32, numAttachments int32, attachments *uint32) { + C.glowInvalidateFramebuffer(gpInvalidateFramebuffer, (C.GLenum)(target), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments))) +} + +// invalidate the content of some or all of a framebuffer's attachments +func InvalidateNamedFramebufferData(framebuffer uint32, numAttachments int32, attachments *uint32) { + C.glowInvalidateNamedFramebufferData(gpInvalidateNamedFramebufferData, (C.GLuint)(framebuffer), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments))) +} + +// invalidate the content of a region of some or all of a framebuffer's attachments +func InvalidateNamedFramebufferSubData(framebuffer uint32, numAttachments int32, attachments *uint32, x int32, y int32, width int32, height int32) { + C.glowInvalidateNamedFramebufferSubData(gpInvalidateNamedFramebufferSubData, (C.GLuint)(framebuffer), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments)), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// invalidate the content of a region of some or all of a framebuffer's attachments +func InvalidateSubFramebuffer(target uint32, numAttachments int32, attachments *uint32, x int32, y int32, width int32, height int32) { + C.glowInvalidateSubFramebuffer(gpInvalidateSubFramebuffer, (C.GLenum)(target), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments)), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// invalidate the entirety a texture image +func InvalidateTexImage(texture uint32, level int32) { + C.glowInvalidateTexImage(gpInvalidateTexImage, (C.GLuint)(texture), (C.GLint)(level)) +} + +// invalidate a region of a texture image +func InvalidateTexSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32) { + C.glowInvalidateTexSubImage(gpInvalidateTexSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth)) +} + +// determine if a name corresponds to a buffer object +func IsBuffer(buffer uint32) bool { + ret := C.glowIsBuffer(gpIsBuffer, (C.GLuint)(buffer)) + return ret == TRUE +} +func IsEnabled(cap uint32) bool { + ret := C.glowIsEnabled(gpIsEnabled, (C.GLenum)(cap)) + return ret == TRUE +} +func IsEnabledi(target uint32, index uint32) bool { + ret := C.glowIsEnabledi(gpIsEnabledi, (C.GLenum)(target), (C.GLuint)(index)) + return ret == TRUE +} + +// determine if a name corresponds to a framebuffer object +func IsFramebuffer(framebuffer uint32) bool { + ret := C.glowIsFramebuffer(gpIsFramebuffer, (C.GLuint)(framebuffer)) + return ret == TRUE +} +func IsImageHandleResidentARB(handle uint64) bool { + ret := C.glowIsImageHandleResidentARB(gpIsImageHandleResidentARB, (C.GLuint64)(handle)) + return ret == TRUE +} +func IsNamedStringARB(namelen int32, name *uint8) bool { + ret := C.glowIsNamedStringARB(gpIsNamedStringARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name))) + return ret == TRUE +} + +// Determines if a name corresponds to a program object +func IsProgram(program uint32) bool { + ret := C.glowIsProgram(gpIsProgram, (C.GLuint)(program)) + return ret == TRUE +} + +// determine if a name corresponds to a program pipeline object +func IsProgramPipeline(pipeline uint32) bool { + ret := C.glowIsProgramPipeline(gpIsProgramPipeline, (C.GLuint)(pipeline)) + return ret == TRUE +} + +// determine if a name corresponds to a query object +func IsQuery(id uint32) bool { + ret := C.glowIsQuery(gpIsQuery, (C.GLuint)(id)) + return ret == TRUE +} + +// determine if a name corresponds to a renderbuffer object +func IsRenderbuffer(renderbuffer uint32) bool { + ret := C.glowIsRenderbuffer(gpIsRenderbuffer, (C.GLuint)(renderbuffer)) + return ret == TRUE +} + +// determine if a name corresponds to a sampler object +func IsSampler(sampler uint32) bool { + ret := C.glowIsSampler(gpIsSampler, (C.GLuint)(sampler)) + return ret == TRUE +} + +// Determines if a name corresponds to a shader object +func IsShader(shader uint32) bool { + ret := C.glowIsShader(gpIsShader, (C.GLuint)(shader)) + return ret == TRUE +} + +// determine if a name corresponds to a sync object +func IsSync(sync unsafe.Pointer) bool { + ret := C.glowIsSync(gpIsSync, (C.GLsync)(sync)) + return ret == TRUE +} + +// determine if a name corresponds to a texture +func IsTexture(texture uint32) bool { + ret := C.glowIsTexture(gpIsTexture, (C.GLuint)(texture)) + return ret == TRUE +} +func IsTextureHandleResidentARB(handle uint64) bool { + ret := C.glowIsTextureHandleResidentARB(gpIsTextureHandleResidentARB, (C.GLuint64)(handle)) + return ret == TRUE +} + +// determine if a name corresponds to a transform feedback object +func IsTransformFeedback(id uint32) bool { + ret := C.glowIsTransformFeedback(gpIsTransformFeedback, (C.GLuint)(id)) + return ret == TRUE +} + +// determine if a name corresponds to a vertex array object +func IsVertexArray(array uint32) bool { + ret := C.glowIsVertexArray(gpIsVertexArray, (C.GLuint)(array)) + return ret == TRUE +} + +// specify the width of rasterized lines +func LineWidth(width float32) { + C.glowLineWidth(gpLineWidth, (C.GLfloat)(width)) +} + +// Links a program object +func LinkProgram(program uint32) { + C.glowLinkProgram(gpLinkProgram, (C.GLuint)(program)) +} + +// specify a logical pixel operation for rendering +func LogicOp(opcode uint32) { + C.glowLogicOp(gpLogicOp, (C.GLenum)(opcode)) +} +func MakeImageHandleNonResidentARB(handle uint64) { + C.glowMakeImageHandleNonResidentARB(gpMakeImageHandleNonResidentARB, (C.GLuint64)(handle)) +} +func MakeImageHandleResidentARB(handle uint64, access uint32) { + C.glowMakeImageHandleResidentARB(gpMakeImageHandleResidentARB, (C.GLuint64)(handle), (C.GLenum)(access)) +} +func MakeTextureHandleNonResidentARB(handle uint64) { + C.glowMakeTextureHandleNonResidentARB(gpMakeTextureHandleNonResidentARB, (C.GLuint64)(handle)) +} +func MakeTextureHandleResidentARB(handle uint64) { + C.glowMakeTextureHandleResidentARB(gpMakeTextureHandleResidentARB, (C.GLuint64)(handle)) +} + +// map all of a buffer object's data store into the client's address space +func MapBuffer(target uint32, access uint32) unsafe.Pointer { + ret := C.glowMapBuffer(gpMapBuffer, (C.GLenum)(target), (C.GLenum)(access)) + return (unsafe.Pointer)(ret) +} + +// map all or part of a buffer object's data store into the client's address space +func MapBufferRange(target uint32, offset int, length int, access uint32) unsafe.Pointer { + ret := C.glowMapBufferRange(gpMapBufferRange, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(length), (C.GLbitfield)(access)) + return (unsafe.Pointer)(ret) +} + +// map all of a buffer object's data store into the client's address space +func MapNamedBuffer(buffer uint32, access uint32) unsafe.Pointer { + ret := C.glowMapNamedBuffer(gpMapNamedBuffer, (C.GLuint)(buffer), (C.GLenum)(access)) + return (unsafe.Pointer)(ret) +} + +// map all or part of a buffer object's data store into the client's address space +func MapNamedBufferRange(buffer uint32, offset int, length int32, access uint32) unsafe.Pointer { + ret := C.glowMapNamedBufferRange(gpMapNamedBufferRange, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(length), (C.GLbitfield)(access)) + return (unsafe.Pointer)(ret) +} + +// defines a barrier ordering memory transactions +func MemoryBarrier(barriers uint32) { + C.glowMemoryBarrier(gpMemoryBarrier, (C.GLbitfield)(barriers)) +} +func MemoryBarrierByRegion(barriers uint32) { + C.glowMemoryBarrierByRegion(gpMemoryBarrierByRegion, (C.GLbitfield)(barriers)) +} +func MinSampleShadingARB(value float32) { + C.glowMinSampleShadingARB(gpMinSampleShadingARB, (C.GLfloat)(value)) +} + +// render multiple sets of primitives from array data +func MultiDrawArrays(mode uint32, first *int32, count *int32, drawcount int32) { + C.glowMultiDrawArrays(gpMultiDrawArrays, (C.GLenum)(mode), (*C.GLint)(unsafe.Pointer(first)), (*C.GLsizei)(unsafe.Pointer(count)), (C.GLsizei)(drawcount)) +} + +// render multiple sets of primitives from array data, taking parameters from memory +func MultiDrawArraysIndirect(mode uint32, indirect unsafe.Pointer, drawcount int32, stride int32) { + C.glowMultiDrawArraysIndirect(gpMultiDrawArraysIndirect, (C.GLenum)(mode), indirect, (C.GLsizei)(drawcount), (C.GLsizei)(stride)) +} +func MultiDrawArraysIndirectCountARB(mode uint32, indirect int, drawcount int, maxdrawcount int32, stride int32) { + C.glowMultiDrawArraysIndirectCountARB(gpMultiDrawArraysIndirectCountARB, (C.GLenum)(mode), (C.GLintptr)(indirect), (C.GLintptr)(drawcount), (C.GLsizei)(maxdrawcount), (C.GLsizei)(stride)) +} + +// render multiple sets of primitives by specifying indices of array data elements +func MultiDrawElements(mode uint32, count *int32, xtype uint32, indices *unsafe.Pointer, drawcount int32) { + C.glowMultiDrawElements(gpMultiDrawElements, (C.GLenum)(mode), (*C.GLsizei)(unsafe.Pointer(count)), (C.GLenum)(xtype), indices, (C.GLsizei)(drawcount)) +} + +// render multiple sets of primitives by specifying indices of array data elements and an index to apply to each index +func MultiDrawElementsBaseVertex(mode uint32, count *int32, xtype uint32, indices *unsafe.Pointer, drawcount int32, basevertex *int32) { + C.glowMultiDrawElementsBaseVertex(gpMultiDrawElementsBaseVertex, (C.GLenum)(mode), (*C.GLsizei)(unsafe.Pointer(count)), (C.GLenum)(xtype), indices, (C.GLsizei)(drawcount), (*C.GLint)(unsafe.Pointer(basevertex))) +} + +// render indexed primitives from array data, taking parameters from memory +func MultiDrawElementsIndirect(mode uint32, xtype uint32, indirect unsafe.Pointer, drawcount int32, stride int32) { + C.glowMultiDrawElementsIndirect(gpMultiDrawElementsIndirect, (C.GLenum)(mode), (C.GLenum)(xtype), indirect, (C.GLsizei)(drawcount), (C.GLsizei)(stride)) +} +func MultiDrawElementsIndirectCountARB(mode uint32, xtype uint32, indirect int, drawcount int, maxdrawcount int32, stride int32) { + C.glowMultiDrawElementsIndirectCountARB(gpMultiDrawElementsIndirectCountARB, (C.GLenum)(mode), (C.GLenum)(xtype), (C.GLintptr)(indirect), (C.GLintptr)(drawcount), (C.GLsizei)(maxdrawcount), (C.GLsizei)(stride)) +} + +// creates and initializes a buffer object's data store +func NamedBufferData(buffer uint32, size int32, data unsafe.Pointer, usage uint32) { + C.glowNamedBufferData(gpNamedBufferData, (C.GLuint)(buffer), (C.GLsizei)(size), data, (C.GLenum)(usage)) +} +func NamedBufferPageCommitmentARB(buffer uint32, offset int, size int32, commit bool) { + C.glowNamedBufferPageCommitmentARB(gpNamedBufferPageCommitmentARB, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(size), (C.GLboolean)(boolToInt(commit))) +} +func NamedBufferPageCommitmentEXT(buffer uint32, offset int, size int32, commit bool) { + C.glowNamedBufferPageCommitmentEXT(gpNamedBufferPageCommitmentEXT, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(size), (C.GLboolean)(boolToInt(commit))) +} + +// creates and initializes a buffer object's immutable data store +func NamedBufferStorage(buffer uint32, size int32, data unsafe.Pointer, flags uint32) { + C.glowNamedBufferStorage(gpNamedBufferStorage, (C.GLuint)(buffer), (C.GLsizei)(size), data, (C.GLbitfield)(flags)) +} + +// updates a subset of a buffer object's data store +func NamedBufferSubData(buffer uint32, offset int, size int32, data unsafe.Pointer) { + C.glowNamedBufferSubData(gpNamedBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(size), data) +} + +// specify which color buffers are to be drawn into +func NamedFramebufferDrawBuffer(framebuffer uint32, buf uint32) { + C.glowNamedFramebufferDrawBuffer(gpNamedFramebufferDrawBuffer, (C.GLuint)(framebuffer), (C.GLenum)(buf)) +} + +// Specifies a list of color buffers to be drawn into +func NamedFramebufferDrawBuffers(framebuffer uint32, n int32, bufs *uint32) { + C.glowNamedFramebufferDrawBuffers(gpNamedFramebufferDrawBuffers, (C.GLuint)(framebuffer), (C.GLsizei)(n), (*C.GLenum)(unsafe.Pointer(bufs))) +} + +// set a named parameter of a framebuffer object +func NamedFramebufferParameteri(framebuffer uint32, pname uint32, param int32) { + C.glowNamedFramebufferParameteri(gpNamedFramebufferParameteri, (C.GLuint)(framebuffer), (C.GLenum)(pname), (C.GLint)(param)) +} + +// select a color buffer source for pixels +func NamedFramebufferReadBuffer(framebuffer uint32, src uint32) { + C.glowNamedFramebufferReadBuffer(gpNamedFramebufferReadBuffer, (C.GLuint)(framebuffer), (C.GLenum)(src)) +} + +// attach a renderbuffer as a logical buffer of a framebuffer object +func NamedFramebufferRenderbuffer(framebuffer uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) { + C.glowNamedFramebufferRenderbuffer(gpNamedFramebufferRenderbuffer, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(renderbuffertarget), (C.GLuint)(renderbuffer)) +} +func NamedFramebufferTexture(framebuffer uint32, attachment uint32, texture uint32, level int32) { + C.glowNamedFramebufferTexture(gpNamedFramebufferTexture, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level)) +} + +// attach a single layer of a texture object as a logical buffer of a framebuffer object +func NamedFramebufferTextureLayer(framebuffer uint32, attachment uint32, texture uint32, level int32, layer int32) { + C.glowNamedFramebufferTextureLayer(gpNamedFramebufferTextureLayer, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer)) +} + +// establish data storage, format and dimensions of a renderbuffer object's image +func NamedRenderbufferStorage(renderbuffer uint32, internalformat uint32, width int32, height int32) { + C.glowNamedRenderbufferStorage(gpNamedRenderbufferStorage, (C.GLuint)(renderbuffer), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// establish data storage, format, dimensions and sample count of a renderbuffer object's image +func NamedRenderbufferStorageMultisample(renderbuffer uint32, samples int32, internalformat uint32, width int32, height int32) { + C.glowNamedRenderbufferStorageMultisample(gpNamedRenderbufferStorageMultisample, (C.GLuint)(renderbuffer), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height)) +} +func NamedStringARB(xtype uint32, namelen int32, name *uint8, stringlen int32, xstring *uint8) { + C.glowNamedStringARB(gpNamedStringARB, (C.GLenum)(xtype), (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)), (C.GLint)(stringlen), (*C.GLchar)(unsafe.Pointer(xstring))) +} + +// label a named object identified within a namespace +func ObjectLabel(identifier uint32, name uint32, length int32, label *uint8) { + C.glowObjectLabel(gpObjectLabel, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label))) +} +func ObjectLabelKHR(identifier uint32, name uint32, length int32, label *uint8) { + C.glowObjectLabelKHR(gpObjectLabelKHR, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label))) +} + +// label a a sync object identified by a pointer +func ObjectPtrLabel(ptr unsafe.Pointer, length int32, label *uint8) { + C.glowObjectPtrLabel(gpObjectPtrLabel, ptr, (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label))) +} +func ObjectPtrLabelKHR(ptr unsafe.Pointer, length int32, label *uint8) { + C.glowObjectPtrLabelKHR(gpObjectPtrLabelKHR, ptr, (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label))) +} +func PatchParameterfv(pname uint32, values *float32) { + C.glowPatchParameterfv(gpPatchParameterfv, (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(values))) +} +func PatchParameteri(pname uint32, value int32) { + C.glowPatchParameteri(gpPatchParameteri, (C.GLenum)(pname), (C.GLint)(value)) +} + +// pause transform feedback operations +func PauseTransformFeedback() { + C.glowPauseTransformFeedback(gpPauseTransformFeedback) +} +func PixelStoref(pname uint32, param float32) { + C.glowPixelStoref(gpPixelStoref, (C.GLenum)(pname), (C.GLfloat)(param)) +} +func PixelStorei(pname uint32, param int32) { + C.glowPixelStorei(gpPixelStorei, (C.GLenum)(pname), (C.GLint)(param)) +} +func PointParameterf(pname uint32, param float32) { + C.glowPointParameterf(gpPointParameterf, (C.GLenum)(pname), (C.GLfloat)(param)) +} +func PointParameterfv(pname uint32, params *float32) { + C.glowPointParameterfv(gpPointParameterfv, (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func PointParameteri(pname uint32, param int32) { + C.glowPointParameteri(gpPointParameteri, (C.GLenum)(pname), (C.GLint)(param)) +} +func PointParameteriv(pname uint32, params *int32) { + C.glowPointParameteriv(gpPointParameteriv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// specify the diameter of rasterized points +func PointSize(size float32) { + C.glowPointSize(gpPointSize, (C.GLfloat)(size)) +} + +// select a polygon rasterization mode +func PolygonMode(face uint32, mode uint32) { + C.glowPolygonMode(gpPolygonMode, (C.GLenum)(face), (C.GLenum)(mode)) +} + +// set the scale and units used to calculate depth values +func PolygonOffset(factor float32, units float32) { + C.glowPolygonOffset(gpPolygonOffset, (C.GLfloat)(factor), (C.GLfloat)(units)) +} + +// pop the active debug group +func PopDebugGroup() { + C.glowPopDebugGroup(gpPopDebugGroup) +} +func PopDebugGroupKHR() { + C.glowPopDebugGroupKHR(gpPopDebugGroupKHR) +} + +// specify the primitive restart index +func PrimitiveRestartIndex(index uint32) { + C.glowPrimitiveRestartIndex(gpPrimitiveRestartIndex, (C.GLuint)(index)) +} + +// load a program object with a program binary +func ProgramBinary(program uint32, binaryFormat uint32, binary unsafe.Pointer, length int32) { + C.glowProgramBinary(gpProgramBinary, (C.GLuint)(program), (C.GLenum)(binaryFormat), binary, (C.GLsizei)(length)) +} +func ProgramParameteri(program uint32, pname uint32, value int32) { + C.glowProgramParameteri(gpProgramParameteri, (C.GLuint)(program), (C.GLenum)(pname), (C.GLint)(value)) +} +func ProgramUniform1d(program uint32, location int32, v0 float64) { + C.glowProgramUniform1d(gpProgramUniform1d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0)) +} +func ProgramUniform1dv(program uint32, location int32, count int32, value *float64) { + C.glowProgramUniform1dv(gpProgramUniform1dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform1f(program uint32, location int32, v0 float32) { + C.glowProgramUniform1f(gpProgramUniform1f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform1fv(program uint32, location int32, count int32, value *float32) { + C.glowProgramUniform1fv(gpProgramUniform1fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform1i(program uint32, location int32, v0 int32) { + C.glowProgramUniform1i(gpProgramUniform1i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform1iv(program uint32, location int32, count int32, value *int32) { + C.glowProgramUniform1iv(gpProgramUniform1iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform1ui(program uint32, location int32, v0 uint32) { + C.glowProgramUniform1ui(gpProgramUniform1ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform1uiv(program uint32, location int32, count int32, value *uint32) { + C.glowProgramUniform1uiv(gpProgramUniform1uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func ProgramUniform2d(program uint32, location int32, v0 float64, v1 float64) { + C.glowProgramUniform2d(gpProgramUniform2d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0), (C.GLdouble)(v1)) +} +func ProgramUniform2dv(program uint32, location int32, count int32, value *float64) { + C.glowProgramUniform2dv(gpProgramUniform2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform2f(program uint32, location int32, v0 float32, v1 float32) { + C.glowProgramUniform2f(gpProgramUniform2f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform2fv(program uint32, location int32, count int32, value *float32) { + C.glowProgramUniform2fv(gpProgramUniform2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform2i(program uint32, location int32, v0 int32, v1 int32) { + C.glowProgramUniform2i(gpProgramUniform2i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform2iv(program uint32, location int32, count int32, value *int32) { + C.glowProgramUniform2iv(gpProgramUniform2iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform2ui(program uint32, location int32, v0 uint32, v1 uint32) { + C.glowProgramUniform2ui(gpProgramUniform2ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform2uiv(program uint32, location int32, count int32, value *uint32) { + C.glowProgramUniform2uiv(gpProgramUniform2uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func ProgramUniform3d(program uint32, location int32, v0 float64, v1 float64, v2 float64) { + C.glowProgramUniform3d(gpProgramUniform3d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0), (C.GLdouble)(v1), (C.GLdouble)(v2)) +} +func ProgramUniform3dv(program uint32, location int32, count int32, value *float64) { + C.glowProgramUniform3dv(gpProgramUniform3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform3f(program uint32, location int32, v0 float32, v1 float32, v2 float32) { + C.glowProgramUniform3f(gpProgramUniform3f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform3fv(program uint32, location int32, count int32, value *float32) { + C.glowProgramUniform3fv(gpProgramUniform3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform3i(program uint32, location int32, v0 int32, v1 int32, v2 int32) { + C.glowProgramUniform3i(gpProgramUniform3i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform3iv(program uint32, location int32, count int32, value *int32) { + C.glowProgramUniform3iv(gpProgramUniform3iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform3ui(program uint32, location int32, v0 uint32, v1 uint32, v2 uint32) { + C.glowProgramUniform3ui(gpProgramUniform3ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform3uiv(program uint32, location int32, count int32, value *uint32) { + C.glowProgramUniform3uiv(gpProgramUniform3uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func ProgramUniform4d(program uint32, location int32, v0 float64, v1 float64, v2 float64, v3 float64) { + C.glowProgramUniform4d(gpProgramUniform4d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0), (C.GLdouble)(v1), (C.GLdouble)(v2), (C.GLdouble)(v3)) +} +func ProgramUniform4dv(program uint32, location int32, count int32, value *float64) { + C.glowProgramUniform4dv(gpProgramUniform4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform4f(program uint32, location int32, v0 float32, v1 float32, v2 float32, v3 float32) { + C.glowProgramUniform4f(gpProgramUniform4f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2), (C.GLfloat)(v3)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform4fv(program uint32, location int32, count int32, value *float32) { + C.glowProgramUniform4fv(gpProgramUniform4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform4i(program uint32, location int32, v0 int32, v1 int32, v2 int32, v3 int32) { + C.glowProgramUniform4i(gpProgramUniform4i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2), (C.GLint)(v3)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform4iv(program uint32, location int32, count int32, value *int32) { + C.glowProgramUniform4iv(gpProgramUniform4iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform4ui(program uint32, location int32, v0 uint32, v1 uint32, v2 uint32, v3 uint32) { + C.glowProgramUniform4ui(gpProgramUniform4ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2), (C.GLuint)(v3)) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniform4uiv(program uint32, location int32, count int32, value *uint32) { + C.glowProgramUniform4uiv(gpProgramUniform4uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func ProgramUniformHandleui64ARB(program uint32, location int32, value uint64) { + C.glowProgramUniformHandleui64ARB(gpProgramUniformHandleui64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(value)) +} +func ProgramUniformHandleui64vARB(program uint32, location int32, count int32, values *uint64) { + C.glowProgramUniformHandleui64vARB(gpProgramUniformHandleui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(values))) +} +func ProgramUniformMatrix2dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix2dv(gpProgramUniformMatrix2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix2fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix2fv(gpProgramUniformMatrix2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix2x3dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix2x3dv(gpProgramUniformMatrix2x3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix2x3fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix2x3fv(gpProgramUniformMatrix2x3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix2x4dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix2x4dv(gpProgramUniformMatrix2x4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix2x4fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix2x4fv(gpProgramUniformMatrix2x4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix3dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix3dv(gpProgramUniformMatrix3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix3fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix3fv(gpProgramUniformMatrix3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix3x2dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix3x2dv(gpProgramUniformMatrix3x2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix3x2fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix3x2fv(gpProgramUniformMatrix3x2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix3x4dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix3x4dv(gpProgramUniformMatrix3x4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix3x4fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix3x4fv(gpProgramUniformMatrix3x4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix4dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix4dv(gpProgramUniformMatrix4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix4fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix4fv(gpProgramUniformMatrix4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix4x2dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix4x2dv(gpProgramUniformMatrix4x2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix4x2fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix4x2fv(gpProgramUniformMatrix4x2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func ProgramUniformMatrix4x3dv(program uint32, location int32, count int32, transpose bool, value *float64) { + C.glowProgramUniformMatrix4x3dv(gpProgramUniformMatrix4x3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for a specified program object +func ProgramUniformMatrix4x3fv(program uint32, location int32, count int32, transpose bool, value *float32) { + C.glowProgramUniformMatrix4x3fv(gpProgramUniformMatrix4x3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// specifiy the vertex to be used as the source of data for flat shaded varyings +func ProvokingVertex(mode uint32) { + C.glowProvokingVertex(gpProvokingVertex, (C.GLenum)(mode)) +} + +// push a named debug group into the command stream +func PushDebugGroup(source uint32, id uint32, length int32, message *uint8) { + C.glowPushDebugGroup(gpPushDebugGroup, (C.GLenum)(source), (C.GLuint)(id), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(message))) +} +func PushDebugGroupKHR(source uint32, id uint32, length int32, message *uint8) { + C.glowPushDebugGroupKHR(gpPushDebugGroupKHR, (C.GLenum)(source), (C.GLuint)(id), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(message))) +} + +// record the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed. +func QueryCounter(id uint32, target uint32) { + C.glowQueryCounter(gpQueryCounter, (C.GLuint)(id), (C.GLenum)(target)) +} + +// select a color buffer source for pixels +func ReadBuffer(src uint32) { + C.glowReadBuffer(gpReadBuffer, (C.GLenum)(src)) +} + +// read a block of pixels from the frame buffer +func ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowReadPixels(gpReadPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// read a block of pixels from the frame buffer +func ReadnPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, bufSize int32, data unsafe.Pointer) { + C.glowReadnPixels(gpReadnPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), data) +} +func ReadnPixelsARB(x int32, y int32, width int32, height int32, format uint32, xtype uint32, bufSize int32, data unsafe.Pointer) { + C.glowReadnPixelsARB(gpReadnPixelsARB, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), data) +} +func ReadnPixelsKHR(x int32, y int32, width int32, height int32, format uint32, xtype uint32, bufSize int32, data unsafe.Pointer) { + C.glowReadnPixelsKHR(gpReadnPixelsKHR, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), data) +} + +// release resources consumed by the implementation's shader compiler +func ReleaseShaderCompiler() { + C.glowReleaseShaderCompiler(gpReleaseShaderCompiler) +} + +// establish data storage, format and dimensions of a renderbuffer object's image +func RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) { + C.glowRenderbufferStorage(gpRenderbufferStorage, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// establish data storage, format, dimensions and sample count of a renderbuffer object's image +func RenderbufferStorageMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32) { + C.glowRenderbufferStorageMultisample(gpRenderbufferStorageMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// resume transform feedback operations +func ResumeTransformFeedback() { + C.glowResumeTransformFeedback(gpResumeTransformFeedback) +} + +// specify multisample coverage parameters +func SampleCoverage(value float32, invert bool) { + C.glowSampleCoverage(gpSampleCoverage, (C.GLfloat)(value), (C.GLboolean)(boolToInt(invert))) +} + +// set the value of a sub-word of the sample mask +func SampleMaski(maskNumber uint32, mask uint32) { + C.glowSampleMaski(gpSampleMaski, (C.GLuint)(maskNumber), (C.GLbitfield)(mask)) +} +func SamplerParameterIiv(sampler uint32, pname uint32, param *int32) { + C.glowSamplerParameterIiv(gpSamplerParameterIiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} +func SamplerParameterIuiv(sampler uint32, pname uint32, param *uint32) { + C.glowSamplerParameterIuiv(gpSamplerParameterIuiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(param))) +} +func SamplerParameterf(sampler uint32, pname uint32, param float32) { + C.glowSamplerParameterf(gpSamplerParameterf, (C.GLuint)(sampler), (C.GLenum)(pname), (C.GLfloat)(param)) +} +func SamplerParameterfv(sampler uint32, pname uint32, param *float32) { + C.glowSamplerParameterfv(gpSamplerParameterfv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(param))) +} +func SamplerParameteri(sampler uint32, pname uint32, param int32) { + C.glowSamplerParameteri(gpSamplerParameteri, (C.GLuint)(sampler), (C.GLenum)(pname), (C.GLint)(param)) +} +func SamplerParameteriv(sampler uint32, pname uint32, param *int32) { + C.glowSamplerParameteriv(gpSamplerParameteriv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} + +// define the scissor box +func Scissor(x int32, y int32, width int32, height int32) { + C.glowScissor(gpScissor, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} +func ScissorArrayv(first uint32, count int32, v *int32) { + C.glowScissorArrayv(gpScissorArrayv, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(v))) +} + +// define the scissor box for a specific viewport +func ScissorIndexed(index uint32, left int32, bottom int32, width int32, height int32) { + C.glowScissorIndexed(gpScissorIndexed, (C.GLuint)(index), (C.GLint)(left), (C.GLint)(bottom), (C.GLsizei)(width), (C.GLsizei)(height)) +} +func ScissorIndexedv(index uint32, v *int32) { + C.glowScissorIndexedv(gpScissorIndexedv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} + +// load pre-compiled shader binaries +func ShaderBinary(count int32, shaders *uint32, binaryformat uint32, binary unsafe.Pointer, length int32) { + C.glowShaderBinary(gpShaderBinary, (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(shaders)), (C.GLenum)(binaryformat), binary, (C.GLsizei)(length)) +} + +// Replaces the source code in a shader object +func ShaderSource(shader uint32, count int32, xstring **uint8, length *int32) { + C.glowShaderSource(gpShaderSource, (C.GLuint)(shader), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(xstring)), (*C.GLint)(unsafe.Pointer(length))) +} + +// change an active shader storage block binding +func ShaderStorageBlockBinding(program uint32, storageBlockIndex uint32, storageBlockBinding uint32) { + C.glowShaderStorageBlockBinding(gpShaderStorageBlockBinding, (C.GLuint)(program), (C.GLuint)(storageBlockIndex), (C.GLuint)(storageBlockBinding)) +} + +// set front and back function and reference value for stencil testing +func StencilFunc(xfunc uint32, ref int32, mask uint32) { + C.glowStencilFunc(gpStencilFunc, (C.GLenum)(xfunc), (C.GLint)(ref), (C.GLuint)(mask)) +} + +// set front and/or back function and reference value for stencil testing +func StencilFuncSeparate(face uint32, xfunc uint32, ref int32, mask uint32) { + C.glowStencilFuncSeparate(gpStencilFuncSeparate, (C.GLenum)(face), (C.GLenum)(xfunc), (C.GLint)(ref), (C.GLuint)(mask)) +} + +// control the front and back writing of individual bits in the stencil planes +func StencilMask(mask uint32) { + C.glowStencilMask(gpStencilMask, (C.GLuint)(mask)) +} + +// control the front and/or back writing of individual bits in the stencil planes +func StencilMaskSeparate(face uint32, mask uint32) { + C.glowStencilMaskSeparate(gpStencilMaskSeparate, (C.GLenum)(face), (C.GLuint)(mask)) +} + +// set front and back stencil test actions +func StencilOp(fail uint32, zfail uint32, zpass uint32) { + C.glowStencilOp(gpStencilOp, (C.GLenum)(fail), (C.GLenum)(zfail), (C.GLenum)(zpass)) +} + +// set front and/or back stencil test actions +func StencilOpSeparate(face uint32, sfail uint32, dpfail uint32, dppass uint32) { + C.glowStencilOpSeparate(gpStencilOpSeparate, (C.GLenum)(face), (C.GLenum)(sfail), (C.GLenum)(dpfail), (C.GLenum)(dppass)) +} + +// attach a buffer object's data store to a buffer texture object +func TexBuffer(target uint32, internalformat uint32, buffer uint32) { + C.glowTexBuffer(gpTexBuffer, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer)) +} + +// attach a range of a buffer object's data store to a buffer texture object +func TexBufferRange(target uint32, internalformat uint32, buffer uint32, offset int, size int) { + C.glowTexBufferRange(gpTexBufferRange, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size)) +} + +// specify a one-dimensional texture image +func TexImage1D(target uint32, level int32, internalformat int32, width int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTexImage1D(gpTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// specify a two-dimensional texture image +func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// establish the data storage, format, dimensions, and number of samples of a multisample texture's image +func TexImage2DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) { + C.glowTexImage2DMultisample(gpTexImage2DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations))) +} + +// specify a three-dimensional texture image +func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTexImage3D(gpTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// establish the data storage, format, dimensions, and number of samples of a multisample texture's image +func TexImage3DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) { + C.glowTexImage3DMultisample(gpTexImage3DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations))) +} +func TexPageCommitmentARB(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, resident bool) { + C.glowTexPageCommitmentARB(gpTexPageCommitmentARB, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(resident))) +} +func TexParameterIiv(target uint32, pname uint32, params *int32) { + C.glowTexParameterIiv(gpTexParameterIiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func TexParameterIuiv(target uint32, pname uint32, params *uint32) { + C.glowTexParameterIuiv(gpTexParameterIuiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} +func TexParameterf(target uint32, pname uint32, param float32) { + C.glowTexParameterf(gpTexParameterf, (C.GLenum)(target), (C.GLenum)(pname), (C.GLfloat)(param)) +} +func TexParameterfv(target uint32, pname uint32, params *float32) { + C.glowTexParameterfv(gpTexParameterfv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params))) +} +func TexParameteri(target uint32, pname uint32, param int32) { + C.glowTexParameteri(gpTexParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param)) +} +func TexParameteriv(target uint32, pname uint32, params *int32) { + C.glowTexParameteriv(gpTexParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} + +// simultaneously specify storage for all levels of a one-dimensional texture +func TexStorage1D(target uint32, levels int32, internalformat uint32, width int32) { + C.glowTexStorage1D(gpTexStorage1D, (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width)) +} + +// simultaneously specify storage for all levels of a two-dimensional or one-dimensional array texture +func TexStorage2D(target uint32, levels int32, internalformat uint32, width int32, height int32) { + C.glowTexStorage2D(gpTexStorage2D, (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// specify storage for a two-dimensional multisample texture +func TexStorage2DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) { + C.glowTexStorage2DMultisample(gpTexStorage2DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations))) +} + +// simultaneously specify storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture +func TexStorage3D(target uint32, levels int32, internalformat uint32, width int32, height int32, depth int32) { + C.glowTexStorage3D(gpTexStorage3D, (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth)) +} + +// specify storage for a two-dimensional multisample array texture +func TexStorage3DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) { + C.glowTexStorage3DMultisample(gpTexStorage3DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations))) +} + +// specify a one-dimensional texture subimage +func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// specify a two-dimensional texture subimage +func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// specify a three-dimensional texture subimage +func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// controls the ordering of reads and writes to rendered fragments across drawing commands +func TextureBarrier() { + C.glowTextureBarrier(gpTextureBarrier) +} + +// attach a buffer object's data store to a buffer texture object +func TextureBuffer(texture uint32, internalformat uint32, buffer uint32) { + C.glowTextureBuffer(gpTextureBuffer, (C.GLuint)(texture), (C.GLenum)(internalformat), (C.GLuint)(buffer)) +} + +// attach a range of a buffer object's data store to a buffer texture object +func TextureBufferRange(texture uint32, internalformat uint32, buffer uint32, offset int, size int32) { + C.glowTextureBufferRange(gpTextureBufferRange, (C.GLuint)(texture), (C.GLenum)(internalformat), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(size)) +} +func TextureParameterIiv(texture uint32, pname uint32, params *int32) { + C.glowTextureParameterIiv(gpTextureParameterIiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) +} +func TextureParameterIuiv(texture uint32, pname uint32, params *uint32) { + C.glowTextureParameterIuiv(gpTextureParameterIuiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params))) +} +func TextureParameterf(texture uint32, pname uint32, param float32) { + C.glowTextureParameterf(gpTextureParameterf, (C.GLuint)(texture), (C.GLenum)(pname), (C.GLfloat)(param)) +} +func TextureParameterfv(texture uint32, pname uint32, param *float32) { + C.glowTextureParameterfv(gpTextureParameterfv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(param))) +} +func TextureParameteri(texture uint32, pname uint32, param int32) { + C.glowTextureParameteri(gpTextureParameteri, (C.GLuint)(texture), (C.GLenum)(pname), (C.GLint)(param)) +} +func TextureParameteriv(texture uint32, pname uint32, param *int32) { + C.glowTextureParameteriv(gpTextureParameteriv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param))) +} + +// simultaneously specify storage for all levels of a one-dimensional texture +func TextureStorage1D(texture uint32, levels int32, internalformat uint32, width int32) { + C.glowTextureStorage1D(gpTextureStorage1D, (C.GLuint)(texture), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width)) +} + +// simultaneously specify storage for all levels of a two-dimensional or one-dimensional array texture +func TextureStorage2D(texture uint32, levels int32, internalformat uint32, width int32, height int32) { + C.glowTextureStorage2D(gpTextureStorage2D, (C.GLuint)(texture), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height)) +} + +// specify storage for a two-dimensional multisample texture +func TextureStorage2DMultisample(texture uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) { + C.glowTextureStorage2DMultisample(gpTextureStorage2DMultisample, (C.GLuint)(texture), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations))) +} + +// simultaneously specify storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture +func TextureStorage3D(texture uint32, levels int32, internalformat uint32, width int32, height int32, depth int32) { + C.glowTextureStorage3D(gpTextureStorage3D, (C.GLuint)(texture), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth)) +} + +// specify storage for a two-dimensional multisample array texture +func TextureStorage3DMultisample(texture uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) { + C.glowTextureStorage3DMultisample(gpTextureStorage3DMultisample, (C.GLuint)(texture), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations))) +} + +// specify a one-dimensional texture subimage +func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// specify a two-dimensional texture subimage +func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// specify a three-dimensional texture subimage +func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) { + C.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels) +} + +// initialize a texture as a data alias of another texture's data store +func TextureView(texture uint32, target uint32, origtexture uint32, internalformat uint32, minlevel uint32, numlevels uint32, minlayer uint32, numlayers uint32) { + C.glowTextureView(gpTextureView, (C.GLuint)(texture), (C.GLenum)(target), (C.GLuint)(origtexture), (C.GLenum)(internalformat), (C.GLuint)(minlevel), (C.GLuint)(numlevels), (C.GLuint)(minlayer), (C.GLuint)(numlayers)) +} + +// bind a buffer object to a transform feedback buffer object +func TransformFeedbackBufferBase(xfb uint32, index uint32, buffer uint32) { + C.glowTransformFeedbackBufferBase(gpTransformFeedbackBufferBase, (C.GLuint)(xfb), (C.GLuint)(index), (C.GLuint)(buffer)) +} + +// bind a range within a buffer object to a transform feedback buffer object +func TransformFeedbackBufferRange(xfb uint32, index uint32, buffer uint32, offset int, size int32) { + C.glowTransformFeedbackBufferRange(gpTransformFeedbackBufferRange, (C.GLuint)(xfb), (C.GLuint)(index), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(size)) +} + +// specify values to record in transform feedback buffers +func TransformFeedbackVaryings(program uint32, count int32, varyings **uint8, bufferMode uint32) { + C.glowTransformFeedbackVaryings(gpTransformFeedbackVaryings, (C.GLuint)(program), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(varyings)), (C.GLenum)(bufferMode)) +} +func Uniform1d(location int32, x float64) { + C.glowUniform1d(gpUniform1d, (C.GLint)(location), (C.GLdouble)(x)) +} +func Uniform1dv(location int32, count int32, value *float64) { + C.glowUniform1dv(gpUniform1dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform1f(location int32, v0 float32) { + C.glowUniform1f(gpUniform1f, (C.GLint)(location), (C.GLfloat)(v0)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform1fv(location int32, count int32, value *float32) { + C.glowUniform1fv(gpUniform1fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform1i(location int32, v0 int32) { + C.glowUniform1i(gpUniform1i, (C.GLint)(location), (C.GLint)(v0)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform1iv(location int32, count int32, value *int32) { + C.glowUniform1iv(gpUniform1iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform1ui(location int32, v0 uint32) { + C.glowUniform1ui(gpUniform1ui, (C.GLint)(location), (C.GLuint)(v0)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform1uiv(location int32, count int32, value *uint32) { + C.glowUniform1uiv(gpUniform1uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func Uniform2d(location int32, x float64, y float64) { + C.glowUniform2d(gpUniform2d, (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y)) +} +func Uniform2dv(location int32, count int32, value *float64) { + C.glowUniform2dv(gpUniform2dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform2f(location int32, v0 float32, v1 float32) { + C.glowUniform2f(gpUniform2f, (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform2fv(location int32, count int32, value *float32) { + C.glowUniform2fv(gpUniform2fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform2i(location int32, v0 int32, v1 int32) { + C.glowUniform2i(gpUniform2i, (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform2iv(location int32, count int32, value *int32) { + C.glowUniform2iv(gpUniform2iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform2ui(location int32, v0 uint32, v1 uint32) { + C.glowUniform2ui(gpUniform2ui, (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform2uiv(location int32, count int32, value *uint32) { + C.glowUniform2uiv(gpUniform2uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func Uniform3d(location int32, x float64, y float64, z float64) { + C.glowUniform3d(gpUniform3d, (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z)) +} +func Uniform3dv(location int32, count int32, value *float64) { + C.glowUniform3dv(gpUniform3dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform3f(location int32, v0 float32, v1 float32, v2 float32) { + C.glowUniform3f(gpUniform3f, (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform3fv(location int32, count int32, value *float32) { + C.glowUniform3fv(gpUniform3fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform3i(location int32, v0 int32, v1 int32, v2 int32) { + C.glowUniform3i(gpUniform3i, (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform3iv(location int32, count int32, value *int32) { + C.glowUniform3iv(gpUniform3iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform3ui(location int32, v0 uint32, v1 uint32, v2 uint32) { + C.glowUniform3ui(gpUniform3ui, (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform3uiv(location int32, count int32, value *uint32) { + C.glowUniform3uiv(gpUniform3uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} +func Uniform4d(location int32, x float64, y float64, z float64, w float64) { + C.glowUniform4d(gpUniform4d, (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w)) +} +func Uniform4dv(location int32, count int32, value *float64) { + C.glowUniform4dv(gpUniform4dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) { + C.glowUniform4f(gpUniform4f, (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2), (C.GLfloat)(v3)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform4fv(location int32, count int32, value *float32) { + C.glowUniform4fv(gpUniform4fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform4i(location int32, v0 int32, v1 int32, v2 int32, v3 int32) { + C.glowUniform4i(gpUniform4i, (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2), (C.GLint)(v3)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform4iv(location int32, count int32, value *int32) { + C.glowUniform4iv(gpUniform4iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func Uniform4ui(location int32, v0 uint32, v1 uint32, v2 uint32, v3 uint32) { + C.glowUniform4ui(gpUniform4ui, (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2), (C.GLuint)(v3)) +} + +// Specify the value of a uniform variable for the current program object +func Uniform4uiv(location int32, count int32, value *uint32) { + C.glowUniform4uiv(gpUniform4uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value))) +} + +// assign a binding point to an active uniform block +func UniformBlockBinding(program uint32, uniformBlockIndex uint32, uniformBlockBinding uint32) { + C.glowUniformBlockBinding(gpUniformBlockBinding, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLuint)(uniformBlockBinding)) +} +func UniformHandleui64ARB(location int32, value uint64) { + C.glowUniformHandleui64ARB(gpUniformHandleui64ARB, (C.GLint)(location), (C.GLuint64)(value)) +} +func UniformHandleui64vARB(location int32, count int32, value *uint64) { + C.glowUniformHandleui64vARB(gpUniformHandleui64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value))) +} +func UniformMatrix2dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix2dv(gpUniformMatrix2dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix2fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix2fv(gpUniformMatrix2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix2x3dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix2x3dv(gpUniformMatrix2x3dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix2x3fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix2x3fv(gpUniformMatrix2x3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix2x4dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix2x4dv(gpUniformMatrix2x4dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix2x4fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix2x4fv(gpUniformMatrix2x4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix3dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix3dv(gpUniformMatrix3dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix3fv(gpUniformMatrix3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix3x2dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix3x2dv(gpUniformMatrix3x2dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix3x2fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix3x2fv(gpUniformMatrix3x2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix3x4dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix3x4dv(gpUniformMatrix3x4dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix3x4fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix3x4fv(gpUniformMatrix3x4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix4dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix4dv(gpUniformMatrix4dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix4fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix4fv(gpUniformMatrix4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix4x2dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix4x2dv(gpUniformMatrix4x2dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix4x2fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix4x2fv(gpUniformMatrix4x2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformMatrix4x3dv(location int32, count int32, transpose bool, value *float64) { + C.glowUniformMatrix4x3dv(gpUniformMatrix4x3dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value))) +} + +// Specify the value of a uniform variable for the current program object +func UniformMatrix4x3fv(location int32, count int32, transpose bool, value *float32) { + C.glowUniformMatrix4x3fv(gpUniformMatrix4x3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value))) +} +func UniformSubroutinesuiv(shadertype uint32, count int32, indices *uint32) { + C.glowUniformSubroutinesuiv(gpUniformSubroutinesuiv, (C.GLenum)(shadertype), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(indices))) +} + +// release the mapping of a buffer object's data store into the client's address space +func UnmapBuffer(target uint32) bool { + ret := C.glowUnmapBuffer(gpUnmapBuffer, (C.GLenum)(target)) + return ret == TRUE +} + +// release the mapping of a buffer object's data store into the client's address space +func UnmapNamedBuffer(buffer uint32) bool { + ret := C.glowUnmapNamedBuffer(gpUnmapNamedBuffer, (C.GLuint)(buffer)) + return ret == TRUE +} + +// Installs a program object as part of current rendering state +func UseProgram(program uint32) { + C.glowUseProgram(gpUseProgram, (C.GLuint)(program)) +} + +// bind stages of a program object to a program pipeline +func UseProgramStages(pipeline uint32, stages uint32, program uint32) { + C.glowUseProgramStages(gpUseProgramStages, (C.GLuint)(pipeline), (C.GLbitfield)(stages), (C.GLuint)(program)) +} + +// Validates a program object +func ValidateProgram(program uint32) { + C.glowValidateProgram(gpValidateProgram, (C.GLuint)(program)) +} + +// validate a program pipeline object against current GL state +func ValidateProgramPipeline(pipeline uint32) { + C.glowValidateProgramPipeline(gpValidateProgramPipeline, (C.GLuint)(pipeline)) +} +func VertexArrayAttribBinding(vaobj uint32, attribindex uint32, bindingindex uint32) { + C.glowVertexArrayAttribBinding(gpVertexArrayAttribBinding, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLuint)(bindingindex)) +} + +// specify the organization of vertex arrays +func VertexArrayAttribFormat(vaobj uint32, attribindex uint32, size int32, xtype uint32, normalized bool, relativeoffset uint32) { + C.glowVertexArrayAttribFormat(gpVertexArrayAttribFormat, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(relativeoffset)) +} +func VertexArrayAttribIFormat(vaobj uint32, attribindex uint32, size int32, xtype uint32, relativeoffset uint32) { + C.glowVertexArrayAttribIFormat(gpVertexArrayAttribIFormat, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset)) +} +func VertexArrayAttribLFormat(vaobj uint32, attribindex uint32, size int32, xtype uint32, relativeoffset uint32) { + C.glowVertexArrayAttribLFormat(gpVertexArrayAttribLFormat, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset)) +} + +// modify the rate at which generic vertex attributes advance +func VertexArrayBindingDivisor(vaobj uint32, bindingindex uint32, divisor uint32) { + C.glowVertexArrayBindingDivisor(gpVertexArrayBindingDivisor, (C.GLuint)(vaobj), (C.GLuint)(bindingindex), (C.GLuint)(divisor)) +} + +// configures element array buffer binding of a vertex array object +func VertexArrayElementBuffer(vaobj uint32, buffer uint32) { + C.glowVertexArrayElementBuffer(gpVertexArrayElementBuffer, (C.GLuint)(vaobj), (C.GLuint)(buffer)) +} + +// bind a buffer to a vertex buffer bind point +func VertexArrayVertexBuffer(vaobj uint32, bindingindex uint32, buffer uint32, offset int, stride int32) { + C.glowVertexArrayVertexBuffer(gpVertexArrayVertexBuffer, (C.GLuint)(vaobj), (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride)) +} + +// attach multiple buffer objects to a vertex array object +func VertexArrayVertexBuffers(vaobj uint32, first uint32, count int32, buffers *uint32, offsets *int, strides *int32) { + C.glowVertexArrayVertexBuffers(gpVertexArrayVertexBuffers, (C.GLuint)(vaobj), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizei)(unsafe.Pointer(strides))) +} +func VertexAttrib1d(index uint32, x float64) { + C.glowVertexAttrib1d(gpVertexAttrib1d, (C.GLuint)(index), (C.GLdouble)(x)) +} +func VertexAttrib1dv(index uint32, v *float64) { + C.glowVertexAttrib1dv(gpVertexAttrib1dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttrib1f(index uint32, x float32) { + C.glowVertexAttrib1f(gpVertexAttrib1f, (C.GLuint)(index), (C.GLfloat)(x)) +} +func VertexAttrib1fv(index uint32, v *float32) { + C.glowVertexAttrib1fv(gpVertexAttrib1fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v))) +} +func VertexAttrib1s(index uint32, x int16) { + C.glowVertexAttrib1s(gpVertexAttrib1s, (C.GLuint)(index), (C.GLshort)(x)) +} +func VertexAttrib1sv(index uint32, v *int16) { + C.glowVertexAttrib1sv(gpVertexAttrib1sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v))) +} +func VertexAttrib2d(index uint32, x float64, y float64) { + C.glowVertexAttrib2d(gpVertexAttrib2d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y)) +} +func VertexAttrib2dv(index uint32, v *float64) { + C.glowVertexAttrib2dv(gpVertexAttrib2dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttrib2f(index uint32, x float32, y float32) { + C.glowVertexAttrib2f(gpVertexAttrib2f, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y)) +} +func VertexAttrib2fv(index uint32, v *float32) { + C.glowVertexAttrib2fv(gpVertexAttrib2fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v))) +} +func VertexAttrib2s(index uint32, x int16, y int16) { + C.glowVertexAttrib2s(gpVertexAttrib2s, (C.GLuint)(index), (C.GLshort)(x), (C.GLshort)(y)) +} +func VertexAttrib2sv(index uint32, v *int16) { + C.glowVertexAttrib2sv(gpVertexAttrib2sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v))) +} +func VertexAttrib3d(index uint32, x float64, y float64, z float64) { + C.glowVertexAttrib3d(gpVertexAttrib3d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z)) +} +func VertexAttrib3dv(index uint32, v *float64) { + C.glowVertexAttrib3dv(gpVertexAttrib3dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttrib3f(index uint32, x float32, y float32, z float32) { + C.glowVertexAttrib3f(gpVertexAttrib3f, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z)) +} +func VertexAttrib3fv(index uint32, v *float32) { + C.glowVertexAttrib3fv(gpVertexAttrib3fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v))) +} +func VertexAttrib3s(index uint32, x int16, y int16, z int16) { + C.glowVertexAttrib3s(gpVertexAttrib3s, (C.GLuint)(index), (C.GLshort)(x), (C.GLshort)(y), (C.GLshort)(z)) +} +func VertexAttrib3sv(index uint32, v *int16) { + C.glowVertexAttrib3sv(gpVertexAttrib3sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v))) +} +func VertexAttrib4Nbv(index uint32, v *int8) { + C.glowVertexAttrib4Nbv(gpVertexAttrib4Nbv, (C.GLuint)(index), (*C.GLbyte)(unsafe.Pointer(v))) +} +func VertexAttrib4Niv(index uint32, v *int32) { + C.glowVertexAttrib4Niv(gpVertexAttrib4Niv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} +func VertexAttrib4Nsv(index uint32, v *int16) { + C.glowVertexAttrib4Nsv(gpVertexAttrib4Nsv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v))) +} +func VertexAttrib4Nub(index uint32, x uint8, y uint8, z uint8, w uint8) { + C.glowVertexAttrib4Nub(gpVertexAttrib4Nub, (C.GLuint)(index), (C.GLubyte)(x), (C.GLubyte)(y), (C.GLubyte)(z), (C.GLubyte)(w)) +} +func VertexAttrib4Nubv(index uint32, v *uint8) { + C.glowVertexAttrib4Nubv(gpVertexAttrib4Nubv, (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(v))) +} +func VertexAttrib4Nuiv(index uint32, v *uint32) { + C.glowVertexAttrib4Nuiv(gpVertexAttrib4Nuiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v))) +} +func VertexAttrib4Nusv(index uint32, v *uint16) { + C.glowVertexAttrib4Nusv(gpVertexAttrib4Nusv, (C.GLuint)(index), (*C.GLushort)(unsafe.Pointer(v))) +} +func VertexAttrib4bv(index uint32, v *int8) { + C.glowVertexAttrib4bv(gpVertexAttrib4bv, (C.GLuint)(index), (*C.GLbyte)(unsafe.Pointer(v))) +} +func VertexAttrib4d(index uint32, x float64, y float64, z float64, w float64) { + C.glowVertexAttrib4d(gpVertexAttrib4d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w)) +} +func VertexAttrib4dv(index uint32, v *float64) { + C.glowVertexAttrib4dv(gpVertexAttrib4dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttrib4f(index uint32, x float32, y float32, z float32, w float32) { + C.glowVertexAttrib4f(gpVertexAttrib4f, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z), (C.GLfloat)(w)) +} +func VertexAttrib4fv(index uint32, v *float32) { + C.glowVertexAttrib4fv(gpVertexAttrib4fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v))) +} +func VertexAttrib4iv(index uint32, v *int32) { + C.glowVertexAttrib4iv(gpVertexAttrib4iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} +func VertexAttrib4s(index uint32, x int16, y int16, z int16, w int16) { + C.glowVertexAttrib4s(gpVertexAttrib4s, (C.GLuint)(index), (C.GLshort)(x), (C.GLshort)(y), (C.GLshort)(z), (C.GLshort)(w)) +} +func VertexAttrib4sv(index uint32, v *int16) { + C.glowVertexAttrib4sv(gpVertexAttrib4sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v))) +} +func VertexAttrib4ubv(index uint32, v *uint8) { + C.glowVertexAttrib4ubv(gpVertexAttrib4ubv, (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(v))) +} +func VertexAttrib4uiv(index uint32, v *uint32) { + C.glowVertexAttrib4uiv(gpVertexAttrib4uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v))) +} +func VertexAttrib4usv(index uint32, v *uint16) { + C.glowVertexAttrib4usv(gpVertexAttrib4usv, (C.GLuint)(index), (*C.GLushort)(unsafe.Pointer(v))) +} + +// associate a vertex attribute and a vertex buffer binding for a vertex array object +func VertexAttribBinding(attribindex uint32, bindingindex uint32) { + C.glowVertexAttribBinding(gpVertexAttribBinding, (C.GLuint)(attribindex), (C.GLuint)(bindingindex)) +} + +// modify the rate at which generic vertex attributes advance during instanced rendering +func VertexAttribDivisor(index uint32, divisor uint32) { + C.glowVertexAttribDivisor(gpVertexAttribDivisor, (C.GLuint)(index), (C.GLuint)(divisor)) +} + +// specify the organization of vertex arrays +func VertexAttribFormat(attribindex uint32, size int32, xtype uint32, normalized bool, relativeoffset uint32) { + C.glowVertexAttribFormat(gpVertexAttribFormat, (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(relativeoffset)) +} +func VertexAttribI1i(index uint32, x int32) { + C.glowVertexAttribI1i(gpVertexAttribI1i, (C.GLuint)(index), (C.GLint)(x)) +} +func VertexAttribI1iv(index uint32, v *int32) { + C.glowVertexAttribI1iv(gpVertexAttribI1iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} +func VertexAttribI1ui(index uint32, x uint32) { + C.glowVertexAttribI1ui(gpVertexAttribI1ui, (C.GLuint)(index), (C.GLuint)(x)) +} +func VertexAttribI1uiv(index uint32, v *uint32) { + C.glowVertexAttribI1uiv(gpVertexAttribI1uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v))) +} +func VertexAttribI2i(index uint32, x int32, y int32) { + C.glowVertexAttribI2i(gpVertexAttribI2i, (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y)) +} +func VertexAttribI2iv(index uint32, v *int32) { + C.glowVertexAttribI2iv(gpVertexAttribI2iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} +func VertexAttribI2ui(index uint32, x uint32, y uint32) { + C.glowVertexAttribI2ui(gpVertexAttribI2ui, (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y)) +} +func VertexAttribI2uiv(index uint32, v *uint32) { + C.glowVertexAttribI2uiv(gpVertexAttribI2uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v))) +} +func VertexAttribI3i(index uint32, x int32, y int32, z int32) { + C.glowVertexAttribI3i(gpVertexAttribI3i, (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y), (C.GLint)(z)) +} +func VertexAttribI3iv(index uint32, v *int32) { + C.glowVertexAttribI3iv(gpVertexAttribI3iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} +func VertexAttribI3ui(index uint32, x uint32, y uint32, z uint32) { + C.glowVertexAttribI3ui(gpVertexAttribI3ui, (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y), (C.GLuint)(z)) +} +func VertexAttribI3uiv(index uint32, v *uint32) { + C.glowVertexAttribI3uiv(gpVertexAttribI3uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v))) +} +func VertexAttribI4bv(index uint32, v *int8) { + C.glowVertexAttribI4bv(gpVertexAttribI4bv, (C.GLuint)(index), (*C.GLbyte)(unsafe.Pointer(v))) +} +func VertexAttribI4i(index uint32, x int32, y int32, z int32, w int32) { + C.glowVertexAttribI4i(gpVertexAttribI4i, (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y), (C.GLint)(z), (C.GLint)(w)) +} +func VertexAttribI4iv(index uint32, v *int32) { + C.glowVertexAttribI4iv(gpVertexAttribI4iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v))) +} +func VertexAttribI4sv(index uint32, v *int16) { + C.glowVertexAttribI4sv(gpVertexAttribI4sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v))) +} +func VertexAttribI4ubv(index uint32, v *uint8) { + C.glowVertexAttribI4ubv(gpVertexAttribI4ubv, (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(v))) +} +func VertexAttribI4ui(index uint32, x uint32, y uint32, z uint32, w uint32) { + C.glowVertexAttribI4ui(gpVertexAttribI4ui, (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y), (C.GLuint)(z), (C.GLuint)(w)) +} +func VertexAttribI4uiv(index uint32, v *uint32) { + C.glowVertexAttribI4uiv(gpVertexAttribI4uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v))) +} +func VertexAttribI4usv(index uint32, v *uint16) { + C.glowVertexAttribI4usv(gpVertexAttribI4usv, (C.GLuint)(index), (*C.GLushort)(unsafe.Pointer(v))) +} +func VertexAttribIFormat(attribindex uint32, size int32, xtype uint32, relativeoffset uint32) { + C.glowVertexAttribIFormat(gpVertexAttribIFormat, (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset)) +} +func VertexAttribIPointer(index uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer) { + C.glowVertexAttribIPointer(gpVertexAttribIPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer) +} +func VertexAttribL1d(index uint32, x float64) { + C.glowVertexAttribL1d(gpVertexAttribL1d, (C.GLuint)(index), (C.GLdouble)(x)) +} +func VertexAttribL1dv(index uint32, v *float64) { + C.glowVertexAttribL1dv(gpVertexAttribL1dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttribL1ui64ARB(index uint32, x uint64) { + C.glowVertexAttribL1ui64ARB(gpVertexAttribL1ui64ARB, (C.GLuint)(index), (C.GLuint64EXT)(x)) +} +func VertexAttribL1ui64vARB(index uint32, v *uint64) { + C.glowVertexAttribL1ui64vARB(gpVertexAttribL1ui64vARB, (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(v))) +} +func VertexAttribL2d(index uint32, x float64, y float64) { + C.glowVertexAttribL2d(gpVertexAttribL2d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y)) +} +func VertexAttribL2dv(index uint32, v *float64) { + C.glowVertexAttribL2dv(gpVertexAttribL2dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttribL3d(index uint32, x float64, y float64, z float64) { + C.glowVertexAttribL3d(gpVertexAttribL3d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z)) +} +func VertexAttribL3dv(index uint32, v *float64) { + C.glowVertexAttribL3dv(gpVertexAttribL3dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttribL4d(index uint32, x float64, y float64, z float64, w float64) { + C.glowVertexAttribL4d(gpVertexAttribL4d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w)) +} +func VertexAttribL4dv(index uint32, v *float64) { + C.glowVertexAttribL4dv(gpVertexAttribL4dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v))) +} +func VertexAttribLFormat(attribindex uint32, size int32, xtype uint32, relativeoffset uint32) { + C.glowVertexAttribLFormat(gpVertexAttribLFormat, (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset)) +} +func VertexAttribLPointer(index uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer) { + C.glowVertexAttribLPointer(gpVertexAttribLPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer) +} +func VertexAttribP1ui(index uint32, xtype uint32, normalized bool, value uint32) { + C.glowVertexAttribP1ui(gpVertexAttribP1ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value)) +} +func VertexAttribP1uiv(index uint32, xtype uint32, normalized bool, value *uint32) { + C.glowVertexAttribP1uiv(gpVertexAttribP1uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value))) +} +func VertexAttribP2ui(index uint32, xtype uint32, normalized bool, value uint32) { + C.glowVertexAttribP2ui(gpVertexAttribP2ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value)) +} +func VertexAttribP2uiv(index uint32, xtype uint32, normalized bool, value *uint32) { + C.glowVertexAttribP2uiv(gpVertexAttribP2uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value))) +} +func VertexAttribP3ui(index uint32, xtype uint32, normalized bool, value uint32) { + C.glowVertexAttribP3ui(gpVertexAttribP3ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value)) +} +func VertexAttribP3uiv(index uint32, xtype uint32, normalized bool, value *uint32) { + C.glowVertexAttribP3uiv(gpVertexAttribP3uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value))) +} +func VertexAttribP4ui(index uint32, xtype uint32, normalized bool, value uint32) { + C.glowVertexAttribP4ui(gpVertexAttribP4ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value)) +} +func VertexAttribP4uiv(index uint32, xtype uint32, normalized bool, value *uint32) { + C.glowVertexAttribP4uiv(gpVertexAttribP4uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value))) +} + +// define an array of generic vertex attribute data +func VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer unsafe.Pointer) { + C.glowVertexAttribPointer(gpVertexAttribPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), pointer) +} + +// modify the rate at which generic vertex attributes advance +func VertexBindingDivisor(bindingindex uint32, divisor uint32) { + C.glowVertexBindingDivisor(gpVertexBindingDivisor, (C.GLuint)(bindingindex), (C.GLuint)(divisor)) +} + +// set the viewport +func Viewport(x int32, y int32, width int32, height int32) { + C.glowViewport(gpViewport, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height)) +} +func ViewportArrayv(first uint32, count int32, v *float32) { + C.glowViewportArrayv(gpViewportArrayv, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(v))) +} +func ViewportIndexedf(index uint32, x float32, y float32, w float32, h float32) { + C.glowViewportIndexedf(gpViewportIndexedf, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(w), (C.GLfloat)(h)) +} +func ViewportIndexedfv(index uint32, v *float32) { + C.glowViewportIndexedfv(gpViewportIndexedfv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v))) +} + +// instruct the GL server to block until the specified sync object becomes signaled +func WaitSync(sync unsafe.Pointer, flags uint32, timeout uint64) { + C.glowWaitSync(gpWaitSync, (C.GLsync)(sync), (C.GLbitfield)(flags), (C.GLuint64)(timeout)) +} + +// Init initializes the OpenGL bindings by loading the function pointers (for +// each OpenGL function) from the active OpenGL context. +// +// It must be called under the presence of an active OpenGL context, e.g., +// always after calling window.MakeContextCurrent() and always before calling +// any OpenGL functions exported by this package. +// +// On Windows, Init loads pointers that are context-specific (and hence you +// must re-init if switching between OpenGL contexts, although not calling Init +// again after switching between OpenGL contexts may work if the contexts belong +// to the same graphics driver/device). +// +// On macOS and the other POSIX systems, the behavior is different, but code +// written compatible with the Windows behavior is compatible with macOS and the +// other POSIX systems. That is, always Init under an active OpenGL context, and +// always re-init after switching graphics contexts. +// +// For information about caveats of Init, you should read the "Platform Specific +// Function Retrieval" section of https://www.opengl.org/wiki/Load_OpenGL_Functions. +func Init() error { + return InitWithProcAddrFunc(getProcAddress) +} + +// InitWithProcAddrFunc intializes the package using the specified OpenGL +// function pointer loading function. For more cases Init should be used +// instead. +func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error { + gpActiveShaderProgram = (C.GPACTIVESHADERPROGRAM)(getProcAddr("glActiveShaderProgram")) + gpActiveTexture = (C.GPACTIVETEXTURE)(getProcAddr("glActiveTexture")) + if gpActiveTexture == nil { + return errors.New("glActiveTexture") + } + gpAttachShader = (C.GPATTACHSHADER)(getProcAddr("glAttachShader")) + if gpAttachShader == nil { + return errors.New("glAttachShader") + } + gpBeginConditionalRender = (C.GPBEGINCONDITIONALRENDER)(getProcAddr("glBeginConditionalRender")) + if gpBeginConditionalRender == nil { + return errors.New("glBeginConditionalRender") + } + gpBeginQuery = (C.GPBEGINQUERY)(getProcAddr("glBeginQuery")) + if gpBeginQuery == nil { + return errors.New("glBeginQuery") + } + gpBeginQueryIndexed = (C.GPBEGINQUERYINDEXED)(getProcAddr("glBeginQueryIndexed")) + gpBeginTransformFeedback = (C.GPBEGINTRANSFORMFEEDBACK)(getProcAddr("glBeginTransformFeedback")) + if gpBeginTransformFeedback == nil { + return errors.New("glBeginTransformFeedback") + } + gpBindAttribLocation = (C.GPBINDATTRIBLOCATION)(getProcAddr("glBindAttribLocation")) + if gpBindAttribLocation == nil { + return errors.New("glBindAttribLocation") + } + gpBindBuffer = (C.GPBINDBUFFER)(getProcAddr("glBindBuffer")) + if gpBindBuffer == nil { + return errors.New("glBindBuffer") + } + gpBindBufferBase = (C.GPBINDBUFFERBASE)(getProcAddr("glBindBufferBase")) + if gpBindBufferBase == nil { + return errors.New("glBindBufferBase") + } + gpBindBufferRange = (C.GPBINDBUFFERRANGE)(getProcAddr("glBindBufferRange")) + if gpBindBufferRange == nil { + return errors.New("glBindBufferRange") + } + gpBindBuffersBase = (C.GPBINDBUFFERSBASE)(getProcAddr("glBindBuffersBase")) + gpBindBuffersRange = (C.GPBINDBUFFERSRANGE)(getProcAddr("glBindBuffersRange")) + gpBindFragDataLocation = (C.GPBINDFRAGDATALOCATION)(getProcAddr("glBindFragDataLocation")) + if gpBindFragDataLocation == nil { + return errors.New("glBindFragDataLocation") + } + gpBindFragDataLocationIndexed = (C.GPBINDFRAGDATALOCATIONINDEXED)(getProcAddr("glBindFragDataLocationIndexed")) + if gpBindFragDataLocationIndexed == nil { + return errors.New("glBindFragDataLocationIndexed") + } + gpBindFramebuffer = (C.GPBINDFRAMEBUFFER)(getProcAddr("glBindFramebuffer")) + if gpBindFramebuffer == nil { + return errors.New("glBindFramebuffer") + } + gpBindImageTexture = (C.GPBINDIMAGETEXTURE)(getProcAddr("glBindImageTexture")) + gpBindImageTextures = (C.GPBINDIMAGETEXTURES)(getProcAddr("glBindImageTextures")) + gpBindProgramPipeline = (C.GPBINDPROGRAMPIPELINE)(getProcAddr("glBindProgramPipeline")) + gpBindRenderbuffer = (C.GPBINDRENDERBUFFER)(getProcAddr("glBindRenderbuffer")) + if gpBindRenderbuffer == nil { + return errors.New("glBindRenderbuffer") + } + gpBindSampler = (C.GPBINDSAMPLER)(getProcAddr("glBindSampler")) + if gpBindSampler == nil { + return errors.New("glBindSampler") + } + gpBindSamplers = (C.GPBINDSAMPLERS)(getProcAddr("glBindSamplers")) + gpBindTexture = (C.GPBINDTEXTURE)(getProcAddr("glBindTexture")) + if gpBindTexture == nil { + return errors.New("glBindTexture") + } + gpBindTextureUnit = (C.GPBINDTEXTUREUNIT)(getProcAddr("glBindTextureUnit")) + gpBindTextures = (C.GPBINDTEXTURES)(getProcAddr("glBindTextures")) + gpBindTransformFeedback = (C.GPBINDTRANSFORMFEEDBACK)(getProcAddr("glBindTransformFeedback")) + gpBindVertexArray = (C.GPBINDVERTEXARRAY)(getProcAddr("glBindVertexArray")) + if gpBindVertexArray == nil { + return errors.New("glBindVertexArray") + } + gpBindVertexBuffer = (C.GPBINDVERTEXBUFFER)(getProcAddr("glBindVertexBuffer")) + gpBindVertexBuffers = (C.GPBINDVERTEXBUFFERS)(getProcAddr("glBindVertexBuffers")) + gpBlendColor = (C.GPBLENDCOLOR)(getProcAddr("glBlendColor")) + if gpBlendColor == nil { + return errors.New("glBlendColor") + } + gpBlendEquation = (C.GPBLENDEQUATION)(getProcAddr("glBlendEquation")) + if gpBlendEquation == nil { + return errors.New("glBlendEquation") + } + gpBlendEquationSeparate = (C.GPBLENDEQUATIONSEPARATE)(getProcAddr("glBlendEquationSeparate")) + if gpBlendEquationSeparate == nil { + return errors.New("glBlendEquationSeparate") + } + gpBlendEquationSeparateiARB = (C.GPBLENDEQUATIONSEPARATEIARB)(getProcAddr("glBlendEquationSeparateiARB")) + gpBlendEquationiARB = (C.GPBLENDEQUATIONIARB)(getProcAddr("glBlendEquationiARB")) + gpBlendFunc = (C.GPBLENDFUNC)(getProcAddr("glBlendFunc")) + if gpBlendFunc == nil { + return errors.New("glBlendFunc") + } + gpBlendFuncSeparate = (C.GPBLENDFUNCSEPARATE)(getProcAddr("glBlendFuncSeparate")) + if gpBlendFuncSeparate == nil { + return errors.New("glBlendFuncSeparate") + } + gpBlendFuncSeparateiARB = (C.GPBLENDFUNCSEPARATEIARB)(getProcAddr("glBlendFuncSeparateiARB")) + gpBlendFunciARB = (C.GPBLENDFUNCIARB)(getProcAddr("glBlendFunciARB")) + gpBlitFramebuffer = (C.GPBLITFRAMEBUFFER)(getProcAddr("glBlitFramebuffer")) + if gpBlitFramebuffer == nil { + return errors.New("glBlitFramebuffer") + } + gpBlitNamedFramebuffer = (C.GPBLITNAMEDFRAMEBUFFER)(getProcAddr("glBlitNamedFramebuffer")) + gpBufferData = (C.GPBUFFERDATA)(getProcAddr("glBufferData")) + if gpBufferData == nil { + return errors.New("glBufferData") + } + gpBufferPageCommitmentARB = (C.GPBUFFERPAGECOMMITMENTARB)(getProcAddr("glBufferPageCommitmentARB")) + gpBufferStorage = (C.GPBUFFERSTORAGE)(getProcAddr("glBufferStorage")) + gpBufferSubData = (C.GPBUFFERSUBDATA)(getProcAddr("glBufferSubData")) + if gpBufferSubData == nil { + return errors.New("glBufferSubData") + } + gpCheckFramebufferStatus = (C.GPCHECKFRAMEBUFFERSTATUS)(getProcAddr("glCheckFramebufferStatus")) + if gpCheckFramebufferStatus == nil { + return errors.New("glCheckFramebufferStatus") + } + gpCheckNamedFramebufferStatus = (C.GPCHECKNAMEDFRAMEBUFFERSTATUS)(getProcAddr("glCheckNamedFramebufferStatus")) + gpClampColor = (C.GPCLAMPCOLOR)(getProcAddr("glClampColor")) + if gpClampColor == nil { + return errors.New("glClampColor") + } + gpClear = (C.GPCLEAR)(getProcAddr("glClear")) + if gpClear == nil { + return errors.New("glClear") + } + gpClearBufferData = (C.GPCLEARBUFFERDATA)(getProcAddr("glClearBufferData")) + gpClearBufferSubData = (C.GPCLEARBUFFERSUBDATA)(getProcAddr("glClearBufferSubData")) + gpClearBufferfi = (C.GPCLEARBUFFERFI)(getProcAddr("glClearBufferfi")) + if gpClearBufferfi == nil { + return errors.New("glClearBufferfi") + } + gpClearBufferfv = (C.GPCLEARBUFFERFV)(getProcAddr("glClearBufferfv")) + if gpClearBufferfv == nil { + return errors.New("glClearBufferfv") + } + gpClearBufferiv = (C.GPCLEARBUFFERIV)(getProcAddr("glClearBufferiv")) + if gpClearBufferiv == nil { + return errors.New("glClearBufferiv") + } + gpClearBufferuiv = (C.GPCLEARBUFFERUIV)(getProcAddr("glClearBufferuiv")) + if gpClearBufferuiv == nil { + return errors.New("glClearBufferuiv") + } + gpClearColor = (C.GPCLEARCOLOR)(getProcAddr("glClearColor")) + if gpClearColor == nil { + return errors.New("glClearColor") + } + gpClearDepth = (C.GPCLEARDEPTH)(getProcAddr("glClearDepth")) + if gpClearDepth == nil { + return errors.New("glClearDepth") + } + gpClearDepthf = (C.GPCLEARDEPTHF)(getProcAddr("glClearDepthf")) + gpClearNamedBufferData = (C.GPCLEARNAMEDBUFFERDATA)(getProcAddr("glClearNamedBufferData")) + gpClearNamedBufferSubData = (C.GPCLEARNAMEDBUFFERSUBDATA)(getProcAddr("glClearNamedBufferSubData")) + gpClearNamedFramebufferfi = (C.GPCLEARNAMEDFRAMEBUFFERFI)(getProcAddr("glClearNamedFramebufferfi")) + gpClearNamedFramebufferfv = (C.GPCLEARNAMEDFRAMEBUFFERFV)(getProcAddr("glClearNamedFramebufferfv")) + gpClearNamedFramebufferiv = (C.GPCLEARNAMEDFRAMEBUFFERIV)(getProcAddr("glClearNamedFramebufferiv")) + gpClearNamedFramebufferuiv = (C.GPCLEARNAMEDFRAMEBUFFERUIV)(getProcAddr("glClearNamedFramebufferuiv")) + gpClearStencil = (C.GPCLEARSTENCIL)(getProcAddr("glClearStencil")) + if gpClearStencil == nil { + return errors.New("glClearStencil") + } + gpClearTexImage = (C.GPCLEARTEXIMAGE)(getProcAddr("glClearTexImage")) + gpClearTexSubImage = (C.GPCLEARTEXSUBIMAGE)(getProcAddr("glClearTexSubImage")) + gpClientWaitSync = (C.GPCLIENTWAITSYNC)(getProcAddr("glClientWaitSync")) + if gpClientWaitSync == nil { + return errors.New("glClientWaitSync") + } + gpClipControl = (C.GPCLIPCONTROL)(getProcAddr("glClipControl")) + gpColorMask = (C.GPCOLORMASK)(getProcAddr("glColorMask")) + if gpColorMask == nil { + return errors.New("glColorMask") + } + gpColorMaski = (C.GPCOLORMASKI)(getProcAddr("glColorMaski")) + if gpColorMaski == nil { + return errors.New("glColorMaski") + } + gpCompileShader = (C.GPCOMPILESHADER)(getProcAddr("glCompileShader")) + if gpCompileShader == nil { + return errors.New("glCompileShader") + } + gpCompileShaderIncludeARB = (C.GPCOMPILESHADERINCLUDEARB)(getProcAddr("glCompileShaderIncludeARB")) + gpCompressedTexImage1D = (C.GPCOMPRESSEDTEXIMAGE1D)(getProcAddr("glCompressedTexImage1D")) + if gpCompressedTexImage1D == nil { + return errors.New("glCompressedTexImage1D") + } + gpCompressedTexImage2D = (C.GPCOMPRESSEDTEXIMAGE2D)(getProcAddr("glCompressedTexImage2D")) + if gpCompressedTexImage2D == nil { + return errors.New("glCompressedTexImage2D") + } + gpCompressedTexImage3D = (C.GPCOMPRESSEDTEXIMAGE3D)(getProcAddr("glCompressedTexImage3D")) + if gpCompressedTexImage3D == nil { + return errors.New("glCompressedTexImage3D") + } + gpCompressedTexSubImage1D = (C.GPCOMPRESSEDTEXSUBIMAGE1D)(getProcAddr("glCompressedTexSubImage1D")) + if gpCompressedTexSubImage1D == nil { + return errors.New("glCompressedTexSubImage1D") + } + gpCompressedTexSubImage2D = (C.GPCOMPRESSEDTEXSUBIMAGE2D)(getProcAddr("glCompressedTexSubImage2D")) + if gpCompressedTexSubImage2D == nil { + return errors.New("glCompressedTexSubImage2D") + } + gpCompressedTexSubImage3D = (C.GPCOMPRESSEDTEXSUBIMAGE3D)(getProcAddr("glCompressedTexSubImage3D")) + if gpCompressedTexSubImage3D == nil { + return errors.New("glCompressedTexSubImage3D") + } + gpCompressedTextureSubImage1D = (C.GPCOMPRESSEDTEXTURESUBIMAGE1D)(getProcAddr("glCompressedTextureSubImage1D")) + gpCompressedTextureSubImage2D = (C.GPCOMPRESSEDTEXTURESUBIMAGE2D)(getProcAddr("glCompressedTextureSubImage2D")) + gpCompressedTextureSubImage3D = (C.GPCOMPRESSEDTEXTURESUBIMAGE3D)(getProcAddr("glCompressedTextureSubImage3D")) + gpCopyBufferSubData = (C.GPCOPYBUFFERSUBDATA)(getProcAddr("glCopyBufferSubData")) + if gpCopyBufferSubData == nil { + return errors.New("glCopyBufferSubData") + } + gpCopyImageSubData = (C.GPCOPYIMAGESUBDATA)(getProcAddr("glCopyImageSubData")) + gpCopyNamedBufferSubData = (C.GPCOPYNAMEDBUFFERSUBDATA)(getProcAddr("glCopyNamedBufferSubData")) + gpCopyTexImage1D = (C.GPCOPYTEXIMAGE1D)(getProcAddr("glCopyTexImage1D")) + if gpCopyTexImage1D == nil { + return errors.New("glCopyTexImage1D") + } + gpCopyTexImage2D = (C.GPCOPYTEXIMAGE2D)(getProcAddr("glCopyTexImage2D")) + if gpCopyTexImage2D == nil { + return errors.New("glCopyTexImage2D") + } + gpCopyTexSubImage1D = (C.GPCOPYTEXSUBIMAGE1D)(getProcAddr("glCopyTexSubImage1D")) + if gpCopyTexSubImage1D == nil { + return errors.New("glCopyTexSubImage1D") + } + gpCopyTexSubImage2D = (C.GPCOPYTEXSUBIMAGE2D)(getProcAddr("glCopyTexSubImage2D")) + if gpCopyTexSubImage2D == nil { + return errors.New("glCopyTexSubImage2D") + } + gpCopyTexSubImage3D = (C.GPCOPYTEXSUBIMAGE3D)(getProcAddr("glCopyTexSubImage3D")) + if gpCopyTexSubImage3D == nil { + return errors.New("glCopyTexSubImage3D") + } + gpCopyTextureSubImage1D = (C.GPCOPYTEXTURESUBIMAGE1D)(getProcAddr("glCopyTextureSubImage1D")) + gpCopyTextureSubImage2D = (C.GPCOPYTEXTURESUBIMAGE2D)(getProcAddr("glCopyTextureSubImage2D")) + gpCopyTextureSubImage3D = (C.GPCOPYTEXTURESUBIMAGE3D)(getProcAddr("glCopyTextureSubImage3D")) + gpCreateBuffers = (C.GPCREATEBUFFERS)(getProcAddr("glCreateBuffers")) + gpCreateFramebuffers = (C.GPCREATEFRAMEBUFFERS)(getProcAddr("glCreateFramebuffers")) + gpCreateProgram = (C.GPCREATEPROGRAM)(getProcAddr("glCreateProgram")) + if gpCreateProgram == nil { + return errors.New("glCreateProgram") + } + gpCreateProgramPipelines = (C.GPCREATEPROGRAMPIPELINES)(getProcAddr("glCreateProgramPipelines")) + gpCreateQueries = (C.GPCREATEQUERIES)(getProcAddr("glCreateQueries")) + gpCreateRenderbuffers = (C.GPCREATERENDERBUFFERS)(getProcAddr("glCreateRenderbuffers")) + gpCreateSamplers = (C.GPCREATESAMPLERS)(getProcAddr("glCreateSamplers")) + gpCreateShader = (C.GPCREATESHADER)(getProcAddr("glCreateShader")) + if gpCreateShader == nil { + return errors.New("glCreateShader") + } + gpCreateShaderProgramv = (C.GPCREATESHADERPROGRAMV)(getProcAddr("glCreateShaderProgramv")) + gpCreateSyncFromCLeventARB = (C.GPCREATESYNCFROMCLEVENTARB)(getProcAddr("glCreateSyncFromCLeventARB")) + gpCreateTextures = (C.GPCREATETEXTURES)(getProcAddr("glCreateTextures")) + gpCreateTransformFeedbacks = (C.GPCREATETRANSFORMFEEDBACKS)(getProcAddr("glCreateTransformFeedbacks")) + gpCreateVertexArrays = (C.GPCREATEVERTEXARRAYS)(getProcAddr("glCreateVertexArrays")) + gpCullFace = (C.GPCULLFACE)(getProcAddr("glCullFace")) + if gpCullFace == nil { + return errors.New("glCullFace") + } + gpDebugMessageCallback = (C.GPDEBUGMESSAGECALLBACK)(getProcAddr("glDebugMessageCallback")) + gpDebugMessageCallbackARB = (C.GPDEBUGMESSAGECALLBACKARB)(getProcAddr("glDebugMessageCallbackARB")) + gpDebugMessageCallbackKHR = (C.GPDEBUGMESSAGECALLBACKKHR)(getProcAddr("glDebugMessageCallbackKHR")) + gpDebugMessageControl = (C.GPDEBUGMESSAGECONTROL)(getProcAddr("glDebugMessageControl")) + gpDebugMessageControlARB = (C.GPDEBUGMESSAGECONTROLARB)(getProcAddr("glDebugMessageControlARB")) + gpDebugMessageControlKHR = (C.GPDEBUGMESSAGECONTROLKHR)(getProcAddr("glDebugMessageControlKHR")) + gpDebugMessageInsert = (C.GPDEBUGMESSAGEINSERT)(getProcAddr("glDebugMessageInsert")) + gpDebugMessageInsertARB = (C.GPDEBUGMESSAGEINSERTARB)(getProcAddr("glDebugMessageInsertARB")) + gpDebugMessageInsertKHR = (C.GPDEBUGMESSAGEINSERTKHR)(getProcAddr("glDebugMessageInsertKHR")) + gpDeleteBuffers = (C.GPDELETEBUFFERS)(getProcAddr("glDeleteBuffers")) + if gpDeleteBuffers == nil { + return errors.New("glDeleteBuffers") + } + gpDeleteFramebuffers = (C.GPDELETEFRAMEBUFFERS)(getProcAddr("glDeleteFramebuffers")) + if gpDeleteFramebuffers == nil { + return errors.New("glDeleteFramebuffers") + } + gpDeleteNamedStringARB = (C.GPDELETENAMEDSTRINGARB)(getProcAddr("glDeleteNamedStringARB")) + gpDeleteProgram = (C.GPDELETEPROGRAM)(getProcAddr("glDeleteProgram")) + if gpDeleteProgram == nil { + return errors.New("glDeleteProgram") + } + gpDeleteProgramPipelines = (C.GPDELETEPROGRAMPIPELINES)(getProcAddr("glDeleteProgramPipelines")) + gpDeleteQueries = (C.GPDELETEQUERIES)(getProcAddr("glDeleteQueries")) + if gpDeleteQueries == nil { + return errors.New("glDeleteQueries") + } + gpDeleteRenderbuffers = (C.GPDELETERENDERBUFFERS)(getProcAddr("glDeleteRenderbuffers")) + if gpDeleteRenderbuffers == nil { + return errors.New("glDeleteRenderbuffers") + } + gpDeleteSamplers = (C.GPDELETESAMPLERS)(getProcAddr("glDeleteSamplers")) + if gpDeleteSamplers == nil { + return errors.New("glDeleteSamplers") + } + gpDeleteShader = (C.GPDELETESHADER)(getProcAddr("glDeleteShader")) + if gpDeleteShader == nil { + return errors.New("glDeleteShader") + } + gpDeleteSync = (C.GPDELETESYNC)(getProcAddr("glDeleteSync")) + if gpDeleteSync == nil { + return errors.New("glDeleteSync") + } + gpDeleteTextures = (C.GPDELETETEXTURES)(getProcAddr("glDeleteTextures")) + if gpDeleteTextures == nil { + return errors.New("glDeleteTextures") + } + gpDeleteTransformFeedbacks = (C.GPDELETETRANSFORMFEEDBACKS)(getProcAddr("glDeleteTransformFeedbacks")) + gpDeleteVertexArrays = (C.GPDELETEVERTEXARRAYS)(getProcAddr("glDeleteVertexArrays")) + if gpDeleteVertexArrays == nil { + return errors.New("glDeleteVertexArrays") + } + gpDepthFunc = (C.GPDEPTHFUNC)(getProcAddr("glDepthFunc")) + if gpDepthFunc == nil { + return errors.New("glDepthFunc") + } + gpDepthMask = (C.GPDEPTHMASK)(getProcAddr("glDepthMask")) + if gpDepthMask == nil { + return errors.New("glDepthMask") + } + gpDepthRange = (C.GPDEPTHRANGE)(getProcAddr("glDepthRange")) + if gpDepthRange == nil { + return errors.New("glDepthRange") + } + gpDepthRangeArrayv = (C.GPDEPTHRANGEARRAYV)(getProcAddr("glDepthRangeArrayv")) + gpDepthRangeIndexed = (C.GPDEPTHRANGEINDEXED)(getProcAddr("glDepthRangeIndexed")) + gpDepthRangef = (C.GPDEPTHRANGEF)(getProcAddr("glDepthRangef")) + gpDetachShader = (C.GPDETACHSHADER)(getProcAddr("glDetachShader")) + if gpDetachShader == nil { + return errors.New("glDetachShader") + } + gpDisable = (C.GPDISABLE)(getProcAddr("glDisable")) + if gpDisable == nil { + return errors.New("glDisable") + } + gpDisableVertexArrayAttrib = (C.GPDISABLEVERTEXARRAYATTRIB)(getProcAddr("glDisableVertexArrayAttrib")) + gpDisableVertexAttribArray = (C.GPDISABLEVERTEXATTRIBARRAY)(getProcAddr("glDisableVertexAttribArray")) + if gpDisableVertexAttribArray == nil { + return errors.New("glDisableVertexAttribArray") + } + gpDisablei = (C.GPDISABLEI)(getProcAddr("glDisablei")) + if gpDisablei == nil { + return errors.New("glDisablei") + } + gpDispatchCompute = (C.GPDISPATCHCOMPUTE)(getProcAddr("glDispatchCompute")) + gpDispatchComputeGroupSizeARB = (C.GPDISPATCHCOMPUTEGROUPSIZEARB)(getProcAddr("glDispatchComputeGroupSizeARB")) + gpDispatchComputeIndirect = (C.GPDISPATCHCOMPUTEINDIRECT)(getProcAddr("glDispatchComputeIndirect")) + gpDrawArrays = (C.GPDRAWARRAYS)(getProcAddr("glDrawArrays")) + if gpDrawArrays == nil { + return errors.New("glDrawArrays") + } + gpDrawArraysIndirect = (C.GPDRAWARRAYSINDIRECT)(getProcAddr("glDrawArraysIndirect")) + gpDrawArraysInstanced = (C.GPDRAWARRAYSINSTANCED)(getProcAddr("glDrawArraysInstanced")) + if gpDrawArraysInstanced == nil { + return errors.New("glDrawArraysInstanced") + } + gpDrawArraysInstancedBaseInstance = (C.GPDRAWARRAYSINSTANCEDBASEINSTANCE)(getProcAddr("glDrawArraysInstancedBaseInstance")) + gpDrawBuffer = (C.GPDRAWBUFFER)(getProcAddr("glDrawBuffer")) + if gpDrawBuffer == nil { + return errors.New("glDrawBuffer") + } + gpDrawBuffers = (C.GPDRAWBUFFERS)(getProcAddr("glDrawBuffers")) + if gpDrawBuffers == nil { + return errors.New("glDrawBuffers") + } + gpDrawElements = (C.GPDRAWELEMENTS)(getProcAddr("glDrawElements")) + if gpDrawElements == nil { + return errors.New("glDrawElements") + } + gpDrawElementsBaseVertex = (C.GPDRAWELEMENTSBASEVERTEX)(getProcAddr("glDrawElementsBaseVertex")) + if gpDrawElementsBaseVertex == nil { + return errors.New("glDrawElementsBaseVertex") + } + gpDrawElementsIndirect = (C.GPDRAWELEMENTSINDIRECT)(getProcAddr("glDrawElementsIndirect")) + gpDrawElementsInstanced = (C.GPDRAWELEMENTSINSTANCED)(getProcAddr("glDrawElementsInstanced")) + if gpDrawElementsInstanced == nil { + return errors.New("glDrawElementsInstanced") + } + gpDrawElementsInstancedBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEINSTANCE)(getProcAddr("glDrawElementsInstancedBaseInstance")) + gpDrawElementsInstancedBaseVertex = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEX)(getProcAddr("glDrawElementsInstancedBaseVertex")) + if gpDrawElementsInstancedBaseVertex == nil { + return errors.New("glDrawElementsInstancedBaseVertex") + } + gpDrawElementsInstancedBaseVertexBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(getProcAddr("glDrawElementsInstancedBaseVertexBaseInstance")) + gpDrawRangeElements = (C.GPDRAWRANGEELEMENTS)(getProcAddr("glDrawRangeElements")) + if gpDrawRangeElements == nil { + return errors.New("glDrawRangeElements") + } + gpDrawRangeElementsBaseVertex = (C.GPDRAWRANGEELEMENTSBASEVERTEX)(getProcAddr("glDrawRangeElementsBaseVertex")) + if gpDrawRangeElementsBaseVertex == nil { + return errors.New("glDrawRangeElementsBaseVertex") + } + gpDrawTransformFeedback = (C.GPDRAWTRANSFORMFEEDBACK)(getProcAddr("glDrawTransformFeedback")) + gpDrawTransformFeedbackInstanced = (C.GPDRAWTRANSFORMFEEDBACKINSTANCED)(getProcAddr("glDrawTransformFeedbackInstanced")) + gpDrawTransformFeedbackStream = (C.GPDRAWTRANSFORMFEEDBACKSTREAM)(getProcAddr("glDrawTransformFeedbackStream")) + gpDrawTransformFeedbackStreamInstanced = (C.GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(getProcAddr("glDrawTransformFeedbackStreamInstanced")) + gpEnable = (C.GPENABLE)(getProcAddr("glEnable")) + if gpEnable == nil { + return errors.New("glEnable") + } + gpEnableVertexArrayAttrib = (C.GPENABLEVERTEXARRAYATTRIB)(getProcAddr("glEnableVertexArrayAttrib")) + gpEnableVertexAttribArray = (C.GPENABLEVERTEXATTRIBARRAY)(getProcAddr("glEnableVertexAttribArray")) + if gpEnableVertexAttribArray == nil { + return errors.New("glEnableVertexAttribArray") + } + gpEnablei = (C.GPENABLEI)(getProcAddr("glEnablei")) + if gpEnablei == nil { + return errors.New("glEnablei") + } + gpEndConditionalRender = (C.GPENDCONDITIONALRENDER)(getProcAddr("glEndConditionalRender")) + if gpEndConditionalRender == nil { + return errors.New("glEndConditionalRender") + } + gpEndQuery = (C.GPENDQUERY)(getProcAddr("glEndQuery")) + if gpEndQuery == nil { + return errors.New("glEndQuery") + } + gpEndQueryIndexed = (C.GPENDQUERYINDEXED)(getProcAddr("glEndQueryIndexed")) + gpEndTransformFeedback = (C.GPENDTRANSFORMFEEDBACK)(getProcAddr("glEndTransformFeedback")) + if gpEndTransformFeedback == nil { + return errors.New("glEndTransformFeedback") + } + gpFenceSync = (C.GPFENCESYNC)(getProcAddr("glFenceSync")) + if gpFenceSync == nil { + return errors.New("glFenceSync") + } + gpFinish = (C.GPFINISH)(getProcAddr("glFinish")) + if gpFinish == nil { + return errors.New("glFinish") + } + gpFlush = (C.GPFLUSH)(getProcAddr("glFlush")) + if gpFlush == nil { + return errors.New("glFlush") + } + gpFlushMappedBufferRange = (C.GPFLUSHMAPPEDBUFFERRANGE)(getProcAddr("glFlushMappedBufferRange")) + if gpFlushMappedBufferRange == nil { + return errors.New("glFlushMappedBufferRange") + } + gpFlushMappedNamedBufferRange = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGE)(getProcAddr("glFlushMappedNamedBufferRange")) + gpFramebufferParameteri = (C.GPFRAMEBUFFERPARAMETERI)(getProcAddr("glFramebufferParameteri")) + gpFramebufferRenderbuffer = (C.GPFRAMEBUFFERRENDERBUFFER)(getProcAddr("glFramebufferRenderbuffer")) + if gpFramebufferRenderbuffer == nil { + return errors.New("glFramebufferRenderbuffer") + } + gpFramebufferTexture = (C.GPFRAMEBUFFERTEXTURE)(getProcAddr("glFramebufferTexture")) + if gpFramebufferTexture == nil { + return errors.New("glFramebufferTexture") + } + gpFramebufferTexture1D = (C.GPFRAMEBUFFERTEXTURE1D)(getProcAddr("glFramebufferTexture1D")) + if gpFramebufferTexture1D == nil { + return errors.New("glFramebufferTexture1D") + } + gpFramebufferTexture2D = (C.GPFRAMEBUFFERTEXTURE2D)(getProcAddr("glFramebufferTexture2D")) + if gpFramebufferTexture2D == nil { + return errors.New("glFramebufferTexture2D") + } + gpFramebufferTexture3D = (C.GPFRAMEBUFFERTEXTURE3D)(getProcAddr("glFramebufferTexture3D")) + if gpFramebufferTexture3D == nil { + return errors.New("glFramebufferTexture3D") + } + gpFramebufferTextureLayer = (C.GPFRAMEBUFFERTEXTURELAYER)(getProcAddr("glFramebufferTextureLayer")) + if gpFramebufferTextureLayer == nil { + return errors.New("glFramebufferTextureLayer") + } + gpFrontFace = (C.GPFRONTFACE)(getProcAddr("glFrontFace")) + if gpFrontFace == nil { + return errors.New("glFrontFace") + } + gpGenBuffers = (C.GPGENBUFFERS)(getProcAddr("glGenBuffers")) + if gpGenBuffers == nil { + return errors.New("glGenBuffers") + } + gpGenFramebuffers = (C.GPGENFRAMEBUFFERS)(getProcAddr("glGenFramebuffers")) + if gpGenFramebuffers == nil { + return errors.New("glGenFramebuffers") + } + gpGenProgramPipelines = (C.GPGENPROGRAMPIPELINES)(getProcAddr("glGenProgramPipelines")) + gpGenQueries = (C.GPGENQUERIES)(getProcAddr("glGenQueries")) + if gpGenQueries == nil { + return errors.New("glGenQueries") + } + gpGenRenderbuffers = (C.GPGENRENDERBUFFERS)(getProcAddr("glGenRenderbuffers")) + if gpGenRenderbuffers == nil { + return errors.New("glGenRenderbuffers") + } + gpGenSamplers = (C.GPGENSAMPLERS)(getProcAddr("glGenSamplers")) + if gpGenSamplers == nil { + return errors.New("glGenSamplers") + } + gpGenTextures = (C.GPGENTEXTURES)(getProcAddr("glGenTextures")) + if gpGenTextures == nil { + return errors.New("glGenTextures") + } + gpGenTransformFeedbacks = (C.GPGENTRANSFORMFEEDBACKS)(getProcAddr("glGenTransformFeedbacks")) + gpGenVertexArrays = (C.GPGENVERTEXARRAYS)(getProcAddr("glGenVertexArrays")) + if gpGenVertexArrays == nil { + return errors.New("glGenVertexArrays") + } + gpGenerateMipmap = (C.GPGENERATEMIPMAP)(getProcAddr("glGenerateMipmap")) + if gpGenerateMipmap == nil { + return errors.New("glGenerateMipmap") + } + gpGenerateTextureMipmap = (C.GPGENERATETEXTUREMIPMAP)(getProcAddr("glGenerateTextureMipmap")) + gpGetActiveAtomicCounterBufferiv = (C.GPGETACTIVEATOMICCOUNTERBUFFERIV)(getProcAddr("glGetActiveAtomicCounterBufferiv")) + gpGetActiveAttrib = (C.GPGETACTIVEATTRIB)(getProcAddr("glGetActiveAttrib")) + if gpGetActiveAttrib == nil { + return errors.New("glGetActiveAttrib") + } + gpGetActiveSubroutineName = (C.GPGETACTIVESUBROUTINENAME)(getProcAddr("glGetActiveSubroutineName")) + gpGetActiveSubroutineUniformName = (C.GPGETACTIVESUBROUTINEUNIFORMNAME)(getProcAddr("glGetActiveSubroutineUniformName")) + gpGetActiveSubroutineUniformiv = (C.GPGETACTIVESUBROUTINEUNIFORMIV)(getProcAddr("glGetActiveSubroutineUniformiv")) + gpGetActiveUniform = (C.GPGETACTIVEUNIFORM)(getProcAddr("glGetActiveUniform")) + if gpGetActiveUniform == nil { + return errors.New("glGetActiveUniform") + } + gpGetActiveUniformBlockName = (C.GPGETACTIVEUNIFORMBLOCKNAME)(getProcAddr("glGetActiveUniformBlockName")) + if gpGetActiveUniformBlockName == nil { + return errors.New("glGetActiveUniformBlockName") + } + gpGetActiveUniformBlockiv = (C.GPGETACTIVEUNIFORMBLOCKIV)(getProcAddr("glGetActiveUniformBlockiv")) + if gpGetActiveUniformBlockiv == nil { + return errors.New("glGetActiveUniformBlockiv") + } + gpGetActiveUniformName = (C.GPGETACTIVEUNIFORMNAME)(getProcAddr("glGetActiveUniformName")) + if gpGetActiveUniformName == nil { + return errors.New("glGetActiveUniformName") + } + gpGetActiveUniformsiv = (C.GPGETACTIVEUNIFORMSIV)(getProcAddr("glGetActiveUniformsiv")) + if gpGetActiveUniformsiv == nil { + return errors.New("glGetActiveUniformsiv") + } + gpGetAttachedShaders = (C.GPGETATTACHEDSHADERS)(getProcAddr("glGetAttachedShaders")) + if gpGetAttachedShaders == nil { + return errors.New("glGetAttachedShaders") + } + gpGetAttribLocation = (C.GPGETATTRIBLOCATION)(getProcAddr("glGetAttribLocation")) + if gpGetAttribLocation == nil { + return errors.New("glGetAttribLocation") + } + gpGetBooleani_v = (C.GPGETBOOLEANI_V)(getProcAddr("glGetBooleani_v")) + if gpGetBooleani_v == nil { + return errors.New("glGetBooleani_v") + } + gpGetBooleanv = (C.GPGETBOOLEANV)(getProcAddr("glGetBooleanv")) + if gpGetBooleanv == nil { + return errors.New("glGetBooleanv") + } + gpGetBufferParameteri64v = (C.GPGETBUFFERPARAMETERI64V)(getProcAddr("glGetBufferParameteri64v")) + if gpGetBufferParameteri64v == nil { + return errors.New("glGetBufferParameteri64v") + } + gpGetBufferParameteriv = (C.GPGETBUFFERPARAMETERIV)(getProcAddr("glGetBufferParameteriv")) + if gpGetBufferParameteriv == nil { + return errors.New("glGetBufferParameteriv") + } + gpGetBufferPointerv = (C.GPGETBUFFERPOINTERV)(getProcAddr("glGetBufferPointerv")) + if gpGetBufferPointerv == nil { + return errors.New("glGetBufferPointerv") + } + gpGetBufferSubData = (C.GPGETBUFFERSUBDATA)(getProcAddr("glGetBufferSubData")) + if gpGetBufferSubData == nil { + return errors.New("glGetBufferSubData") + } + gpGetCompressedTexImage = (C.GPGETCOMPRESSEDTEXIMAGE)(getProcAddr("glGetCompressedTexImage")) + if gpGetCompressedTexImage == nil { + return errors.New("glGetCompressedTexImage") + } + gpGetCompressedTextureImage = (C.GPGETCOMPRESSEDTEXTUREIMAGE)(getProcAddr("glGetCompressedTextureImage")) + gpGetCompressedTextureSubImage = (C.GPGETCOMPRESSEDTEXTURESUBIMAGE)(getProcAddr("glGetCompressedTextureSubImage")) + gpGetDebugMessageLog = (C.GPGETDEBUGMESSAGELOG)(getProcAddr("glGetDebugMessageLog")) + gpGetDebugMessageLogARB = (C.GPGETDEBUGMESSAGELOGARB)(getProcAddr("glGetDebugMessageLogARB")) + gpGetDebugMessageLogKHR = (C.GPGETDEBUGMESSAGELOGKHR)(getProcAddr("glGetDebugMessageLogKHR")) + gpGetDoublei_v = (C.GPGETDOUBLEI_V)(getProcAddr("glGetDoublei_v")) + gpGetDoublev = (C.GPGETDOUBLEV)(getProcAddr("glGetDoublev")) + if gpGetDoublev == nil { + return errors.New("glGetDoublev") + } + gpGetError = (C.GPGETERROR)(getProcAddr("glGetError")) + if gpGetError == nil { + return errors.New("glGetError") + } + gpGetFloati_v = (C.GPGETFLOATI_V)(getProcAddr("glGetFloati_v")) + gpGetFloatv = (C.GPGETFLOATV)(getProcAddr("glGetFloatv")) + if gpGetFloatv == nil { + return errors.New("glGetFloatv") + } + gpGetFragDataIndex = (C.GPGETFRAGDATAINDEX)(getProcAddr("glGetFragDataIndex")) + if gpGetFragDataIndex == nil { + return errors.New("glGetFragDataIndex") + } + gpGetFragDataLocation = (C.GPGETFRAGDATALOCATION)(getProcAddr("glGetFragDataLocation")) + if gpGetFragDataLocation == nil { + return errors.New("glGetFragDataLocation") + } + gpGetFramebufferAttachmentParameteriv = (C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr("glGetFramebufferAttachmentParameteriv")) + if gpGetFramebufferAttachmentParameteriv == nil { + return errors.New("glGetFramebufferAttachmentParameteriv") + } + gpGetFramebufferParameteriv = (C.GPGETFRAMEBUFFERPARAMETERIV)(getProcAddr("glGetFramebufferParameteriv")) + gpGetGraphicsResetStatus = (C.GPGETGRAPHICSRESETSTATUS)(getProcAddr("glGetGraphicsResetStatus")) + gpGetGraphicsResetStatusARB = (C.GPGETGRAPHICSRESETSTATUSARB)(getProcAddr("glGetGraphicsResetStatusARB")) + gpGetGraphicsResetStatusKHR = (C.GPGETGRAPHICSRESETSTATUSKHR)(getProcAddr("glGetGraphicsResetStatusKHR")) + gpGetImageHandleARB = (C.GPGETIMAGEHANDLEARB)(getProcAddr("glGetImageHandleARB")) + gpGetInteger64i_v = (C.GPGETINTEGER64I_V)(getProcAddr("glGetInteger64i_v")) + if gpGetInteger64i_v == nil { + return errors.New("glGetInteger64i_v") + } + gpGetInteger64v = (C.GPGETINTEGER64V)(getProcAddr("glGetInteger64v")) + if gpGetInteger64v == nil { + return errors.New("glGetInteger64v") + } + gpGetIntegeri_v = (C.GPGETINTEGERI_V)(getProcAddr("glGetIntegeri_v")) + if gpGetIntegeri_v == nil { + return errors.New("glGetIntegeri_v") + } + gpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr("glGetIntegerv")) + if gpGetIntegerv == nil { + return errors.New("glGetIntegerv") + } + gpGetInternalformati64v = (C.GPGETINTERNALFORMATI64V)(getProcAddr("glGetInternalformati64v")) + gpGetInternalformativ = (C.GPGETINTERNALFORMATIV)(getProcAddr("glGetInternalformativ")) + gpGetMultisamplefv = (C.GPGETMULTISAMPLEFV)(getProcAddr("glGetMultisamplefv")) + if gpGetMultisamplefv == nil { + return errors.New("glGetMultisamplefv") + } + gpGetNamedBufferParameteri64v = (C.GPGETNAMEDBUFFERPARAMETERI64V)(getProcAddr("glGetNamedBufferParameteri64v")) + gpGetNamedBufferParameteriv = (C.GPGETNAMEDBUFFERPARAMETERIV)(getProcAddr("glGetNamedBufferParameteriv")) + gpGetNamedBufferPointerv = (C.GPGETNAMEDBUFFERPOINTERV)(getProcAddr("glGetNamedBufferPointerv")) + gpGetNamedBufferSubData = (C.GPGETNAMEDBUFFERSUBDATA)(getProcAddr("glGetNamedBufferSubData")) + gpGetNamedFramebufferAttachmentParameteriv = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr("glGetNamedFramebufferAttachmentParameteriv")) + gpGetNamedFramebufferParameteriv = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIV)(getProcAddr("glGetNamedFramebufferParameteriv")) + gpGetNamedRenderbufferParameteriv = (C.GPGETNAMEDRENDERBUFFERPARAMETERIV)(getProcAddr("glGetNamedRenderbufferParameteriv")) + gpGetNamedStringARB = (C.GPGETNAMEDSTRINGARB)(getProcAddr("glGetNamedStringARB")) + gpGetNamedStringivARB = (C.GPGETNAMEDSTRINGIVARB)(getProcAddr("glGetNamedStringivARB")) + gpGetObjectLabel = (C.GPGETOBJECTLABEL)(getProcAddr("glGetObjectLabel")) + gpGetObjectLabelKHR = (C.GPGETOBJECTLABELKHR)(getProcAddr("glGetObjectLabelKHR")) + gpGetObjectPtrLabel = (C.GPGETOBJECTPTRLABEL)(getProcAddr("glGetObjectPtrLabel")) + gpGetObjectPtrLabelKHR = (C.GPGETOBJECTPTRLABELKHR)(getProcAddr("glGetObjectPtrLabelKHR")) + gpGetPointerv = (C.GPGETPOINTERV)(getProcAddr("glGetPointerv")) + gpGetPointervKHR = (C.GPGETPOINTERVKHR)(getProcAddr("glGetPointervKHR")) + gpGetProgramBinary = (C.GPGETPROGRAMBINARY)(getProcAddr("glGetProgramBinary")) + gpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr("glGetProgramInfoLog")) + if gpGetProgramInfoLog == nil { + return errors.New("glGetProgramInfoLog") + } + gpGetProgramInterfaceiv = (C.GPGETPROGRAMINTERFACEIV)(getProcAddr("glGetProgramInterfaceiv")) + gpGetProgramPipelineInfoLog = (C.GPGETPROGRAMPIPELINEINFOLOG)(getProcAddr("glGetProgramPipelineInfoLog")) + gpGetProgramPipelineiv = (C.GPGETPROGRAMPIPELINEIV)(getProcAddr("glGetProgramPipelineiv")) + gpGetProgramResourceIndex = (C.GPGETPROGRAMRESOURCEINDEX)(getProcAddr("glGetProgramResourceIndex")) + gpGetProgramResourceLocation = (C.GPGETPROGRAMRESOURCELOCATION)(getProcAddr("glGetProgramResourceLocation")) + gpGetProgramResourceLocationIndex = (C.GPGETPROGRAMRESOURCELOCATIONINDEX)(getProcAddr("glGetProgramResourceLocationIndex")) + gpGetProgramResourceName = (C.GPGETPROGRAMRESOURCENAME)(getProcAddr("glGetProgramResourceName")) + gpGetProgramResourceiv = (C.GPGETPROGRAMRESOURCEIV)(getProcAddr("glGetProgramResourceiv")) + gpGetProgramStageiv = (C.GPGETPROGRAMSTAGEIV)(getProcAddr("glGetProgramStageiv")) + gpGetProgramiv = (C.GPGETPROGRAMIV)(getProcAddr("glGetProgramiv")) + if gpGetProgramiv == nil { + return errors.New("glGetProgramiv") + } + gpGetQueryIndexediv = (C.GPGETQUERYINDEXEDIV)(getProcAddr("glGetQueryIndexediv")) + gpGetQueryObjecti64v = (C.GPGETQUERYOBJECTI64V)(getProcAddr("glGetQueryObjecti64v")) + if gpGetQueryObjecti64v == nil { + return errors.New("glGetQueryObjecti64v") + } + gpGetQueryObjectiv = (C.GPGETQUERYOBJECTIV)(getProcAddr("glGetQueryObjectiv")) + if gpGetQueryObjectiv == nil { + return errors.New("glGetQueryObjectiv") + } + gpGetQueryObjectui64v = (C.GPGETQUERYOBJECTUI64V)(getProcAddr("glGetQueryObjectui64v")) + if gpGetQueryObjectui64v == nil { + return errors.New("glGetQueryObjectui64v") + } + gpGetQueryObjectuiv = (C.GPGETQUERYOBJECTUIV)(getProcAddr("glGetQueryObjectuiv")) + if gpGetQueryObjectuiv == nil { + return errors.New("glGetQueryObjectuiv") + } + gpGetQueryiv = (C.GPGETQUERYIV)(getProcAddr("glGetQueryiv")) + if gpGetQueryiv == nil { + return errors.New("glGetQueryiv") + } + gpGetRenderbufferParameteriv = (C.GPGETRENDERBUFFERPARAMETERIV)(getProcAddr("glGetRenderbufferParameteriv")) + if gpGetRenderbufferParameteriv == nil { + return errors.New("glGetRenderbufferParameteriv") + } + gpGetSamplerParameterIiv = (C.GPGETSAMPLERPARAMETERIIV)(getProcAddr("glGetSamplerParameterIiv")) + if gpGetSamplerParameterIiv == nil { + return errors.New("glGetSamplerParameterIiv") + } + gpGetSamplerParameterIuiv = (C.GPGETSAMPLERPARAMETERIUIV)(getProcAddr("glGetSamplerParameterIuiv")) + if gpGetSamplerParameterIuiv == nil { + return errors.New("glGetSamplerParameterIuiv") + } + gpGetSamplerParameterfv = (C.GPGETSAMPLERPARAMETERFV)(getProcAddr("glGetSamplerParameterfv")) + if gpGetSamplerParameterfv == nil { + return errors.New("glGetSamplerParameterfv") + } + gpGetSamplerParameteriv = (C.GPGETSAMPLERPARAMETERIV)(getProcAddr("glGetSamplerParameteriv")) + if gpGetSamplerParameteriv == nil { + return errors.New("glGetSamplerParameteriv") + } + gpGetShaderInfoLog = (C.GPGETSHADERINFOLOG)(getProcAddr("glGetShaderInfoLog")) + if gpGetShaderInfoLog == nil { + return errors.New("glGetShaderInfoLog") + } + gpGetShaderPrecisionFormat = (C.GPGETSHADERPRECISIONFORMAT)(getProcAddr("glGetShaderPrecisionFormat")) + gpGetShaderSource = (C.GPGETSHADERSOURCE)(getProcAddr("glGetShaderSource")) + if gpGetShaderSource == nil { + return errors.New("glGetShaderSource") + } + gpGetShaderiv = (C.GPGETSHADERIV)(getProcAddr("glGetShaderiv")) + if gpGetShaderiv == nil { + return errors.New("glGetShaderiv") + } + gpGetString = (C.GPGETSTRING)(getProcAddr("glGetString")) + if gpGetString == nil { + return errors.New("glGetString") + } + gpGetStringi = (C.GPGETSTRINGI)(getProcAddr("glGetStringi")) + if gpGetStringi == nil { + return errors.New("glGetStringi") + } + gpGetSubroutineIndex = (C.GPGETSUBROUTINEINDEX)(getProcAddr("glGetSubroutineIndex")) + gpGetSubroutineUniformLocation = (C.GPGETSUBROUTINEUNIFORMLOCATION)(getProcAddr("glGetSubroutineUniformLocation")) + gpGetSynciv = (C.GPGETSYNCIV)(getProcAddr("glGetSynciv")) + if gpGetSynciv == nil { + return errors.New("glGetSynciv") + } + gpGetTexImage = (C.GPGETTEXIMAGE)(getProcAddr("glGetTexImage")) + if gpGetTexImage == nil { + return errors.New("glGetTexImage") + } + gpGetTexLevelParameterfv = (C.GPGETTEXLEVELPARAMETERFV)(getProcAddr("glGetTexLevelParameterfv")) + if gpGetTexLevelParameterfv == nil { + return errors.New("glGetTexLevelParameterfv") + } + gpGetTexLevelParameteriv = (C.GPGETTEXLEVELPARAMETERIV)(getProcAddr("glGetTexLevelParameteriv")) + if gpGetTexLevelParameteriv == nil { + return errors.New("glGetTexLevelParameteriv") + } + gpGetTexParameterIiv = (C.GPGETTEXPARAMETERIIV)(getProcAddr("glGetTexParameterIiv")) + if gpGetTexParameterIiv == nil { + return errors.New("glGetTexParameterIiv") + } + gpGetTexParameterIuiv = (C.GPGETTEXPARAMETERIUIV)(getProcAddr("glGetTexParameterIuiv")) + if gpGetTexParameterIuiv == nil { + return errors.New("glGetTexParameterIuiv") + } + gpGetTexParameterfv = (C.GPGETTEXPARAMETERFV)(getProcAddr("glGetTexParameterfv")) + if gpGetTexParameterfv == nil { + return errors.New("glGetTexParameterfv") + } + gpGetTexParameteriv = (C.GPGETTEXPARAMETERIV)(getProcAddr("glGetTexParameteriv")) + if gpGetTexParameteriv == nil { + return errors.New("glGetTexParameteriv") + } + gpGetTextureHandleARB = (C.GPGETTEXTUREHANDLEARB)(getProcAddr("glGetTextureHandleARB")) + gpGetTextureImage = (C.GPGETTEXTUREIMAGE)(getProcAddr("glGetTextureImage")) + gpGetTextureLevelParameterfv = (C.GPGETTEXTURELEVELPARAMETERFV)(getProcAddr("glGetTextureLevelParameterfv")) + gpGetTextureLevelParameteriv = (C.GPGETTEXTURELEVELPARAMETERIV)(getProcAddr("glGetTextureLevelParameteriv")) + gpGetTextureParameterIiv = (C.GPGETTEXTUREPARAMETERIIV)(getProcAddr("glGetTextureParameterIiv")) + gpGetTextureParameterIuiv = (C.GPGETTEXTUREPARAMETERIUIV)(getProcAddr("glGetTextureParameterIuiv")) + gpGetTextureParameterfv = (C.GPGETTEXTUREPARAMETERFV)(getProcAddr("glGetTextureParameterfv")) + gpGetTextureParameteriv = (C.GPGETTEXTUREPARAMETERIV)(getProcAddr("glGetTextureParameteriv")) + gpGetTextureSamplerHandleARB = (C.GPGETTEXTURESAMPLERHANDLEARB)(getProcAddr("glGetTextureSamplerHandleARB")) + gpGetTextureSubImage = (C.GPGETTEXTURESUBIMAGE)(getProcAddr("glGetTextureSubImage")) + gpGetTransformFeedbackVarying = (C.GPGETTRANSFORMFEEDBACKVARYING)(getProcAddr("glGetTransformFeedbackVarying")) + if gpGetTransformFeedbackVarying == nil { + return errors.New("glGetTransformFeedbackVarying") + } + gpGetTransformFeedbacki64_v = (C.GPGETTRANSFORMFEEDBACKI64_V)(getProcAddr("glGetTransformFeedbacki64_v")) + gpGetTransformFeedbacki_v = (C.GPGETTRANSFORMFEEDBACKI_V)(getProcAddr("glGetTransformFeedbacki_v")) + gpGetTransformFeedbackiv = (C.GPGETTRANSFORMFEEDBACKIV)(getProcAddr("glGetTransformFeedbackiv")) + gpGetUniformBlockIndex = (C.GPGETUNIFORMBLOCKINDEX)(getProcAddr("glGetUniformBlockIndex")) + if gpGetUniformBlockIndex == nil { + return errors.New("glGetUniformBlockIndex") + } + gpGetUniformIndices = (C.GPGETUNIFORMINDICES)(getProcAddr("glGetUniformIndices")) + if gpGetUniformIndices == nil { + return errors.New("glGetUniformIndices") + } + gpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr("glGetUniformLocation")) + if gpGetUniformLocation == nil { + return errors.New("glGetUniformLocation") + } + gpGetUniformSubroutineuiv = (C.GPGETUNIFORMSUBROUTINEUIV)(getProcAddr("glGetUniformSubroutineuiv")) + gpGetUniformdv = (C.GPGETUNIFORMDV)(getProcAddr("glGetUniformdv")) + gpGetUniformfv = (C.GPGETUNIFORMFV)(getProcAddr("glGetUniformfv")) + if gpGetUniformfv == nil { + return errors.New("glGetUniformfv") + } + gpGetUniformiv = (C.GPGETUNIFORMIV)(getProcAddr("glGetUniformiv")) + if gpGetUniformiv == nil { + return errors.New("glGetUniformiv") + } + gpGetUniformuiv = (C.GPGETUNIFORMUIV)(getProcAddr("glGetUniformuiv")) + if gpGetUniformuiv == nil { + return errors.New("glGetUniformuiv") + } + gpGetVertexArrayIndexed64iv = (C.GPGETVERTEXARRAYINDEXED64IV)(getProcAddr("glGetVertexArrayIndexed64iv")) + gpGetVertexArrayIndexediv = (C.GPGETVERTEXARRAYINDEXEDIV)(getProcAddr("glGetVertexArrayIndexediv")) + gpGetVertexArrayiv = (C.GPGETVERTEXARRAYIV)(getProcAddr("glGetVertexArrayiv")) + gpGetVertexAttribIiv = (C.GPGETVERTEXATTRIBIIV)(getProcAddr("glGetVertexAttribIiv")) + if gpGetVertexAttribIiv == nil { + return errors.New("glGetVertexAttribIiv") + } + gpGetVertexAttribIuiv = (C.GPGETVERTEXATTRIBIUIV)(getProcAddr("glGetVertexAttribIuiv")) + if gpGetVertexAttribIuiv == nil { + return errors.New("glGetVertexAttribIuiv") + } + gpGetVertexAttribLdv = (C.GPGETVERTEXATTRIBLDV)(getProcAddr("glGetVertexAttribLdv")) + gpGetVertexAttribLui64vARB = (C.GPGETVERTEXATTRIBLUI64VARB)(getProcAddr("glGetVertexAttribLui64vARB")) + gpGetVertexAttribPointerv = (C.GPGETVERTEXATTRIBPOINTERV)(getProcAddr("glGetVertexAttribPointerv")) + if gpGetVertexAttribPointerv == nil { + return errors.New("glGetVertexAttribPointerv") + } + gpGetVertexAttribdv = (C.GPGETVERTEXATTRIBDV)(getProcAddr("glGetVertexAttribdv")) + if gpGetVertexAttribdv == nil { + return errors.New("glGetVertexAttribdv") + } + gpGetVertexAttribfv = (C.GPGETVERTEXATTRIBFV)(getProcAddr("glGetVertexAttribfv")) + if gpGetVertexAttribfv == nil { + return errors.New("glGetVertexAttribfv") + } + gpGetVertexAttribiv = (C.GPGETVERTEXATTRIBIV)(getProcAddr("glGetVertexAttribiv")) + if gpGetVertexAttribiv == nil { + return errors.New("glGetVertexAttribiv") + } + gpGetnCompressedTexImageARB = (C.GPGETNCOMPRESSEDTEXIMAGEARB)(getProcAddr("glGetnCompressedTexImageARB")) + gpGetnTexImageARB = (C.GPGETNTEXIMAGEARB)(getProcAddr("glGetnTexImageARB")) + gpGetnUniformdvARB = (C.GPGETNUNIFORMDVARB)(getProcAddr("glGetnUniformdvARB")) + gpGetnUniformfv = (C.GPGETNUNIFORMFV)(getProcAddr("glGetnUniformfv")) + gpGetnUniformfvARB = (C.GPGETNUNIFORMFVARB)(getProcAddr("glGetnUniformfvARB")) + gpGetnUniformfvKHR = (C.GPGETNUNIFORMFVKHR)(getProcAddr("glGetnUniformfvKHR")) + gpGetnUniformiv = (C.GPGETNUNIFORMIV)(getProcAddr("glGetnUniformiv")) + gpGetnUniformivARB = (C.GPGETNUNIFORMIVARB)(getProcAddr("glGetnUniformivARB")) + gpGetnUniformivKHR = (C.GPGETNUNIFORMIVKHR)(getProcAddr("glGetnUniformivKHR")) + gpGetnUniformuiv = (C.GPGETNUNIFORMUIV)(getProcAddr("glGetnUniformuiv")) + gpGetnUniformuivARB = (C.GPGETNUNIFORMUIVARB)(getProcAddr("glGetnUniformuivARB")) + gpGetnUniformuivKHR = (C.GPGETNUNIFORMUIVKHR)(getProcAddr("glGetnUniformuivKHR")) + gpHint = (C.GPHINT)(getProcAddr("glHint")) + if gpHint == nil { + return errors.New("glHint") + } + gpInvalidateBufferData = (C.GPINVALIDATEBUFFERDATA)(getProcAddr("glInvalidateBufferData")) + gpInvalidateBufferSubData = (C.GPINVALIDATEBUFFERSUBDATA)(getProcAddr("glInvalidateBufferSubData")) + gpInvalidateFramebuffer = (C.GPINVALIDATEFRAMEBUFFER)(getProcAddr("glInvalidateFramebuffer")) + gpInvalidateNamedFramebufferData = (C.GPINVALIDATENAMEDFRAMEBUFFERDATA)(getProcAddr("glInvalidateNamedFramebufferData")) + gpInvalidateNamedFramebufferSubData = (C.GPINVALIDATENAMEDFRAMEBUFFERSUBDATA)(getProcAddr("glInvalidateNamedFramebufferSubData")) + gpInvalidateSubFramebuffer = (C.GPINVALIDATESUBFRAMEBUFFER)(getProcAddr("glInvalidateSubFramebuffer")) + gpInvalidateTexImage = (C.GPINVALIDATETEXIMAGE)(getProcAddr("glInvalidateTexImage")) + gpInvalidateTexSubImage = (C.GPINVALIDATETEXSUBIMAGE)(getProcAddr("glInvalidateTexSubImage")) + gpIsBuffer = (C.GPISBUFFER)(getProcAddr("glIsBuffer")) + if gpIsBuffer == nil { + return errors.New("glIsBuffer") + } + gpIsEnabled = (C.GPISENABLED)(getProcAddr("glIsEnabled")) + if gpIsEnabled == nil { + return errors.New("glIsEnabled") + } + gpIsEnabledi = (C.GPISENABLEDI)(getProcAddr("glIsEnabledi")) + if gpIsEnabledi == nil { + return errors.New("glIsEnabledi") + } + gpIsFramebuffer = (C.GPISFRAMEBUFFER)(getProcAddr("glIsFramebuffer")) + if gpIsFramebuffer == nil { + return errors.New("glIsFramebuffer") + } + gpIsImageHandleResidentARB = (C.GPISIMAGEHANDLERESIDENTARB)(getProcAddr("glIsImageHandleResidentARB")) + gpIsNamedStringARB = (C.GPISNAMEDSTRINGARB)(getProcAddr("glIsNamedStringARB")) + gpIsProgram = (C.GPISPROGRAM)(getProcAddr("glIsProgram")) + if gpIsProgram == nil { + return errors.New("glIsProgram") + } + gpIsProgramPipeline = (C.GPISPROGRAMPIPELINE)(getProcAddr("glIsProgramPipeline")) + gpIsQuery = (C.GPISQUERY)(getProcAddr("glIsQuery")) + if gpIsQuery == nil { + return errors.New("glIsQuery") + } + gpIsRenderbuffer = (C.GPISRENDERBUFFER)(getProcAddr("glIsRenderbuffer")) + if gpIsRenderbuffer == nil { + return errors.New("glIsRenderbuffer") + } + gpIsSampler = (C.GPISSAMPLER)(getProcAddr("glIsSampler")) + if gpIsSampler == nil { + return errors.New("glIsSampler") + } + gpIsShader = (C.GPISSHADER)(getProcAddr("glIsShader")) + if gpIsShader == nil { + return errors.New("glIsShader") + } + gpIsSync = (C.GPISSYNC)(getProcAddr("glIsSync")) + if gpIsSync == nil { + return errors.New("glIsSync") + } + gpIsTexture = (C.GPISTEXTURE)(getProcAddr("glIsTexture")) + if gpIsTexture == nil { + return errors.New("glIsTexture") + } + gpIsTextureHandleResidentARB = (C.GPISTEXTUREHANDLERESIDENTARB)(getProcAddr("glIsTextureHandleResidentARB")) + gpIsTransformFeedback = (C.GPISTRANSFORMFEEDBACK)(getProcAddr("glIsTransformFeedback")) + gpIsVertexArray = (C.GPISVERTEXARRAY)(getProcAddr("glIsVertexArray")) + if gpIsVertexArray == nil { + return errors.New("glIsVertexArray") + } + gpLineWidth = (C.GPLINEWIDTH)(getProcAddr("glLineWidth")) + if gpLineWidth == nil { + return errors.New("glLineWidth") + } + gpLinkProgram = (C.GPLINKPROGRAM)(getProcAddr("glLinkProgram")) + if gpLinkProgram == nil { + return errors.New("glLinkProgram") + } + gpLogicOp = (C.GPLOGICOP)(getProcAddr("glLogicOp")) + if gpLogicOp == nil { + return errors.New("glLogicOp") + } + gpMakeImageHandleNonResidentARB = (C.GPMAKEIMAGEHANDLENONRESIDENTARB)(getProcAddr("glMakeImageHandleNonResidentARB")) + gpMakeImageHandleResidentARB = (C.GPMAKEIMAGEHANDLERESIDENTARB)(getProcAddr("glMakeImageHandleResidentARB")) + gpMakeTextureHandleNonResidentARB = (C.GPMAKETEXTUREHANDLENONRESIDENTARB)(getProcAddr("glMakeTextureHandleNonResidentARB")) + gpMakeTextureHandleResidentARB = (C.GPMAKETEXTUREHANDLERESIDENTARB)(getProcAddr("glMakeTextureHandleResidentARB")) + gpMapBuffer = (C.GPMAPBUFFER)(getProcAddr("glMapBuffer")) + if gpMapBuffer == nil { + return errors.New("glMapBuffer") + } + gpMapBufferRange = (C.GPMAPBUFFERRANGE)(getProcAddr("glMapBufferRange")) + if gpMapBufferRange == nil { + return errors.New("glMapBufferRange") + } + gpMapNamedBuffer = (C.GPMAPNAMEDBUFFER)(getProcAddr("glMapNamedBuffer")) + gpMapNamedBufferRange = (C.GPMAPNAMEDBUFFERRANGE)(getProcAddr("glMapNamedBufferRange")) + gpMemoryBarrier = (C.GPMEMORYBARRIER)(getProcAddr("glMemoryBarrier")) + gpMemoryBarrierByRegion = (C.GPMEMORYBARRIERBYREGION)(getProcAddr("glMemoryBarrierByRegion")) + gpMinSampleShadingARB = (C.GPMINSAMPLESHADINGARB)(getProcAddr("glMinSampleShadingARB")) + gpMultiDrawArrays = (C.GPMULTIDRAWARRAYS)(getProcAddr("glMultiDrawArrays")) + if gpMultiDrawArrays == nil { + return errors.New("glMultiDrawArrays") + } + gpMultiDrawArraysIndirect = (C.GPMULTIDRAWARRAYSINDIRECT)(getProcAddr("glMultiDrawArraysIndirect")) + gpMultiDrawArraysIndirectCountARB = (C.GPMULTIDRAWARRAYSINDIRECTCOUNTARB)(getProcAddr("glMultiDrawArraysIndirectCountARB")) + gpMultiDrawElements = (C.GPMULTIDRAWELEMENTS)(getProcAddr("glMultiDrawElements")) + if gpMultiDrawElements == nil { + return errors.New("glMultiDrawElements") + } + gpMultiDrawElementsBaseVertex = (C.GPMULTIDRAWELEMENTSBASEVERTEX)(getProcAddr("glMultiDrawElementsBaseVertex")) + if gpMultiDrawElementsBaseVertex == nil { + return errors.New("glMultiDrawElementsBaseVertex") + } + gpMultiDrawElementsIndirect = (C.GPMULTIDRAWELEMENTSINDIRECT)(getProcAddr("glMultiDrawElementsIndirect")) + gpMultiDrawElementsIndirectCountARB = (C.GPMULTIDRAWELEMENTSINDIRECTCOUNTARB)(getProcAddr("glMultiDrawElementsIndirectCountARB")) + gpNamedBufferData = (C.GPNAMEDBUFFERDATA)(getProcAddr("glNamedBufferData")) + gpNamedBufferPageCommitmentARB = (C.GPNAMEDBUFFERPAGECOMMITMENTARB)(getProcAddr("glNamedBufferPageCommitmentARB")) + gpNamedBufferPageCommitmentEXT = (C.GPNAMEDBUFFERPAGECOMMITMENTEXT)(getProcAddr("glNamedBufferPageCommitmentEXT")) + gpNamedBufferStorage = (C.GPNAMEDBUFFERSTORAGE)(getProcAddr("glNamedBufferStorage")) + gpNamedBufferSubData = (C.GPNAMEDBUFFERSUBDATA)(getProcAddr("glNamedBufferSubData")) + gpNamedFramebufferDrawBuffer = (C.GPNAMEDFRAMEBUFFERDRAWBUFFER)(getProcAddr("glNamedFramebufferDrawBuffer")) + gpNamedFramebufferDrawBuffers = (C.GPNAMEDFRAMEBUFFERDRAWBUFFERS)(getProcAddr("glNamedFramebufferDrawBuffers")) + gpNamedFramebufferParameteri = (C.GPNAMEDFRAMEBUFFERPARAMETERI)(getProcAddr("glNamedFramebufferParameteri")) + gpNamedFramebufferReadBuffer = (C.GPNAMEDFRAMEBUFFERREADBUFFER)(getProcAddr("glNamedFramebufferReadBuffer")) + gpNamedFramebufferRenderbuffer = (C.GPNAMEDFRAMEBUFFERRENDERBUFFER)(getProcAddr("glNamedFramebufferRenderbuffer")) + gpNamedFramebufferTexture = (C.GPNAMEDFRAMEBUFFERTEXTURE)(getProcAddr("glNamedFramebufferTexture")) + gpNamedFramebufferTextureLayer = (C.GPNAMEDFRAMEBUFFERTEXTURELAYER)(getProcAddr("glNamedFramebufferTextureLayer")) + gpNamedRenderbufferStorage = (C.GPNAMEDRENDERBUFFERSTORAGE)(getProcAddr("glNamedRenderbufferStorage")) + gpNamedRenderbufferStorageMultisample = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr("glNamedRenderbufferStorageMultisample")) + gpNamedStringARB = (C.GPNAMEDSTRINGARB)(getProcAddr("glNamedStringARB")) + gpObjectLabel = (C.GPOBJECTLABEL)(getProcAddr("glObjectLabel")) + gpObjectLabelKHR = (C.GPOBJECTLABELKHR)(getProcAddr("glObjectLabelKHR")) + gpObjectPtrLabel = (C.GPOBJECTPTRLABEL)(getProcAddr("glObjectPtrLabel")) + gpObjectPtrLabelKHR = (C.GPOBJECTPTRLABELKHR)(getProcAddr("glObjectPtrLabelKHR")) + gpPatchParameterfv = (C.GPPATCHPARAMETERFV)(getProcAddr("glPatchParameterfv")) + gpPatchParameteri = (C.GPPATCHPARAMETERI)(getProcAddr("glPatchParameteri")) + gpPauseTransformFeedback = (C.GPPAUSETRANSFORMFEEDBACK)(getProcAddr("glPauseTransformFeedback")) + gpPixelStoref = (C.GPPIXELSTOREF)(getProcAddr("glPixelStoref")) + if gpPixelStoref == nil { + return errors.New("glPixelStoref") + } + gpPixelStorei = (C.GPPIXELSTOREI)(getProcAddr("glPixelStorei")) + if gpPixelStorei == nil { + return errors.New("glPixelStorei") + } + gpPointParameterf = (C.GPPOINTPARAMETERF)(getProcAddr("glPointParameterf")) + if gpPointParameterf == nil { + return errors.New("glPointParameterf") + } + gpPointParameterfv = (C.GPPOINTPARAMETERFV)(getProcAddr("glPointParameterfv")) + if gpPointParameterfv == nil { + return errors.New("glPointParameterfv") + } + gpPointParameteri = (C.GPPOINTPARAMETERI)(getProcAddr("glPointParameteri")) + if gpPointParameteri == nil { + return errors.New("glPointParameteri") + } + gpPointParameteriv = (C.GPPOINTPARAMETERIV)(getProcAddr("glPointParameteriv")) + if gpPointParameteriv == nil { + return errors.New("glPointParameteriv") + } + gpPointSize = (C.GPPOINTSIZE)(getProcAddr("glPointSize")) + if gpPointSize == nil { + return errors.New("glPointSize") + } + gpPolygonMode = (C.GPPOLYGONMODE)(getProcAddr("glPolygonMode")) + if gpPolygonMode == nil { + return errors.New("glPolygonMode") + } + gpPolygonOffset = (C.GPPOLYGONOFFSET)(getProcAddr("glPolygonOffset")) + if gpPolygonOffset == nil { + return errors.New("glPolygonOffset") + } + gpPopDebugGroup = (C.GPPOPDEBUGGROUP)(getProcAddr("glPopDebugGroup")) + gpPopDebugGroupKHR = (C.GPPOPDEBUGGROUPKHR)(getProcAddr("glPopDebugGroupKHR")) + gpPrimitiveRestartIndex = (C.GPPRIMITIVERESTARTINDEX)(getProcAddr("glPrimitiveRestartIndex")) + if gpPrimitiveRestartIndex == nil { + return errors.New("glPrimitiveRestartIndex") + } + gpProgramBinary = (C.GPPROGRAMBINARY)(getProcAddr("glProgramBinary")) + gpProgramParameteri = (C.GPPROGRAMPARAMETERI)(getProcAddr("glProgramParameteri")) + gpProgramUniform1d = (C.GPPROGRAMUNIFORM1D)(getProcAddr("glProgramUniform1d")) + gpProgramUniform1dv = (C.GPPROGRAMUNIFORM1DV)(getProcAddr("glProgramUniform1dv")) + gpProgramUniform1f = (C.GPPROGRAMUNIFORM1F)(getProcAddr("glProgramUniform1f")) + gpProgramUniform1fv = (C.GPPROGRAMUNIFORM1FV)(getProcAddr("glProgramUniform1fv")) + gpProgramUniform1i = (C.GPPROGRAMUNIFORM1I)(getProcAddr("glProgramUniform1i")) + gpProgramUniform1iv = (C.GPPROGRAMUNIFORM1IV)(getProcAddr("glProgramUniform1iv")) + gpProgramUniform1ui = (C.GPPROGRAMUNIFORM1UI)(getProcAddr("glProgramUniform1ui")) + gpProgramUniform1uiv = (C.GPPROGRAMUNIFORM1UIV)(getProcAddr("glProgramUniform1uiv")) + gpProgramUniform2d = (C.GPPROGRAMUNIFORM2D)(getProcAddr("glProgramUniform2d")) + gpProgramUniform2dv = (C.GPPROGRAMUNIFORM2DV)(getProcAddr("glProgramUniform2dv")) + gpProgramUniform2f = (C.GPPROGRAMUNIFORM2F)(getProcAddr("glProgramUniform2f")) + gpProgramUniform2fv = (C.GPPROGRAMUNIFORM2FV)(getProcAddr("glProgramUniform2fv")) + gpProgramUniform2i = (C.GPPROGRAMUNIFORM2I)(getProcAddr("glProgramUniform2i")) + gpProgramUniform2iv = (C.GPPROGRAMUNIFORM2IV)(getProcAddr("glProgramUniform2iv")) + gpProgramUniform2ui = (C.GPPROGRAMUNIFORM2UI)(getProcAddr("glProgramUniform2ui")) + gpProgramUniform2uiv = (C.GPPROGRAMUNIFORM2UIV)(getProcAddr("glProgramUniform2uiv")) + gpProgramUniform3d = (C.GPPROGRAMUNIFORM3D)(getProcAddr("glProgramUniform3d")) + gpProgramUniform3dv = (C.GPPROGRAMUNIFORM3DV)(getProcAddr("glProgramUniform3dv")) + gpProgramUniform3f = (C.GPPROGRAMUNIFORM3F)(getProcAddr("glProgramUniform3f")) + gpProgramUniform3fv = (C.GPPROGRAMUNIFORM3FV)(getProcAddr("glProgramUniform3fv")) + gpProgramUniform3i = (C.GPPROGRAMUNIFORM3I)(getProcAddr("glProgramUniform3i")) + gpProgramUniform3iv = (C.GPPROGRAMUNIFORM3IV)(getProcAddr("glProgramUniform3iv")) + gpProgramUniform3ui = (C.GPPROGRAMUNIFORM3UI)(getProcAddr("glProgramUniform3ui")) + gpProgramUniform3uiv = (C.GPPROGRAMUNIFORM3UIV)(getProcAddr("glProgramUniform3uiv")) + gpProgramUniform4d = (C.GPPROGRAMUNIFORM4D)(getProcAddr("glProgramUniform4d")) + gpProgramUniform4dv = (C.GPPROGRAMUNIFORM4DV)(getProcAddr("glProgramUniform4dv")) + gpProgramUniform4f = (C.GPPROGRAMUNIFORM4F)(getProcAddr("glProgramUniform4f")) + gpProgramUniform4fv = (C.GPPROGRAMUNIFORM4FV)(getProcAddr("glProgramUniform4fv")) + gpProgramUniform4i = (C.GPPROGRAMUNIFORM4I)(getProcAddr("glProgramUniform4i")) + gpProgramUniform4iv = (C.GPPROGRAMUNIFORM4IV)(getProcAddr("glProgramUniform4iv")) + gpProgramUniform4ui = (C.GPPROGRAMUNIFORM4UI)(getProcAddr("glProgramUniform4ui")) + gpProgramUniform4uiv = (C.GPPROGRAMUNIFORM4UIV)(getProcAddr("glProgramUniform4uiv")) + gpProgramUniformHandleui64ARB = (C.GPPROGRAMUNIFORMHANDLEUI64ARB)(getProcAddr("glProgramUniformHandleui64ARB")) + gpProgramUniformHandleui64vARB = (C.GPPROGRAMUNIFORMHANDLEUI64VARB)(getProcAddr("glProgramUniformHandleui64vARB")) + gpProgramUniformMatrix2dv = (C.GPPROGRAMUNIFORMMATRIX2DV)(getProcAddr("glProgramUniformMatrix2dv")) + gpProgramUniformMatrix2fv = (C.GPPROGRAMUNIFORMMATRIX2FV)(getProcAddr("glProgramUniformMatrix2fv")) + gpProgramUniformMatrix2x3dv = (C.GPPROGRAMUNIFORMMATRIX2X3DV)(getProcAddr("glProgramUniformMatrix2x3dv")) + gpProgramUniformMatrix2x3fv = (C.GPPROGRAMUNIFORMMATRIX2X3FV)(getProcAddr("glProgramUniformMatrix2x3fv")) + gpProgramUniformMatrix2x4dv = (C.GPPROGRAMUNIFORMMATRIX2X4DV)(getProcAddr("glProgramUniformMatrix2x4dv")) + gpProgramUniformMatrix2x4fv = (C.GPPROGRAMUNIFORMMATRIX2X4FV)(getProcAddr("glProgramUniformMatrix2x4fv")) + gpProgramUniformMatrix3dv = (C.GPPROGRAMUNIFORMMATRIX3DV)(getProcAddr("glProgramUniformMatrix3dv")) + gpProgramUniformMatrix3fv = (C.GPPROGRAMUNIFORMMATRIX3FV)(getProcAddr("glProgramUniformMatrix3fv")) + gpProgramUniformMatrix3x2dv = (C.GPPROGRAMUNIFORMMATRIX3X2DV)(getProcAddr("glProgramUniformMatrix3x2dv")) + gpProgramUniformMatrix3x2fv = (C.GPPROGRAMUNIFORMMATRIX3X2FV)(getProcAddr("glProgramUniformMatrix3x2fv")) + gpProgramUniformMatrix3x4dv = (C.GPPROGRAMUNIFORMMATRIX3X4DV)(getProcAddr("glProgramUniformMatrix3x4dv")) + gpProgramUniformMatrix3x4fv = (C.GPPROGRAMUNIFORMMATRIX3X4FV)(getProcAddr("glProgramUniformMatrix3x4fv")) + gpProgramUniformMatrix4dv = (C.GPPROGRAMUNIFORMMATRIX4DV)(getProcAddr("glProgramUniformMatrix4dv")) + gpProgramUniformMatrix4fv = (C.GPPROGRAMUNIFORMMATRIX4FV)(getProcAddr("glProgramUniformMatrix4fv")) + gpProgramUniformMatrix4x2dv = (C.GPPROGRAMUNIFORMMATRIX4X2DV)(getProcAddr("glProgramUniformMatrix4x2dv")) + gpProgramUniformMatrix4x2fv = (C.GPPROGRAMUNIFORMMATRIX4X2FV)(getProcAddr("glProgramUniformMatrix4x2fv")) + gpProgramUniformMatrix4x3dv = (C.GPPROGRAMUNIFORMMATRIX4X3DV)(getProcAddr("glProgramUniformMatrix4x3dv")) + gpProgramUniformMatrix4x3fv = (C.GPPROGRAMUNIFORMMATRIX4X3FV)(getProcAddr("glProgramUniformMatrix4x3fv")) + gpProvokingVertex = (C.GPPROVOKINGVERTEX)(getProcAddr("glProvokingVertex")) + if gpProvokingVertex == nil { + return errors.New("glProvokingVertex") + } + gpPushDebugGroup = (C.GPPUSHDEBUGGROUP)(getProcAddr("glPushDebugGroup")) + gpPushDebugGroupKHR = (C.GPPUSHDEBUGGROUPKHR)(getProcAddr("glPushDebugGroupKHR")) + gpQueryCounter = (C.GPQUERYCOUNTER)(getProcAddr("glQueryCounter")) + if gpQueryCounter == nil { + return errors.New("glQueryCounter") + } + gpReadBuffer = (C.GPREADBUFFER)(getProcAddr("glReadBuffer")) + if gpReadBuffer == nil { + return errors.New("glReadBuffer") + } + gpReadPixels = (C.GPREADPIXELS)(getProcAddr("glReadPixels")) + if gpReadPixels == nil { + return errors.New("glReadPixels") + } + gpReadnPixels = (C.GPREADNPIXELS)(getProcAddr("glReadnPixels")) + gpReadnPixelsARB = (C.GPREADNPIXELSARB)(getProcAddr("glReadnPixelsARB")) + gpReadnPixelsKHR = (C.GPREADNPIXELSKHR)(getProcAddr("glReadnPixelsKHR")) + gpReleaseShaderCompiler = (C.GPRELEASESHADERCOMPILER)(getProcAddr("glReleaseShaderCompiler")) + gpRenderbufferStorage = (C.GPRENDERBUFFERSTORAGE)(getProcAddr("glRenderbufferStorage")) + if gpRenderbufferStorage == nil { + return errors.New("glRenderbufferStorage") + } + gpRenderbufferStorageMultisample = (C.GPRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr("glRenderbufferStorageMultisample")) + if gpRenderbufferStorageMultisample == nil { + return errors.New("glRenderbufferStorageMultisample") + } + gpResumeTransformFeedback = (C.GPRESUMETRANSFORMFEEDBACK)(getProcAddr("glResumeTransformFeedback")) + gpSampleCoverage = (C.GPSAMPLECOVERAGE)(getProcAddr("glSampleCoverage")) + if gpSampleCoverage == nil { + return errors.New("glSampleCoverage") + } + gpSampleMaski = (C.GPSAMPLEMASKI)(getProcAddr("glSampleMaski")) + if gpSampleMaski == nil { + return errors.New("glSampleMaski") + } + gpSamplerParameterIiv = (C.GPSAMPLERPARAMETERIIV)(getProcAddr("glSamplerParameterIiv")) + if gpSamplerParameterIiv == nil { + return errors.New("glSamplerParameterIiv") + } + gpSamplerParameterIuiv = (C.GPSAMPLERPARAMETERIUIV)(getProcAddr("glSamplerParameterIuiv")) + if gpSamplerParameterIuiv == nil { + return errors.New("glSamplerParameterIuiv") + } + gpSamplerParameterf = (C.GPSAMPLERPARAMETERF)(getProcAddr("glSamplerParameterf")) + if gpSamplerParameterf == nil { + return errors.New("glSamplerParameterf") + } + gpSamplerParameterfv = (C.GPSAMPLERPARAMETERFV)(getProcAddr("glSamplerParameterfv")) + if gpSamplerParameterfv == nil { + return errors.New("glSamplerParameterfv") + } + gpSamplerParameteri = (C.GPSAMPLERPARAMETERI)(getProcAddr("glSamplerParameteri")) + if gpSamplerParameteri == nil { + return errors.New("glSamplerParameteri") + } + gpSamplerParameteriv = (C.GPSAMPLERPARAMETERIV)(getProcAddr("glSamplerParameteriv")) + if gpSamplerParameteriv == nil { + return errors.New("glSamplerParameteriv") + } + gpScissor = (C.GPSCISSOR)(getProcAddr("glScissor")) + if gpScissor == nil { + return errors.New("glScissor") + } + gpScissorArrayv = (C.GPSCISSORARRAYV)(getProcAddr("glScissorArrayv")) + gpScissorIndexed = (C.GPSCISSORINDEXED)(getProcAddr("glScissorIndexed")) + gpScissorIndexedv = (C.GPSCISSORINDEXEDV)(getProcAddr("glScissorIndexedv")) + gpShaderBinary = (C.GPSHADERBINARY)(getProcAddr("glShaderBinary")) + gpShaderSource = (C.GPSHADERSOURCE)(getProcAddr("glShaderSource")) + if gpShaderSource == nil { + return errors.New("glShaderSource") + } + gpShaderStorageBlockBinding = (C.GPSHADERSTORAGEBLOCKBINDING)(getProcAddr("glShaderStorageBlockBinding")) + gpStencilFunc = (C.GPSTENCILFUNC)(getProcAddr("glStencilFunc")) + if gpStencilFunc == nil { + return errors.New("glStencilFunc") + } + gpStencilFuncSeparate = (C.GPSTENCILFUNCSEPARATE)(getProcAddr("glStencilFuncSeparate")) + if gpStencilFuncSeparate == nil { + return errors.New("glStencilFuncSeparate") + } + gpStencilMask = (C.GPSTENCILMASK)(getProcAddr("glStencilMask")) + if gpStencilMask == nil { + return errors.New("glStencilMask") + } + gpStencilMaskSeparate = (C.GPSTENCILMASKSEPARATE)(getProcAddr("glStencilMaskSeparate")) + if gpStencilMaskSeparate == nil { + return errors.New("glStencilMaskSeparate") + } + gpStencilOp = (C.GPSTENCILOP)(getProcAddr("glStencilOp")) + if gpStencilOp == nil { + return errors.New("glStencilOp") + } + gpStencilOpSeparate = (C.GPSTENCILOPSEPARATE)(getProcAddr("glStencilOpSeparate")) + if gpStencilOpSeparate == nil { + return errors.New("glStencilOpSeparate") + } + gpTexBuffer = (C.GPTEXBUFFER)(getProcAddr("glTexBuffer")) + if gpTexBuffer == nil { + return errors.New("glTexBuffer") + } + gpTexBufferRange = (C.GPTEXBUFFERRANGE)(getProcAddr("glTexBufferRange")) + gpTexImage1D = (C.GPTEXIMAGE1D)(getProcAddr("glTexImage1D")) + if gpTexImage1D == nil { + return errors.New("glTexImage1D") + } + gpTexImage2D = (C.GPTEXIMAGE2D)(getProcAddr("glTexImage2D")) + if gpTexImage2D == nil { + return errors.New("glTexImage2D") + } + gpTexImage2DMultisample = (C.GPTEXIMAGE2DMULTISAMPLE)(getProcAddr("glTexImage2DMultisample")) + if gpTexImage2DMultisample == nil { + return errors.New("glTexImage2DMultisample") + } + gpTexImage3D = (C.GPTEXIMAGE3D)(getProcAddr("glTexImage3D")) + if gpTexImage3D == nil { + return errors.New("glTexImage3D") + } + gpTexImage3DMultisample = (C.GPTEXIMAGE3DMULTISAMPLE)(getProcAddr("glTexImage3DMultisample")) + if gpTexImage3DMultisample == nil { + return errors.New("glTexImage3DMultisample") + } + gpTexPageCommitmentARB = (C.GPTEXPAGECOMMITMENTARB)(getProcAddr("glTexPageCommitmentARB")) + gpTexParameterIiv = (C.GPTEXPARAMETERIIV)(getProcAddr("glTexParameterIiv")) + if gpTexParameterIiv == nil { + return errors.New("glTexParameterIiv") + } + gpTexParameterIuiv = (C.GPTEXPARAMETERIUIV)(getProcAddr("glTexParameterIuiv")) + if gpTexParameterIuiv == nil { + return errors.New("glTexParameterIuiv") + } + gpTexParameterf = (C.GPTEXPARAMETERF)(getProcAddr("glTexParameterf")) + if gpTexParameterf == nil { + return errors.New("glTexParameterf") + } + gpTexParameterfv = (C.GPTEXPARAMETERFV)(getProcAddr("glTexParameterfv")) + if gpTexParameterfv == nil { + return errors.New("glTexParameterfv") + } + gpTexParameteri = (C.GPTEXPARAMETERI)(getProcAddr("glTexParameteri")) + if gpTexParameteri == nil { + return errors.New("glTexParameteri") + } + gpTexParameteriv = (C.GPTEXPARAMETERIV)(getProcAddr("glTexParameteriv")) + if gpTexParameteriv == nil { + return errors.New("glTexParameteriv") + } + gpTexStorage1D = (C.GPTEXSTORAGE1D)(getProcAddr("glTexStorage1D")) + gpTexStorage2D = (C.GPTEXSTORAGE2D)(getProcAddr("glTexStorage2D")) + gpTexStorage2DMultisample = (C.GPTEXSTORAGE2DMULTISAMPLE)(getProcAddr("glTexStorage2DMultisample")) + gpTexStorage3D = (C.GPTEXSTORAGE3D)(getProcAddr("glTexStorage3D")) + gpTexStorage3DMultisample = (C.GPTEXSTORAGE3DMULTISAMPLE)(getProcAddr("glTexStorage3DMultisample")) + gpTexSubImage1D = (C.GPTEXSUBIMAGE1D)(getProcAddr("glTexSubImage1D")) + if gpTexSubImage1D == nil { + return errors.New("glTexSubImage1D") + } + gpTexSubImage2D = (C.GPTEXSUBIMAGE2D)(getProcAddr("glTexSubImage2D")) + if gpTexSubImage2D == nil { + return errors.New("glTexSubImage2D") + } + gpTexSubImage3D = (C.GPTEXSUBIMAGE3D)(getProcAddr("glTexSubImage3D")) + if gpTexSubImage3D == nil { + return errors.New("glTexSubImage3D") + } + gpTextureBarrier = (C.GPTEXTUREBARRIER)(getProcAddr("glTextureBarrier")) + gpTextureBuffer = (C.GPTEXTUREBUFFER)(getProcAddr("glTextureBuffer")) + gpTextureBufferRange = (C.GPTEXTUREBUFFERRANGE)(getProcAddr("glTextureBufferRange")) + gpTextureParameterIiv = (C.GPTEXTUREPARAMETERIIV)(getProcAddr("glTextureParameterIiv")) + gpTextureParameterIuiv = (C.GPTEXTUREPARAMETERIUIV)(getProcAddr("glTextureParameterIuiv")) + gpTextureParameterf = (C.GPTEXTUREPARAMETERF)(getProcAddr("glTextureParameterf")) + gpTextureParameterfv = (C.GPTEXTUREPARAMETERFV)(getProcAddr("glTextureParameterfv")) + gpTextureParameteri = (C.GPTEXTUREPARAMETERI)(getProcAddr("glTextureParameteri")) + gpTextureParameteriv = (C.GPTEXTUREPARAMETERIV)(getProcAddr("glTextureParameteriv")) + gpTextureStorage1D = (C.GPTEXTURESTORAGE1D)(getProcAddr("glTextureStorage1D")) + gpTextureStorage2D = (C.GPTEXTURESTORAGE2D)(getProcAddr("glTextureStorage2D")) + gpTextureStorage2DMultisample = (C.GPTEXTURESTORAGE2DMULTISAMPLE)(getProcAddr("glTextureStorage2DMultisample")) + gpTextureStorage3D = (C.GPTEXTURESTORAGE3D)(getProcAddr("glTextureStorage3D")) + gpTextureStorage3DMultisample = (C.GPTEXTURESTORAGE3DMULTISAMPLE)(getProcAddr("glTextureStorage3DMultisample")) + gpTextureSubImage1D = (C.GPTEXTURESUBIMAGE1D)(getProcAddr("glTextureSubImage1D")) + gpTextureSubImage2D = (C.GPTEXTURESUBIMAGE2D)(getProcAddr("glTextureSubImage2D")) + gpTextureSubImage3D = (C.GPTEXTURESUBIMAGE3D)(getProcAddr("glTextureSubImage3D")) + gpTextureView = (C.GPTEXTUREVIEW)(getProcAddr("glTextureView")) + gpTransformFeedbackBufferBase = (C.GPTRANSFORMFEEDBACKBUFFERBASE)(getProcAddr("glTransformFeedbackBufferBase")) + gpTransformFeedbackBufferRange = (C.GPTRANSFORMFEEDBACKBUFFERRANGE)(getProcAddr("glTransformFeedbackBufferRange")) + gpTransformFeedbackVaryings = (C.GPTRANSFORMFEEDBACKVARYINGS)(getProcAddr("glTransformFeedbackVaryings")) + if gpTransformFeedbackVaryings == nil { + return errors.New("glTransformFeedbackVaryings") + } + gpUniform1d = (C.GPUNIFORM1D)(getProcAddr("glUniform1d")) + gpUniform1dv = (C.GPUNIFORM1DV)(getProcAddr("glUniform1dv")) + gpUniform1f = (C.GPUNIFORM1F)(getProcAddr("glUniform1f")) + if gpUniform1f == nil { + return errors.New("glUniform1f") + } + gpUniform1fv = (C.GPUNIFORM1FV)(getProcAddr("glUniform1fv")) + if gpUniform1fv == nil { + return errors.New("glUniform1fv") + } + gpUniform1i = (C.GPUNIFORM1I)(getProcAddr("glUniform1i")) + if gpUniform1i == nil { + return errors.New("glUniform1i") + } + gpUniform1iv = (C.GPUNIFORM1IV)(getProcAddr("glUniform1iv")) + if gpUniform1iv == nil { + return errors.New("glUniform1iv") + } + gpUniform1ui = (C.GPUNIFORM1UI)(getProcAddr("glUniform1ui")) + if gpUniform1ui == nil { + return errors.New("glUniform1ui") + } + gpUniform1uiv = (C.GPUNIFORM1UIV)(getProcAddr("glUniform1uiv")) + if gpUniform1uiv == nil { + return errors.New("glUniform1uiv") + } + gpUniform2d = (C.GPUNIFORM2D)(getProcAddr("glUniform2d")) + gpUniform2dv = (C.GPUNIFORM2DV)(getProcAddr("glUniform2dv")) + gpUniform2f = (C.GPUNIFORM2F)(getProcAddr("glUniform2f")) + if gpUniform2f == nil { + return errors.New("glUniform2f") + } + gpUniform2fv = (C.GPUNIFORM2FV)(getProcAddr("glUniform2fv")) + if gpUniform2fv == nil { + return errors.New("glUniform2fv") + } + gpUniform2i = (C.GPUNIFORM2I)(getProcAddr("glUniform2i")) + if gpUniform2i == nil { + return errors.New("glUniform2i") + } + gpUniform2iv = (C.GPUNIFORM2IV)(getProcAddr("glUniform2iv")) + if gpUniform2iv == nil { + return errors.New("glUniform2iv") + } + gpUniform2ui = (C.GPUNIFORM2UI)(getProcAddr("glUniform2ui")) + if gpUniform2ui == nil { + return errors.New("glUniform2ui") + } + gpUniform2uiv = (C.GPUNIFORM2UIV)(getProcAddr("glUniform2uiv")) + if gpUniform2uiv == nil { + return errors.New("glUniform2uiv") + } + gpUniform3d = (C.GPUNIFORM3D)(getProcAddr("glUniform3d")) + gpUniform3dv = (C.GPUNIFORM3DV)(getProcAddr("glUniform3dv")) + gpUniform3f = (C.GPUNIFORM3F)(getProcAddr("glUniform3f")) + if gpUniform3f == nil { + return errors.New("glUniform3f") + } + gpUniform3fv = (C.GPUNIFORM3FV)(getProcAddr("glUniform3fv")) + if gpUniform3fv == nil { + return errors.New("glUniform3fv") + } + gpUniform3i = (C.GPUNIFORM3I)(getProcAddr("glUniform3i")) + if gpUniform3i == nil { + return errors.New("glUniform3i") + } + gpUniform3iv = (C.GPUNIFORM3IV)(getProcAddr("glUniform3iv")) + if gpUniform3iv == nil { + return errors.New("glUniform3iv") + } + gpUniform3ui = (C.GPUNIFORM3UI)(getProcAddr("glUniform3ui")) + if gpUniform3ui == nil { + return errors.New("glUniform3ui") + } + gpUniform3uiv = (C.GPUNIFORM3UIV)(getProcAddr("glUniform3uiv")) + if gpUniform3uiv == nil { + return errors.New("glUniform3uiv") + } + gpUniform4d = (C.GPUNIFORM4D)(getProcAddr("glUniform4d")) + gpUniform4dv = (C.GPUNIFORM4DV)(getProcAddr("glUniform4dv")) + gpUniform4f = (C.GPUNIFORM4F)(getProcAddr("glUniform4f")) + if gpUniform4f == nil { + return errors.New("glUniform4f") + } + gpUniform4fv = (C.GPUNIFORM4FV)(getProcAddr("glUniform4fv")) + if gpUniform4fv == nil { + return errors.New("glUniform4fv") + } + gpUniform4i = (C.GPUNIFORM4I)(getProcAddr("glUniform4i")) + if gpUniform4i == nil { + return errors.New("glUniform4i") + } + gpUniform4iv = (C.GPUNIFORM4IV)(getProcAddr("glUniform4iv")) + if gpUniform4iv == nil { + return errors.New("glUniform4iv") + } + gpUniform4ui = (C.GPUNIFORM4UI)(getProcAddr("glUniform4ui")) + if gpUniform4ui == nil { + return errors.New("glUniform4ui") + } + gpUniform4uiv = (C.GPUNIFORM4UIV)(getProcAddr("glUniform4uiv")) + if gpUniform4uiv == nil { + return errors.New("glUniform4uiv") + } + gpUniformBlockBinding = (C.GPUNIFORMBLOCKBINDING)(getProcAddr("glUniformBlockBinding")) + if gpUniformBlockBinding == nil { + return errors.New("glUniformBlockBinding") + } + gpUniformHandleui64ARB = (C.GPUNIFORMHANDLEUI64ARB)(getProcAddr("glUniformHandleui64ARB")) + gpUniformHandleui64vARB = (C.GPUNIFORMHANDLEUI64VARB)(getProcAddr("glUniformHandleui64vARB")) + gpUniformMatrix2dv = (C.GPUNIFORMMATRIX2DV)(getProcAddr("glUniformMatrix2dv")) + gpUniformMatrix2fv = (C.GPUNIFORMMATRIX2FV)(getProcAddr("glUniformMatrix2fv")) + if gpUniformMatrix2fv == nil { + return errors.New("glUniformMatrix2fv") + } + gpUniformMatrix2x3dv = (C.GPUNIFORMMATRIX2X3DV)(getProcAddr("glUniformMatrix2x3dv")) + gpUniformMatrix2x3fv = (C.GPUNIFORMMATRIX2X3FV)(getProcAddr("glUniformMatrix2x3fv")) + if gpUniformMatrix2x3fv == nil { + return errors.New("glUniformMatrix2x3fv") + } + gpUniformMatrix2x4dv = (C.GPUNIFORMMATRIX2X4DV)(getProcAddr("glUniformMatrix2x4dv")) + gpUniformMatrix2x4fv = (C.GPUNIFORMMATRIX2X4FV)(getProcAddr("glUniformMatrix2x4fv")) + if gpUniformMatrix2x4fv == nil { + return errors.New("glUniformMatrix2x4fv") + } + gpUniformMatrix3dv = (C.GPUNIFORMMATRIX3DV)(getProcAddr("glUniformMatrix3dv")) + gpUniformMatrix3fv = (C.GPUNIFORMMATRIX3FV)(getProcAddr("glUniformMatrix3fv")) + if gpUniformMatrix3fv == nil { + return errors.New("glUniformMatrix3fv") + } + gpUniformMatrix3x2dv = (C.GPUNIFORMMATRIX3X2DV)(getProcAddr("glUniformMatrix3x2dv")) + gpUniformMatrix3x2fv = (C.GPUNIFORMMATRIX3X2FV)(getProcAddr("glUniformMatrix3x2fv")) + if gpUniformMatrix3x2fv == nil { + return errors.New("glUniformMatrix3x2fv") + } + gpUniformMatrix3x4dv = (C.GPUNIFORMMATRIX3X4DV)(getProcAddr("glUniformMatrix3x4dv")) + gpUniformMatrix3x4fv = (C.GPUNIFORMMATRIX3X4FV)(getProcAddr("glUniformMatrix3x4fv")) + if gpUniformMatrix3x4fv == nil { + return errors.New("glUniformMatrix3x4fv") + } + gpUniformMatrix4dv = (C.GPUNIFORMMATRIX4DV)(getProcAddr("glUniformMatrix4dv")) + gpUniformMatrix4fv = (C.GPUNIFORMMATRIX4FV)(getProcAddr("glUniformMatrix4fv")) + if gpUniformMatrix4fv == nil { + return errors.New("glUniformMatrix4fv") + } + gpUniformMatrix4x2dv = (C.GPUNIFORMMATRIX4X2DV)(getProcAddr("glUniformMatrix4x2dv")) + gpUniformMatrix4x2fv = (C.GPUNIFORMMATRIX4X2FV)(getProcAddr("glUniformMatrix4x2fv")) + if gpUniformMatrix4x2fv == nil { + return errors.New("glUniformMatrix4x2fv") + } + gpUniformMatrix4x3dv = (C.GPUNIFORMMATRIX4X3DV)(getProcAddr("glUniformMatrix4x3dv")) + gpUniformMatrix4x3fv = (C.GPUNIFORMMATRIX4X3FV)(getProcAddr("glUniformMatrix4x3fv")) + if gpUniformMatrix4x3fv == nil { + return errors.New("glUniformMatrix4x3fv") + } + gpUniformSubroutinesuiv = (C.GPUNIFORMSUBROUTINESUIV)(getProcAddr("glUniformSubroutinesuiv")) + gpUnmapBuffer = (C.GPUNMAPBUFFER)(getProcAddr("glUnmapBuffer")) + if gpUnmapBuffer == nil { + return errors.New("glUnmapBuffer") + } + gpUnmapNamedBuffer = (C.GPUNMAPNAMEDBUFFER)(getProcAddr("glUnmapNamedBuffer")) + gpUseProgram = (C.GPUSEPROGRAM)(getProcAddr("glUseProgram")) + if gpUseProgram == nil { + return errors.New("glUseProgram") + } + gpUseProgramStages = (C.GPUSEPROGRAMSTAGES)(getProcAddr("glUseProgramStages")) + gpValidateProgram = (C.GPVALIDATEPROGRAM)(getProcAddr("glValidateProgram")) + if gpValidateProgram == nil { + return errors.New("glValidateProgram") + } + gpValidateProgramPipeline = (C.GPVALIDATEPROGRAMPIPELINE)(getProcAddr("glValidateProgramPipeline")) + gpVertexArrayAttribBinding = (C.GPVERTEXARRAYATTRIBBINDING)(getProcAddr("glVertexArrayAttribBinding")) + gpVertexArrayAttribFormat = (C.GPVERTEXARRAYATTRIBFORMAT)(getProcAddr("glVertexArrayAttribFormat")) + gpVertexArrayAttribIFormat = (C.GPVERTEXARRAYATTRIBIFORMAT)(getProcAddr("glVertexArrayAttribIFormat")) + gpVertexArrayAttribLFormat = (C.GPVERTEXARRAYATTRIBLFORMAT)(getProcAddr("glVertexArrayAttribLFormat")) + gpVertexArrayBindingDivisor = (C.GPVERTEXARRAYBINDINGDIVISOR)(getProcAddr("glVertexArrayBindingDivisor")) + gpVertexArrayElementBuffer = (C.GPVERTEXARRAYELEMENTBUFFER)(getProcAddr("glVertexArrayElementBuffer")) + gpVertexArrayVertexBuffer = (C.GPVERTEXARRAYVERTEXBUFFER)(getProcAddr("glVertexArrayVertexBuffer")) + gpVertexArrayVertexBuffers = (C.GPVERTEXARRAYVERTEXBUFFERS)(getProcAddr("glVertexArrayVertexBuffers")) + gpVertexAttrib1d = (C.GPVERTEXATTRIB1D)(getProcAddr("glVertexAttrib1d")) + if gpVertexAttrib1d == nil { + return errors.New("glVertexAttrib1d") + } + gpVertexAttrib1dv = (C.GPVERTEXATTRIB1DV)(getProcAddr("glVertexAttrib1dv")) + if gpVertexAttrib1dv == nil { + return errors.New("glVertexAttrib1dv") + } + gpVertexAttrib1f = (C.GPVERTEXATTRIB1F)(getProcAddr("glVertexAttrib1f")) + if gpVertexAttrib1f == nil { + return errors.New("glVertexAttrib1f") + } + gpVertexAttrib1fv = (C.GPVERTEXATTRIB1FV)(getProcAddr("glVertexAttrib1fv")) + if gpVertexAttrib1fv == nil { + return errors.New("glVertexAttrib1fv") + } + gpVertexAttrib1s = (C.GPVERTEXATTRIB1S)(getProcAddr("glVertexAttrib1s")) + if gpVertexAttrib1s == nil { + return errors.New("glVertexAttrib1s") + } + gpVertexAttrib1sv = (C.GPVERTEXATTRIB1SV)(getProcAddr("glVertexAttrib1sv")) + if gpVertexAttrib1sv == nil { + return errors.New("glVertexAttrib1sv") + } + gpVertexAttrib2d = (C.GPVERTEXATTRIB2D)(getProcAddr("glVertexAttrib2d")) + if gpVertexAttrib2d == nil { + return errors.New("glVertexAttrib2d") + } + gpVertexAttrib2dv = (C.GPVERTEXATTRIB2DV)(getProcAddr("glVertexAttrib2dv")) + if gpVertexAttrib2dv == nil { + return errors.New("glVertexAttrib2dv") + } + gpVertexAttrib2f = (C.GPVERTEXATTRIB2F)(getProcAddr("glVertexAttrib2f")) + if gpVertexAttrib2f == nil { + return errors.New("glVertexAttrib2f") + } + gpVertexAttrib2fv = (C.GPVERTEXATTRIB2FV)(getProcAddr("glVertexAttrib2fv")) + if gpVertexAttrib2fv == nil { + return errors.New("glVertexAttrib2fv") + } + gpVertexAttrib2s = (C.GPVERTEXATTRIB2S)(getProcAddr("glVertexAttrib2s")) + if gpVertexAttrib2s == nil { + return errors.New("glVertexAttrib2s") + } + gpVertexAttrib2sv = (C.GPVERTEXATTRIB2SV)(getProcAddr("glVertexAttrib2sv")) + if gpVertexAttrib2sv == nil { + return errors.New("glVertexAttrib2sv") + } + gpVertexAttrib3d = (C.GPVERTEXATTRIB3D)(getProcAddr("glVertexAttrib3d")) + if gpVertexAttrib3d == nil { + return errors.New("glVertexAttrib3d") + } + gpVertexAttrib3dv = (C.GPVERTEXATTRIB3DV)(getProcAddr("glVertexAttrib3dv")) + if gpVertexAttrib3dv == nil { + return errors.New("glVertexAttrib3dv") + } + gpVertexAttrib3f = (C.GPVERTEXATTRIB3F)(getProcAddr("glVertexAttrib3f")) + if gpVertexAttrib3f == nil { + return errors.New("glVertexAttrib3f") + } + gpVertexAttrib3fv = (C.GPVERTEXATTRIB3FV)(getProcAddr("glVertexAttrib3fv")) + if gpVertexAttrib3fv == nil { + return errors.New("glVertexAttrib3fv") + } + gpVertexAttrib3s = (C.GPVERTEXATTRIB3S)(getProcAddr("glVertexAttrib3s")) + if gpVertexAttrib3s == nil { + return errors.New("glVertexAttrib3s") + } + gpVertexAttrib3sv = (C.GPVERTEXATTRIB3SV)(getProcAddr("glVertexAttrib3sv")) + if gpVertexAttrib3sv == nil { + return errors.New("glVertexAttrib3sv") + } + gpVertexAttrib4Nbv = (C.GPVERTEXATTRIB4NBV)(getProcAddr("glVertexAttrib4Nbv")) + if gpVertexAttrib4Nbv == nil { + return errors.New("glVertexAttrib4Nbv") + } + gpVertexAttrib4Niv = (C.GPVERTEXATTRIB4NIV)(getProcAddr("glVertexAttrib4Niv")) + if gpVertexAttrib4Niv == nil { + return errors.New("glVertexAttrib4Niv") + } + gpVertexAttrib4Nsv = (C.GPVERTEXATTRIB4NSV)(getProcAddr("glVertexAttrib4Nsv")) + if gpVertexAttrib4Nsv == nil { + return errors.New("glVertexAttrib4Nsv") + } + gpVertexAttrib4Nub = (C.GPVERTEXATTRIB4NUB)(getProcAddr("glVertexAttrib4Nub")) + if gpVertexAttrib4Nub == nil { + return errors.New("glVertexAttrib4Nub") + } + gpVertexAttrib4Nubv = (C.GPVERTEXATTRIB4NUBV)(getProcAddr("glVertexAttrib4Nubv")) + if gpVertexAttrib4Nubv == nil { + return errors.New("glVertexAttrib4Nubv") + } + gpVertexAttrib4Nuiv = (C.GPVERTEXATTRIB4NUIV)(getProcAddr("glVertexAttrib4Nuiv")) + if gpVertexAttrib4Nuiv == nil { + return errors.New("glVertexAttrib4Nuiv") + } + gpVertexAttrib4Nusv = (C.GPVERTEXATTRIB4NUSV)(getProcAddr("glVertexAttrib4Nusv")) + if gpVertexAttrib4Nusv == nil { + return errors.New("glVertexAttrib4Nusv") + } + gpVertexAttrib4bv = (C.GPVERTEXATTRIB4BV)(getProcAddr("glVertexAttrib4bv")) + if gpVertexAttrib4bv == nil { + return errors.New("glVertexAttrib4bv") + } + gpVertexAttrib4d = (C.GPVERTEXATTRIB4D)(getProcAddr("glVertexAttrib4d")) + if gpVertexAttrib4d == nil { + return errors.New("glVertexAttrib4d") + } + gpVertexAttrib4dv = (C.GPVERTEXATTRIB4DV)(getProcAddr("glVertexAttrib4dv")) + if gpVertexAttrib4dv == nil { + return errors.New("glVertexAttrib4dv") + } + gpVertexAttrib4f = (C.GPVERTEXATTRIB4F)(getProcAddr("glVertexAttrib4f")) + if gpVertexAttrib4f == nil { + return errors.New("glVertexAttrib4f") + } + gpVertexAttrib4fv = (C.GPVERTEXATTRIB4FV)(getProcAddr("glVertexAttrib4fv")) + if gpVertexAttrib4fv == nil { + return errors.New("glVertexAttrib4fv") + } + gpVertexAttrib4iv = (C.GPVERTEXATTRIB4IV)(getProcAddr("glVertexAttrib4iv")) + if gpVertexAttrib4iv == nil { + return errors.New("glVertexAttrib4iv") + } + gpVertexAttrib4s = (C.GPVERTEXATTRIB4S)(getProcAddr("glVertexAttrib4s")) + if gpVertexAttrib4s == nil { + return errors.New("glVertexAttrib4s") + } + gpVertexAttrib4sv = (C.GPVERTEXATTRIB4SV)(getProcAddr("glVertexAttrib4sv")) + if gpVertexAttrib4sv == nil { + return errors.New("glVertexAttrib4sv") + } + gpVertexAttrib4ubv = (C.GPVERTEXATTRIB4UBV)(getProcAddr("glVertexAttrib4ubv")) + if gpVertexAttrib4ubv == nil { + return errors.New("glVertexAttrib4ubv") + } + gpVertexAttrib4uiv = (C.GPVERTEXATTRIB4UIV)(getProcAddr("glVertexAttrib4uiv")) + if gpVertexAttrib4uiv == nil { + return errors.New("glVertexAttrib4uiv") + } + gpVertexAttrib4usv = (C.GPVERTEXATTRIB4USV)(getProcAddr("glVertexAttrib4usv")) + if gpVertexAttrib4usv == nil { + return errors.New("glVertexAttrib4usv") + } + gpVertexAttribBinding = (C.GPVERTEXATTRIBBINDING)(getProcAddr("glVertexAttribBinding")) + gpVertexAttribDivisor = (C.GPVERTEXATTRIBDIVISOR)(getProcAddr("glVertexAttribDivisor")) + if gpVertexAttribDivisor == nil { + return errors.New("glVertexAttribDivisor") + } + gpVertexAttribFormat = (C.GPVERTEXATTRIBFORMAT)(getProcAddr("glVertexAttribFormat")) + gpVertexAttribI1i = (C.GPVERTEXATTRIBI1I)(getProcAddr("glVertexAttribI1i")) + if gpVertexAttribI1i == nil { + return errors.New("glVertexAttribI1i") + } + gpVertexAttribI1iv = (C.GPVERTEXATTRIBI1IV)(getProcAddr("glVertexAttribI1iv")) + if gpVertexAttribI1iv == nil { + return errors.New("glVertexAttribI1iv") + } + gpVertexAttribI1ui = (C.GPVERTEXATTRIBI1UI)(getProcAddr("glVertexAttribI1ui")) + if gpVertexAttribI1ui == nil { + return errors.New("glVertexAttribI1ui") + } + gpVertexAttribI1uiv = (C.GPVERTEXATTRIBI1UIV)(getProcAddr("glVertexAttribI1uiv")) + if gpVertexAttribI1uiv == nil { + return errors.New("glVertexAttribI1uiv") + } + gpVertexAttribI2i = (C.GPVERTEXATTRIBI2I)(getProcAddr("glVertexAttribI2i")) + if gpVertexAttribI2i == nil { + return errors.New("glVertexAttribI2i") + } + gpVertexAttribI2iv = (C.GPVERTEXATTRIBI2IV)(getProcAddr("glVertexAttribI2iv")) + if gpVertexAttribI2iv == nil { + return errors.New("glVertexAttribI2iv") + } + gpVertexAttribI2ui = (C.GPVERTEXATTRIBI2UI)(getProcAddr("glVertexAttribI2ui")) + if gpVertexAttribI2ui == nil { + return errors.New("glVertexAttribI2ui") + } + gpVertexAttribI2uiv = (C.GPVERTEXATTRIBI2UIV)(getProcAddr("glVertexAttribI2uiv")) + if gpVertexAttribI2uiv == nil { + return errors.New("glVertexAttribI2uiv") + } + gpVertexAttribI3i = (C.GPVERTEXATTRIBI3I)(getProcAddr("glVertexAttribI3i")) + if gpVertexAttribI3i == nil { + return errors.New("glVertexAttribI3i") + } + gpVertexAttribI3iv = (C.GPVERTEXATTRIBI3IV)(getProcAddr("glVertexAttribI3iv")) + if gpVertexAttribI3iv == nil { + return errors.New("glVertexAttribI3iv") + } + gpVertexAttribI3ui = (C.GPVERTEXATTRIBI3UI)(getProcAddr("glVertexAttribI3ui")) + if gpVertexAttribI3ui == nil { + return errors.New("glVertexAttribI3ui") + } + gpVertexAttribI3uiv = (C.GPVERTEXATTRIBI3UIV)(getProcAddr("glVertexAttribI3uiv")) + if gpVertexAttribI3uiv == nil { + return errors.New("glVertexAttribI3uiv") + } + gpVertexAttribI4bv = (C.GPVERTEXATTRIBI4BV)(getProcAddr("glVertexAttribI4bv")) + if gpVertexAttribI4bv == nil { + return errors.New("glVertexAttribI4bv") + } + gpVertexAttribI4i = (C.GPVERTEXATTRIBI4I)(getProcAddr("glVertexAttribI4i")) + if gpVertexAttribI4i == nil { + return errors.New("glVertexAttribI4i") + } + gpVertexAttribI4iv = (C.GPVERTEXATTRIBI4IV)(getProcAddr("glVertexAttribI4iv")) + if gpVertexAttribI4iv == nil { + return errors.New("glVertexAttribI4iv") + } + gpVertexAttribI4sv = (C.GPVERTEXATTRIBI4SV)(getProcAddr("glVertexAttribI4sv")) + if gpVertexAttribI4sv == nil { + return errors.New("glVertexAttribI4sv") + } + gpVertexAttribI4ubv = (C.GPVERTEXATTRIBI4UBV)(getProcAddr("glVertexAttribI4ubv")) + if gpVertexAttribI4ubv == nil { + return errors.New("glVertexAttribI4ubv") + } + gpVertexAttribI4ui = (C.GPVERTEXATTRIBI4UI)(getProcAddr("glVertexAttribI4ui")) + if gpVertexAttribI4ui == nil { + return errors.New("glVertexAttribI4ui") + } + gpVertexAttribI4uiv = (C.GPVERTEXATTRIBI4UIV)(getProcAddr("glVertexAttribI4uiv")) + if gpVertexAttribI4uiv == nil { + return errors.New("glVertexAttribI4uiv") + } + gpVertexAttribI4usv = (C.GPVERTEXATTRIBI4USV)(getProcAddr("glVertexAttribI4usv")) + if gpVertexAttribI4usv == nil { + return errors.New("glVertexAttribI4usv") + } + gpVertexAttribIFormat = (C.GPVERTEXATTRIBIFORMAT)(getProcAddr("glVertexAttribIFormat")) + gpVertexAttribIPointer = (C.GPVERTEXATTRIBIPOINTER)(getProcAddr("glVertexAttribIPointer")) + if gpVertexAttribIPointer == nil { + return errors.New("glVertexAttribIPointer") + } + gpVertexAttribL1d = (C.GPVERTEXATTRIBL1D)(getProcAddr("glVertexAttribL1d")) + gpVertexAttribL1dv = (C.GPVERTEXATTRIBL1DV)(getProcAddr("glVertexAttribL1dv")) + gpVertexAttribL1ui64ARB = (C.GPVERTEXATTRIBL1UI64ARB)(getProcAddr("glVertexAttribL1ui64ARB")) + gpVertexAttribL1ui64vARB = (C.GPVERTEXATTRIBL1UI64VARB)(getProcAddr("glVertexAttribL1ui64vARB")) + gpVertexAttribL2d = (C.GPVERTEXATTRIBL2D)(getProcAddr("glVertexAttribL2d")) + gpVertexAttribL2dv = (C.GPVERTEXATTRIBL2DV)(getProcAddr("glVertexAttribL2dv")) + gpVertexAttribL3d = (C.GPVERTEXATTRIBL3D)(getProcAddr("glVertexAttribL3d")) + gpVertexAttribL3dv = (C.GPVERTEXATTRIBL3DV)(getProcAddr("glVertexAttribL3dv")) + gpVertexAttribL4d = (C.GPVERTEXATTRIBL4D)(getProcAddr("glVertexAttribL4d")) + gpVertexAttribL4dv = (C.GPVERTEXATTRIBL4DV)(getProcAddr("glVertexAttribL4dv")) + gpVertexAttribLFormat = (C.GPVERTEXATTRIBLFORMAT)(getProcAddr("glVertexAttribLFormat")) + gpVertexAttribLPointer = (C.GPVERTEXATTRIBLPOINTER)(getProcAddr("glVertexAttribLPointer")) + gpVertexAttribP1ui = (C.GPVERTEXATTRIBP1UI)(getProcAddr("glVertexAttribP1ui")) + if gpVertexAttribP1ui == nil { + return errors.New("glVertexAttribP1ui") + } + gpVertexAttribP1uiv = (C.GPVERTEXATTRIBP1UIV)(getProcAddr("glVertexAttribP1uiv")) + if gpVertexAttribP1uiv == nil { + return errors.New("glVertexAttribP1uiv") + } + gpVertexAttribP2ui = (C.GPVERTEXATTRIBP2UI)(getProcAddr("glVertexAttribP2ui")) + if gpVertexAttribP2ui == nil { + return errors.New("glVertexAttribP2ui") + } + gpVertexAttribP2uiv = (C.GPVERTEXATTRIBP2UIV)(getProcAddr("glVertexAttribP2uiv")) + if gpVertexAttribP2uiv == nil { + return errors.New("glVertexAttribP2uiv") + } + gpVertexAttribP3ui = (C.GPVERTEXATTRIBP3UI)(getProcAddr("glVertexAttribP3ui")) + if gpVertexAttribP3ui == nil { + return errors.New("glVertexAttribP3ui") + } + gpVertexAttribP3uiv = (C.GPVERTEXATTRIBP3UIV)(getProcAddr("glVertexAttribP3uiv")) + if gpVertexAttribP3uiv == nil { + return errors.New("glVertexAttribP3uiv") + } + gpVertexAttribP4ui = (C.GPVERTEXATTRIBP4UI)(getProcAddr("glVertexAttribP4ui")) + if gpVertexAttribP4ui == nil { + return errors.New("glVertexAttribP4ui") + } + gpVertexAttribP4uiv = (C.GPVERTEXATTRIBP4UIV)(getProcAddr("glVertexAttribP4uiv")) + if gpVertexAttribP4uiv == nil { + return errors.New("glVertexAttribP4uiv") + } + gpVertexAttribPointer = (C.GPVERTEXATTRIBPOINTER)(getProcAddr("glVertexAttribPointer")) + if gpVertexAttribPointer == nil { + return errors.New("glVertexAttribPointer") + } + gpVertexBindingDivisor = (C.GPVERTEXBINDINGDIVISOR)(getProcAddr("glVertexBindingDivisor")) + gpViewport = (C.GPVIEWPORT)(getProcAddr("glViewport")) + if gpViewport == nil { + return errors.New("glViewport") + } + gpViewportArrayv = (C.GPVIEWPORTARRAYV)(getProcAddr("glViewportArrayv")) + gpViewportIndexedf = (C.GPVIEWPORTINDEXEDF)(getProcAddr("glViewportIndexedf")) + gpViewportIndexedfv = (C.GPVIEWPORTINDEXEDFV)(getProcAddr("glViewportIndexedfv")) + gpWaitSync = (C.GPWAITSYNC)(getProcAddr("glWaitSync")) + if gpWaitSync == nil { + return errors.New("glWaitSync") + } + return nil +} diff --git a/vendor/github.com/go-gl/gl/v3.3-core/gl/procaddr.go b/vendor/github.com/go-gl/gl/v3.3-core/gl/procaddr.go new file mode 100644 index 0000000..de68e2e --- /dev/null +++ b/vendor/github.com/go-gl/gl/v3.3-core/gl/procaddr.go @@ -0,0 +1,65 @@ +// This file implements GlowGetProcAddress for every supported platform. The +// correct version is chosen automatically based on build tags: +// windows: WGL +// darwin: CGL +// linux freebsd: GLX +// Use of EGL instead of the platform's default (listed above) is made possible +// via the "egl" build tag. +// It is also possible to install your own function outside this package for +// retrieving OpenGL function pointers, to do this see InitWithProcAddrFunc. +package gl + +/* +#cgo windows CFLAGS: -DTAG_WINDOWS +#cgo windows LDFLAGS: -lopengl32 +#cgo darwin CFLAGS: -DTAG_DARWIN +#cgo darwin LDFLAGS: -framework OpenGL +#cgo linux freebsd CFLAGS: -DTAG_POSIX +#cgo linux freebsd LDFLAGS: -lGL +#cgo egl CFLAGS: -DTAG_EGL +#cgo egl LDFLAGS: -lEGL +// Check the EGL tag first as it takes priority over the platform's default +// configuration of WGL/GLX/CGL. +#if defined(TAG_EGL) + #include + #include + void* GlowGetProcAddress_glcore33(const char* name) { + return eglGetProcAddress(name); + } +#elif defined(TAG_WINDOWS) + #define WIN32_LEAN_AND_MEAN 1 + #include + #include + static HMODULE ogl32dll = NULL; + void* GlowGetProcAddress_glcore33(const char* name) { + void* pf = wglGetProcAddress((LPCSTR) name); + if (pf) { + return pf; + } + if (ogl32dll == NULL) { + ogl32dll = LoadLibraryA("opengl32.dll"); + } + return GetProcAddress(ogl32dll, (LPCSTR) name); + } +#elif defined(TAG_DARWIN) + #include + #include + void* GlowGetProcAddress_glcore33(const char* name) { + return dlsym(RTLD_DEFAULT, name); + } +#elif defined(TAG_POSIX) + #include + #include + void* GlowGetProcAddress_glcore33(const char* name) { + return glXGetProcAddress(name); + } +#endif +*/ +import "C" +import "unsafe" + +func getProcAddress(namea string) unsafe.Pointer { + cname := C.CString(namea) + defer C.free(unsafe.Pointer(cname)) + return C.GlowGetProcAddress_glcore33(cname) +} diff --git a/vendor/github.com/go-gl/glfw/AUTHORS b/vendor/github.com/go-gl/glfw/AUTHORS new file mode 100644 index 0000000..852c0da --- /dev/null +++ b/vendor/github.com/go-gl/glfw/AUTHORS @@ -0,0 +1,10 @@ +# This is the official list of glfw3-go authors for copyright purposes. + +# Please keep the list sorted. + +Coşku Baş +Dmitri Shuralyov +James Gray +Peter Waller (github:pwaller) +Robin Eklind +Stephen Gutekanst diff --git a/vendor/github.com/go-gl/glfw/LICENSE b/vendor/github.com/go-gl/glfw/LICENSE new file mode 100644 index 0000000..d3afbe2 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The glfw3-go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/go-gl/glfw/v3.1/glfw/glfw/COPYING.txt b/vendor/github.com/go-gl/glfw/v3.1/glfw/glfw/COPYING.txt new file mode 100644 index 0000000..b30c701 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.1/glfw/glfw/COPYING.txt @@ -0,0 +1,22 @@ +Copyright (c) 2002-2006 Marcus Geelnard +Copyright (c) 2006-2010 Camilla Berglund + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/GLFW_C_REVISION.txt b/vendor/github.com/go-gl/glfw/v3.2/glfw/GLFW_C_REVISION.txt new file mode 100644 index 0000000..9a14f86 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/GLFW_C_REVISION.txt @@ -0,0 +1 @@ +999f3556fdd80983b10051746264489f2cb1ef16 diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/build.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/build.go new file mode 100644 index 0000000..e884cfe --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/build.go @@ -0,0 +1,43 @@ +package glfw + +/* +// Windows Build Tags +// ---------------- +// GLFW Options: +#cgo windows CFLAGS: -D_GLFW_WIN32 -Iglfw/deps/mingw + +// Linker Options: +#cgo windows LDFLAGS: -lopengl32 -lgdi32 + + +// Darwin Build Tags +// ---------------- +// GLFW Options: +#cgo darwin CFLAGS: -D_GLFW_COCOA -D_GLFW_USE_CHDIR -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations + +// Linker Options: +#cgo darwin LDFLAGS: -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo + + +// Linux Build Tags +// ---------------- +// GLFW Options: +#cgo linux,!wayland CFLAGS: -D_GLFW_X11 +#cgo linux,wayland CFLAGS: -D_GLFW_WAYLAND + +// Linker Options: +#cgo linux,!wayland LDFLAGS: -lGL -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama -ldl -lrt +#cgo linux,wayland LDFLAGS: -lGL -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama -ldl -lrt + + +// FreeBSD Build Tags +// ---------------- +// GLFW Options: +#cgo freebsd,!wayland CFLAGS: -D_GLFW_X11 -D_GLFW_HAS_GLXGETPROCADDRESSARB -D_GLFW_HAS_DLOPEN +#cgo freebsd,wayland CFLAGS: -D_GLFW_WAYLAND -D_GLFW_HAS_DLOPEN + +// Linker Options: +#cgo freebsd,!wayland LDFLAGS: -lGL -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama +#cgo freebsd,wayland LDFLAGS: -lGL -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -lm -lXinerama +*/ +import "C" diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw.go new file mode 100644 index 0000000..e7912b7 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw.go @@ -0,0 +1,11 @@ +package glfw + +/* +#include "glfw/src/context.c" +#include "glfw/src/init.c" +#include "glfw/src/input.c" +#include "glfw/src/monitor.c" +#include "glfw/src/vulkan.c" +#include "glfw/src/window.c" +*/ +import "C" diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_darwin.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_darwin.go new file mode 100644 index 0000000..49e6527 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_darwin.go @@ -0,0 +1,13 @@ +package glfw + +/* +#cgo CFLAGS: -x objective-c +#include "glfw/src/cocoa_init.m" +#include "glfw/src/cocoa_joystick.m" +#include "glfw/src/cocoa_monitor.m" +#include "glfw/src/cocoa_window.m" +#include "glfw/src/cocoa_time.c" +#include "glfw/src/posix_tls.c" +#include "glfw/src/nsgl_context.m" +*/ +import "C" diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go new file mode 100644 index 0000000..3eb0781 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go @@ -0,0 +1,28 @@ +// +build linux freebsd + +package glfw + +/* +#ifdef _GLFW_MIR + #include "glfw/src/mir_init.c" + #include "glfw/src/mir_monitor.c" + #include "glfw/src/mir_window.c" +#endif +#ifdef _GLFW_WAYLAND + #include "glfw/src/wl_init.c" + #include "glfw/src/wl_monitor.c" + #include "glfw/src/wl_window.c" +#endif +#ifdef _GLFW_X11 + #include "glfw/src/x11_init.c" + #include "glfw/src/x11_monitor.c" + #include "glfw/src/x11_window.c" + #include "glfw/src/glx_context.c" +#endif +#include "glfw/src/linux_joystick.c" +#include "glfw/src/posix_time.c" +#include "glfw/src/posix_tls.c" +#include "glfw/src/xkb_unicode.c" +#include "glfw/src/egl_context.c" +*/ +import "C" diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_windows.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_windows.go new file mode 100644 index 0000000..a410ee5 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/c_glfw_windows.go @@ -0,0 +1,13 @@ +package glfw + +/* +#include "glfw/src/win32_init.c" +#include "glfw/src/win32_joystick.c" +#include "glfw/src/win32_monitor.c" +#include "glfw/src/win32_time.c" +#include "glfw/src/win32_tls.c" +#include "glfw/src/win32_window.c" +#include "glfw/src/wgl_context.c" +#include "glfw/src/egl_context.c" +*/ +import "C" diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/context.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/context.go new file mode 100644 index 0000000..52ccd5d --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/context.go @@ -0,0 +1,77 @@ +package glfw + +//#include +//#include "glfw/include/GLFW/glfw3.h" +import "C" + +import ( + "unsafe" +) + +// MakeContextCurrent makes the context of the window current. +// Originally GLFW 3 passes a null pointer to detach the context. +// But since we're using receievers, DetachCurrentContext should +// be used instead. +func (w *Window) MakeContextCurrent() { + C.glfwMakeContextCurrent(w.data) + panicError() +} + +// DetachCurrentContext detaches the current context. +func DetachCurrentContext() { + C.glfwMakeContextCurrent(nil) + panicError() +} + +// GetCurrentContext returns the window whose context is current. +func GetCurrentContext() *Window { + w := C.glfwGetCurrentContext() + panicError() + if w == nil { + return nil + } + return windows.get(w) +} + +// SwapBuffers swaps the front and back buffers of the window. If the +// swap interval is greater than zero, the GPU driver waits the specified number +// of screen updates before swapping the buffers. +func (w *Window) SwapBuffers() { + C.glfwSwapBuffers(w.data) + panicError() +} + +// SwapInterval sets the swap interval for the current context, i.e. the number +// of screen updates to wait before swapping the buffers of a window and +// returning from SwapBuffers. This is sometimes called +// 'vertical synchronization', 'vertical retrace synchronization' or 'vsync'. +// +// Contexts that support either of the WGL_EXT_swap_control_tear and +// GLX_EXT_swap_control_tear extensions also accept negative swap intervals, +// which allow the driver to swap even if a frame arrives a little bit late. +// You can check for the presence of these extensions using +// ExtensionSupported. For more information about swap tearing, +// see the extension specifications. +// +// Some GPU drivers do not honor the requested swap interval, either because of +// user settings that override the request or due to bugs in the driver. +func SwapInterval(interval int) { + C.glfwSwapInterval(C.int(interval)) + panicError() +} + +// ExtensionSupported reports whether the specified OpenGL or context creation +// API extension is supported by the current context. For example, on Windows +// both the OpenGL and WGL extension strings are checked. +// +// As this functions searches one or more extension strings on each call, it is +// recommended that you cache its results if it's going to be used frequently. +// The extension strings will not change during the lifetime of a context, so +// there is no danger in doing this. +func ExtensionSupported(extension string) bool { + e := C.CString(extension) + defer C.free(unsafe.Pointer(e)) + ret := glfwbool(C.glfwExtensionSupported(e)) + panicError() + return ret +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/error.c b/vendor/github.com/go-gl/glfw/v3.2/glfw/error.c new file mode 100644 index 0000000..cb20a30 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/error.c @@ -0,0 +1,9 @@ +#include "_cgo_export.h" + +void glfwErrorCB(int code, const char *desc) { + goErrorCB(code, (char*)desc); +} + +void glfwSetErrorCallbackCB() { + glfwSetErrorCallback(glfwErrorCB); +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/error.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/error.go new file mode 100644 index 0000000..d7127c3 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/error.go @@ -0,0 +1,199 @@ +package glfw + +//#include "glfw/include/GLFW/glfw3.h" +//void glfwSetErrorCallbackCB(); +import "C" + +import ( + "fmt" + "log" +) + +// ErrorCode corresponds to an error code. +type ErrorCode int + +// Error codes that are translated to panics and the programmer should not +// expect to handle. +const ( + notInitialized ErrorCode = C.GLFW_NOT_INITIALIZED // GLFW has not been initialized. + noCurrentContext ErrorCode = C.GLFW_NO_CURRENT_CONTEXT // No context is current. + invalidEnum ErrorCode = C.GLFW_INVALID_ENUM // One of the enum parameters for the function was given an invalid enum. + invalidValue ErrorCode = C.GLFW_INVALID_VALUE // One of the parameters for the function was given an invalid value. + outOfMemory ErrorCode = C.GLFW_OUT_OF_MEMORY // A memory allocation failed. + platformError ErrorCode = C.GLFW_PLATFORM_ERROR // A platform-specific error occurred that does not match any of the more specific categories. +) + +const ( + // APIUnavailable is the error code used when GLFW could not find support + // for the requested client API on the system. + // + // The installed graphics driver does not support the requested client API, + // or does not support it via the chosen context creation backend. Below + // are a few examples. + // + // Some pre-installed Windows graphics drivers do not support OpenGL. AMD + // only supports OpenGL ES via EGL, while Nvidia and Intel only supports it + // via a WGL or GLX extension. OS X does not provide OpenGL ES at all. The + // Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the + // Nvidia binary driver. + APIUnavailable ErrorCode = C.GLFW_API_UNAVAILABLE + + // VersionUnavailable is the error code used when the requested OpenGL or + // OpenGL ES (including any requested profile or context option) is not + // available on this machine. + // + // The machine does not support your requirements. If your application is + // sufficiently flexible, downgrade your requirements and try again. + // Otherwise, inform the user that their machine does not match your + // requirements. + // + // Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if + // 5.0 comes out before the 4.x series gets that far, also fail with this + // error and not GLFW_INVALID_VALUE, because GLFW cannot know what future + // versions will exist. + VersionUnavailable ErrorCode = C.GLFW_VERSION_UNAVAILABLE + + // FormatUnavailable is the error code used for both window creation and + // clipboard querying format errors. + // + // If emitted during window creation, the requested pixel format is not + // supported. This means one or more hard constraints did not match any of + // the available pixel formats. If your application is sufficiently + // flexible, downgrade your requirements and try again. Otherwise, inform + // the user that their machine does not match your requirements. + // + // If emitted when querying the clipboard, the contents of the clipboard + // could not be converted to the requested format. You should ignore the + // error or report it to the user, as appropriate. + FormatUnavailable ErrorCode = C.GLFW_FORMAT_UNAVAILABLE +) + +func (e ErrorCode) String() string { + switch e { + case notInitialized: + return "NotInitialized" + case noCurrentContext: + return "NoCurrentContext" + case invalidEnum: + return "InvalidEnum" + case invalidValue: + return "InvalidValue" + case outOfMemory: + return "OutOfMemory" + case platformError: + return "PlatformError" + case APIUnavailable: + return "APIUnavailable" + case VersionUnavailable: + return "VersionUnavailable" + case FormatUnavailable: + return "FormatUnavailable" + default: + return fmt.Sprintf("ErrorCode(%d)", e) + } +} + +// Error holds error code and description. +type Error struct { + Code ErrorCode + Desc string +} + +// Error prints the error code and description in a readable format. +func (e *Error) Error() string { + return fmt.Sprintf("%s: %s", e.Code.String(), e.Desc) +} + +// Note: There are many cryptic caveats to proper error handling here. +// See: https://github.com/go-gl/glfw3/pull/86 + +// Holds the value of the last error. +var lastError = make(chan *Error, 1) + +//export goErrorCB +func goErrorCB(code C.int, desc *C.char) { + flushErrors() + err := &Error{ErrorCode(code), C.GoString(desc)} + select { + case lastError <- err: + default: + fmt.Println("GLFW: An uncaught error has occurred:", err) + fmt.Println("GLFW: Please report this bug in the Go package immediately.") + } +} + +// Set the glfw callback internally +func init() { + C.glfwSetErrorCallbackCB() +} + +// flushErrors is called by Terminate before it actually calls C.glfwTerminate, +// this ensures that any uncaught errors buffered in lastError are printed +// before the program exits. +func flushErrors() { + err := fetchError() + if err != nil { + fmt.Println("GLFW: An uncaught error has occurred:", err) + fmt.Println("GLFW: Please report this bug in the Go package immediately.") + } +} + +// acceptError fetches the next error from the error channel, it accepts only +// errors with one of the given error codes. If any other error is encountered, +// a panic will occur. +// +// Platform errors are always printed, for information why please see: +// +// https://github.com/go-gl/glfw/issues/127 +// +func acceptError(codes ...ErrorCode) error { + // Grab the next error, if there is one. + err := fetchError() + if err == nil { + return nil + } + + // Only if the error has the specific error code accepted by the caller, do + // we return the error. + for _, code := range codes { + if err.Code == code { + return err + } + } + + // The error isn't accepted by the caller. If the error code is not a code + // defined in the GLFW C documentation as a programmer error, then the + // caller should have accepted it. This is effectively a bug in this + // package. + switch err.Code { + case platformError: + log.Println(err) + return nil + case notInitialized, noCurrentContext, invalidEnum, invalidValue, outOfMemory: + panic(err) + default: + fmt.Println("GLFW: An invalid error was not accepted by the caller:", err) + fmt.Println("GLFW: Please report this bug in the Go package immediately.") + panic(err) + } +} + +// panicError is a helper used by functions which expect no errors (except +// programmer errors) to occur. It will panic if it finds any such error. +func panicError() { + err := acceptError() + if err != nil { + panic(err) + } +} + +// fetchError fetches the next error from the error channel, it does not block +// and returns nil if there is no error present. +func fetchError() *Error { + select { + case err := <-lastError: + return err + default: + return nil + } +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/glfw.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/glfw.go new file mode 100644 index 0000000..1c3c076 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/glfw.go @@ -0,0 +1,76 @@ +package glfw + +//#include "glfw/include/GLFW/glfw3.h" +import "C" + +// Version constants. +const ( + VersionMajor = C.GLFW_VERSION_MAJOR // This is incremented when the API is changed in non-compatible ways. + VersionMinor = C.GLFW_VERSION_MINOR // This is incremented when features are added to the API but it remains backward-compatible. + VersionRevision = C.GLFW_VERSION_REVISION // This is incremented when a bug fix release is made that does not contain any API changes. +) + +// Init initializes the GLFW library. Before most GLFW functions can be used, +// GLFW must be initialized, and before a program terminates GLFW should be +// terminated in order to free any resources allocated during or after +// initialization. +// +// If this function fails, it calls Terminate before returning. If it succeeds, +// you should call Terminate before the program exits. +// +// Additional calls to this function after successful initialization but before +// termination will succeed but will do nothing. +// +// This function may take several seconds to complete on some systems, while on +// other systems it may take only a fraction of a second to complete. +// +// On Mac OS X, this function will change the current directory of the +// application to the Contents/Resources subdirectory of the application's +// bundle, if present. +// +// This function may only be called from the main thread. +func Init() error { + C.glfwInit() + return acceptError(APIUnavailable) +} + +// Terminate destroys all remaining windows, frees any allocated resources and +// sets the library to an uninitialized state. Once this is called, you must +// again call Init successfully before you will be able to use most GLFW +// functions. +// +// If GLFW has been successfully initialized, this function should be called +// before the program exits. If initialization fails, there is no need to call +// this function, as it is called by Init before it returns failure. +// +// This function may only be called from the main thread. +func Terminate() { + flushErrors() + C.glfwTerminate() +} + +// GetVersion retrieves the major, minor and revision numbers of the GLFW +// library. It is intended for when you are using GLFW as a shared library and +// want to ensure that you are using the minimum required version. +// +// This function may be called before Init. +func GetVersion() (major, minor, revision int) { + var ( + maj C.int + min C.int + rev C.int + ) + + C.glfwGetVersion(&maj, &min, &rev) + return int(maj), int(min), int(rev) +} + +// GetVersionString returns a static string generated at compile-time according +// to which configuration macros were defined. This is intended for use when +// submitting bug reports, to allow developers to see which code paths are +// enabled in a binary. +// +// This function may be called before Init. +func GetVersionString() string { + return C.GoString(C.glfwGetVersionString()) +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/glfw/COPYING.txt b/vendor/github.com/go-gl/glfw/v3.2/glfw/glfw/COPYING.txt new file mode 100644 index 0000000..ad16462 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/glfw/COPYING.txt @@ -0,0 +1,22 @@ +Copyright (c) 2002-2006 Marcus Geelnard +Copyright (c) 2006-2016 Camilla Berglund + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/input.c b/vendor/github.com/go-gl/glfw/v3.2/glfw/input.c new file mode 100644 index 0000000..0b59286 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/input.c @@ -0,0 +1,81 @@ +#include "_cgo_export.h" + +void glfwJoystickCB(int joy, int event) { + goJoystickCB(joy, event); +} + +void glfwMouseButtonCB(GLFWwindow* window, int button, int action, int mods) { + goMouseButtonCB(window, button, action, mods); +} + +void glfwCursorPosCB(GLFWwindow* window, double xpos, double ypos) { + goCursorPosCB(window, xpos, ypos); +} + +void glfwCursorEnterCB(GLFWwindow* window, int entered) { + goCursorEnterCB(window, entered); +} + +void glfwScrollCB(GLFWwindow* window, double xoff, double yoff) { + goScrollCB(window, xoff, yoff); +} + +void glfwKeyCB(GLFWwindow* window, int key, int scancode, int action, int mods) { + goKeyCB(window, key, scancode, action, mods); +} + +void glfwCharCB(GLFWwindow* window, unsigned int character) { + goCharCB(window, character); +} + +void glfwCharModsCB(GLFWwindow* window, unsigned int character, int mods) { + goCharModsCB(window, character, mods); +} + +void glfwDropCB(GLFWwindow* window, int count, const char **names) { + goDropCB(window, count, (char**)names); +} + +void glfwSetJoystickCallbackCB() { + glfwSetJoystickCallback(glfwJoystickCB); +} + +void glfwSetKeyCallbackCB(GLFWwindow *window) { + glfwSetKeyCallback(window, glfwKeyCB); +} + +void glfwSetCharCallbackCB(GLFWwindow *window) { + glfwSetCharCallback(window, glfwCharCB); +} + +void glfwSetCharModsCallbackCB(GLFWwindow *window) { + glfwSetCharModsCallback(window, glfwCharModsCB); +} + +void glfwSetMouseButtonCallbackCB(GLFWwindow *window) { + glfwSetMouseButtonCallback(window, glfwMouseButtonCB); +} + +void glfwSetCursorPosCallbackCB(GLFWwindow *window) { + glfwSetCursorPosCallback(window, glfwCursorPosCB); +} + +void glfwSetCursorEnterCallbackCB(GLFWwindow *window) { + glfwSetCursorEnterCallback(window, glfwCursorEnterCB); +} + +void glfwSetScrollCallbackCB(GLFWwindow *window) { + glfwSetScrollCallback(window, glfwScrollCB); +} + +void glfwSetDropCallbackCB(GLFWwindow *window) { + glfwSetDropCallback(window, glfwDropCB); +} + +float GetAxisAtIndex(float *axis, int i) { + return axis[i]; +} + +unsigned char GetButtonsAtIndex(unsigned char *buttons, int i) { + return buttons[i]; +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/input.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/input.go new file mode 100644 index 0000000..fd21fed --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/input.go @@ -0,0 +1,696 @@ +package glfw + +//#include "glfw/include/GLFW/glfw3.h" +//void glfwSetJoystickCallbackCB(); +//void glfwSetKeyCallbackCB(GLFWwindow *window); +//void glfwSetCharCallbackCB(GLFWwindow *window); +//void glfwSetCharModsCallbackCB(GLFWwindow *window); +//void glfwSetMouseButtonCallbackCB(GLFWwindow *window); +//void glfwSetCursorPosCallbackCB(GLFWwindow *window); +//void glfwSetCursorEnterCallbackCB(GLFWwindow *window); +//void glfwSetScrollCallbackCB(GLFWwindow *window); +//void glfwSetDropCallbackCB(GLFWwindow *window); +//float GetAxisAtIndex(float *axis, int i); +//unsigned char GetButtonsAtIndex(unsigned char *buttons, int i); +import "C" + +import ( + "image" + "image/draw" + "unsafe" +) + +var fJoystickHolder func(joy, event int) + +// Joystick corresponds to a joystick. +type Joystick int + +// Joystick IDs. +const ( + Joystick1 Joystick = C.GLFW_JOYSTICK_1 + Joystick2 Joystick = C.GLFW_JOYSTICK_2 + Joystick3 Joystick = C.GLFW_JOYSTICK_3 + Joystick4 Joystick = C.GLFW_JOYSTICK_4 + Joystick5 Joystick = C.GLFW_JOYSTICK_5 + Joystick6 Joystick = C.GLFW_JOYSTICK_6 + Joystick7 Joystick = C.GLFW_JOYSTICK_7 + Joystick8 Joystick = C.GLFW_JOYSTICK_8 + Joystick9 Joystick = C.GLFW_JOYSTICK_9 + Joystick10 Joystick = C.GLFW_JOYSTICK_10 + Joystick11 Joystick = C.GLFW_JOYSTICK_11 + Joystick12 Joystick = C.GLFW_JOYSTICK_12 + Joystick13 Joystick = C.GLFW_JOYSTICK_13 + Joystick14 Joystick = C.GLFW_JOYSTICK_14 + Joystick15 Joystick = C.GLFW_JOYSTICK_15 + Joystick16 Joystick = C.GLFW_JOYSTICK_16 + JoystickLast Joystick = C.GLFW_JOYSTICK_LAST +) + +// Key corresponds to a keyboard key. +type Key int + +// These key codes are inspired by the USB HID Usage Tables v1.12 (p. 53-60), +// but re-arranged to map to 7-bit ASCII for printable keys (function keys are +// put in the 256+ range). +const ( + KeyUnknown Key = C.GLFW_KEY_UNKNOWN + KeySpace Key = C.GLFW_KEY_SPACE + KeyApostrophe Key = C.GLFW_KEY_APOSTROPHE + KeyComma Key = C.GLFW_KEY_COMMA + KeyMinus Key = C.GLFW_KEY_MINUS + KeyPeriod Key = C.GLFW_KEY_PERIOD + KeySlash Key = C.GLFW_KEY_SLASH + Key0 Key = C.GLFW_KEY_0 + Key1 Key = C.GLFW_KEY_1 + Key2 Key = C.GLFW_KEY_2 + Key3 Key = C.GLFW_KEY_3 + Key4 Key = C.GLFW_KEY_4 + Key5 Key = C.GLFW_KEY_5 + Key6 Key = C.GLFW_KEY_6 + Key7 Key = C.GLFW_KEY_7 + Key8 Key = C.GLFW_KEY_8 + Key9 Key = C.GLFW_KEY_9 + KeySemicolon Key = C.GLFW_KEY_SEMICOLON + KeyEqual Key = C.GLFW_KEY_EQUAL + KeyA Key = C.GLFW_KEY_A + KeyB Key = C.GLFW_KEY_B + KeyC Key = C.GLFW_KEY_C + KeyD Key = C.GLFW_KEY_D + KeyE Key = C.GLFW_KEY_E + KeyF Key = C.GLFW_KEY_F + KeyG Key = C.GLFW_KEY_G + KeyH Key = C.GLFW_KEY_H + KeyI Key = C.GLFW_KEY_I + KeyJ Key = C.GLFW_KEY_J + KeyK Key = C.GLFW_KEY_K + KeyL Key = C.GLFW_KEY_L + KeyM Key = C.GLFW_KEY_M + KeyN Key = C.GLFW_KEY_N + KeyO Key = C.GLFW_KEY_O + KeyP Key = C.GLFW_KEY_P + KeyQ Key = C.GLFW_KEY_Q + KeyR Key = C.GLFW_KEY_R + KeyS Key = C.GLFW_KEY_S + KeyT Key = C.GLFW_KEY_T + KeyU Key = C.GLFW_KEY_U + KeyV Key = C.GLFW_KEY_V + KeyW Key = C.GLFW_KEY_W + KeyX Key = C.GLFW_KEY_X + KeyY Key = C.GLFW_KEY_Y + KeyZ Key = C.GLFW_KEY_Z + KeyLeftBracket Key = C.GLFW_KEY_LEFT_BRACKET + KeyBackslash Key = C.GLFW_KEY_BACKSLASH + KeyRightBracket Key = C.GLFW_KEY_RIGHT_BRACKET + KeyGraveAccent Key = C.GLFW_KEY_GRAVE_ACCENT + KeyWorld1 Key = C.GLFW_KEY_WORLD_1 + KeyWorld2 Key = C.GLFW_KEY_WORLD_2 + KeyEscape Key = C.GLFW_KEY_ESCAPE + KeyEnter Key = C.GLFW_KEY_ENTER + KeyTab Key = C.GLFW_KEY_TAB + KeyBackspace Key = C.GLFW_KEY_BACKSPACE + KeyInsert Key = C.GLFW_KEY_INSERT + KeyDelete Key = C.GLFW_KEY_DELETE + KeyRight Key = C.GLFW_KEY_RIGHT + KeyLeft Key = C.GLFW_KEY_LEFT + KeyDown Key = C.GLFW_KEY_DOWN + KeyUp Key = C.GLFW_KEY_UP + KeyPageUp Key = C.GLFW_KEY_PAGE_UP + KeyPageDown Key = C.GLFW_KEY_PAGE_DOWN + KeyHome Key = C.GLFW_KEY_HOME + KeyEnd Key = C.GLFW_KEY_END + KeyCapsLock Key = C.GLFW_KEY_CAPS_LOCK + KeyScrollLock Key = C.GLFW_KEY_SCROLL_LOCK + KeyNumLock Key = C.GLFW_KEY_NUM_LOCK + KeyPrintScreen Key = C.GLFW_KEY_PRINT_SCREEN + KeyPause Key = C.GLFW_KEY_PAUSE + KeyF1 Key = C.GLFW_KEY_F1 + KeyF2 Key = C.GLFW_KEY_F2 + KeyF3 Key = C.GLFW_KEY_F3 + KeyF4 Key = C.GLFW_KEY_F4 + KeyF5 Key = C.GLFW_KEY_F5 + KeyF6 Key = C.GLFW_KEY_F6 + KeyF7 Key = C.GLFW_KEY_F7 + KeyF8 Key = C.GLFW_KEY_F8 + KeyF9 Key = C.GLFW_KEY_F9 + KeyF10 Key = C.GLFW_KEY_F10 + KeyF11 Key = C.GLFW_KEY_F11 + KeyF12 Key = C.GLFW_KEY_F12 + KeyF13 Key = C.GLFW_KEY_F13 + KeyF14 Key = C.GLFW_KEY_F14 + KeyF15 Key = C.GLFW_KEY_F15 + KeyF16 Key = C.GLFW_KEY_F16 + KeyF17 Key = C.GLFW_KEY_F17 + KeyF18 Key = C.GLFW_KEY_F18 + KeyF19 Key = C.GLFW_KEY_F19 + KeyF20 Key = C.GLFW_KEY_F20 + KeyF21 Key = C.GLFW_KEY_F21 + KeyF22 Key = C.GLFW_KEY_F22 + KeyF23 Key = C.GLFW_KEY_F23 + KeyF24 Key = C.GLFW_KEY_F24 + KeyF25 Key = C.GLFW_KEY_F25 + KeyKP0 Key = C.GLFW_KEY_KP_0 + KeyKP1 Key = C.GLFW_KEY_KP_1 + KeyKP2 Key = C.GLFW_KEY_KP_2 + KeyKP3 Key = C.GLFW_KEY_KP_3 + KeyKP4 Key = C.GLFW_KEY_KP_4 + KeyKP5 Key = C.GLFW_KEY_KP_5 + KeyKP6 Key = C.GLFW_KEY_KP_6 + KeyKP7 Key = C.GLFW_KEY_KP_7 + KeyKP8 Key = C.GLFW_KEY_KP_8 + KeyKP9 Key = C.GLFW_KEY_KP_9 + KeyKPDecimal Key = C.GLFW_KEY_KP_DECIMAL + KeyKPDivide Key = C.GLFW_KEY_KP_DIVIDE + KeyKPMultiply Key = C.GLFW_KEY_KP_MULTIPLY + KeyKPSubtract Key = C.GLFW_KEY_KP_SUBTRACT + KeyKPAdd Key = C.GLFW_KEY_KP_ADD + KeyKPEnter Key = C.GLFW_KEY_KP_ENTER + KeyKPEqual Key = C.GLFW_KEY_KP_EQUAL + KeyLeftShift Key = C.GLFW_KEY_LEFT_SHIFT + KeyLeftControl Key = C.GLFW_KEY_LEFT_CONTROL + KeyLeftAlt Key = C.GLFW_KEY_LEFT_ALT + KeyLeftSuper Key = C.GLFW_KEY_LEFT_SUPER + KeyRightShift Key = C.GLFW_KEY_RIGHT_SHIFT + KeyRightControl Key = C.GLFW_KEY_RIGHT_CONTROL + KeyRightAlt Key = C.GLFW_KEY_RIGHT_ALT + KeyRightSuper Key = C.GLFW_KEY_RIGHT_SUPER + KeyMenu Key = C.GLFW_KEY_MENU + KeyLast Key = C.GLFW_KEY_LAST +) + +// ModifierKey corresponds to a modifier key. +type ModifierKey int + +// Modifier keys. +const ( + ModShift ModifierKey = C.GLFW_MOD_SHIFT + ModControl ModifierKey = C.GLFW_MOD_CONTROL + ModAlt ModifierKey = C.GLFW_MOD_ALT + ModSuper ModifierKey = C.GLFW_MOD_SUPER +) + +// MouseButton corresponds to a mouse button. +type MouseButton int + +// Mouse buttons. +const ( + MouseButton1 MouseButton = C.GLFW_MOUSE_BUTTON_1 + MouseButton2 MouseButton = C.GLFW_MOUSE_BUTTON_2 + MouseButton3 MouseButton = C.GLFW_MOUSE_BUTTON_3 + MouseButton4 MouseButton = C.GLFW_MOUSE_BUTTON_4 + MouseButton5 MouseButton = C.GLFW_MOUSE_BUTTON_5 + MouseButton6 MouseButton = C.GLFW_MOUSE_BUTTON_6 + MouseButton7 MouseButton = C.GLFW_MOUSE_BUTTON_7 + MouseButton8 MouseButton = C.GLFW_MOUSE_BUTTON_8 + MouseButtonLast MouseButton = C.GLFW_MOUSE_BUTTON_LAST + MouseButtonLeft MouseButton = C.GLFW_MOUSE_BUTTON_LEFT + MouseButtonRight MouseButton = C.GLFW_MOUSE_BUTTON_RIGHT + MouseButtonMiddle MouseButton = C.GLFW_MOUSE_BUTTON_MIDDLE +) + +// StandardCursor corresponds to a standard cursor icon. +type StandardCursor int + +// Standard cursors +const ( + ArrowCursor StandardCursor = C.GLFW_ARROW_CURSOR + IBeamCursor StandardCursor = C.GLFW_IBEAM_CURSOR + CrosshairCursor StandardCursor = C.GLFW_CROSSHAIR_CURSOR + HandCursor StandardCursor = C.GLFW_HAND_CURSOR + HResizeCursor StandardCursor = C.GLFW_HRESIZE_CURSOR + VResizeCursor StandardCursor = C.GLFW_VRESIZE_CURSOR +) + +// Action corresponds to a key or button action. +type Action int + +// Action types. +const ( + Release Action = C.GLFW_RELEASE // The key or button was released. + Press Action = C.GLFW_PRESS // The key or button was pressed. + Repeat Action = C.GLFW_REPEAT // The key was held down until it repeated. +) + +// InputMode corresponds to an input mode. +type InputMode int + +// Input modes. +const ( + CursorMode InputMode = C.GLFW_CURSOR // See Cursor mode values + StickyKeysMode InputMode = C.GLFW_STICKY_KEYS // Value can be either 1 or 0 + StickyMouseButtonsMode InputMode = C.GLFW_STICKY_MOUSE_BUTTONS // Value can be either 1 or 0 +) + +// Cursor mode values. +const ( + CursorNormal int = C.GLFW_CURSOR_NORMAL + CursorHidden int = C.GLFW_CURSOR_HIDDEN + CursorDisabled int = C.GLFW_CURSOR_DISABLED +) + +// Cursor represents a cursor. +type Cursor struct { + data *C.GLFWcursor +} + +//export goJoystickCB +func goJoystickCB(joy, event C.int) { + fJoystickHolder(int(joy), int(event)) +} + +//export goMouseButtonCB +func goMouseButtonCB(window unsafe.Pointer, button, action, mods C.int) { + w := windows.get((*C.GLFWwindow)(window)) + w.fMouseButtonHolder(w, MouseButton(button), Action(action), ModifierKey(mods)) +} + +//export goCursorPosCB +func goCursorPosCB(window unsafe.Pointer, xpos, ypos C.double) { + w := windows.get((*C.GLFWwindow)(window)) + w.fCursorPosHolder(w, float64(xpos), float64(ypos)) +} + +//export goCursorEnterCB +func goCursorEnterCB(window unsafe.Pointer, entered C.int) { + w := windows.get((*C.GLFWwindow)(window)) + hasEntered := glfwbool(entered) + w.fCursorEnterHolder(w, hasEntered) +} + +//export goScrollCB +func goScrollCB(window unsafe.Pointer, xoff, yoff C.double) { + w := windows.get((*C.GLFWwindow)(window)) + w.fScrollHolder(w, float64(xoff), float64(yoff)) +} + +//export goKeyCB +func goKeyCB(window unsafe.Pointer, key, scancode, action, mods C.int) { + w := windows.get((*C.GLFWwindow)(window)) + w.fKeyHolder(w, Key(key), int(scancode), Action(action), ModifierKey(mods)) +} + +//export goCharCB +func goCharCB(window unsafe.Pointer, character C.uint) { + w := windows.get((*C.GLFWwindow)(window)) + w.fCharHolder(w, rune(character)) +} + +//export goCharModsCB +func goCharModsCB(window unsafe.Pointer, character C.uint, mods C.int) { + w := windows.get((*C.GLFWwindow)(window)) + w.fCharModsHolder(w, rune(character), ModifierKey(mods)) +} + +//export goDropCB +func goDropCB(window unsafe.Pointer, count C.int, names **C.char) { // TODO: The types of name can be `**C.char` or `unsafe.Pointer`, use whichever is better. + w := windows.get((*C.GLFWwindow)(window)) + namesSlice := make([]string, int(count)) // TODO: Make this better. This part is unfinished, hacky, probably not correct, and not idiomatic. + for i := 0; i < int(count); i++ { // TODO: Make this better. It should be cleaned up and vetted. + var x *C.char // TODO: Make this better. + p := (**C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(names)) + uintptr(i)*unsafe.Sizeof(x))) // TODO: Make this better. + namesSlice[i] = C.GoString(*p) // TODO: Make this better. + } + w.fDropHolder(w, namesSlice) +} + +// GetInputMode returns the value of an input option of the window. +func (w *Window) GetInputMode(mode InputMode) int { + ret := int(C.glfwGetInputMode(w.data, C.int(mode))) + panicError() + return ret +} + +// SetInputMode sets an input option for the window. +func (w *Window) SetInputMode(mode InputMode, value int) { + C.glfwSetInputMode(w.data, C.int(mode), C.int(value)) + panicError() +} + +// GetKey returns the last reported state of a keyboard key. The returned state +// is one of Press or Release. The higher-level state Repeat is only reported to +// the key callback. +// +// If the StickyKeys input mode is enabled, this function returns Press the first +// time you call this function after a key has been pressed, even if the key has +// already been released. +// +// The key functions deal with physical keys, with key tokens named after their +// use on the standard US keyboard layout. If you want to input text, use the +// Unicode character callback instead. +func (w *Window) GetKey(key Key) Action { + ret := Action(C.glfwGetKey(w.data, C.int(key))) + panicError() + return ret +} + +// GetKeyName returns the localized name of the specified printable key. +// +// If the key is glfw.KeyUnknown, the scancode is used, otherwise the scancode is ignored. +func GetKeyName(key Key, scancode int) string { + ret := C.glfwGetKeyName(C.int(key), C.int(scancode)) + panicError() + return C.GoString(ret) +} + +// GetMouseButton returns the last state reported for the specified mouse button. +// +// If the StickyMouseButtons input mode is enabled, this function returns Press +// the first time you call this function after a mouse button has been pressed, +// even if the mouse button has already been released. +func (w *Window) GetMouseButton(button MouseButton) Action { + ret := Action(C.glfwGetMouseButton(w.data, C.int(button))) + panicError() + return ret +} + +// GetCursorPos returns the last reported position of the cursor. +// +// If the cursor is disabled (with CursorDisabled) then the cursor position is +// unbounded and limited only by the minimum and maximum values of a double. +// +// The coordinate can be converted to their integer equivalents with the floor +// function. Casting directly to an integer type works for positive coordinates, +// but fails for negative ones. +func (w *Window) GetCursorPos() (x, y float64) { + var xpos, ypos C.double + C.glfwGetCursorPos(w.data, &xpos, &ypos) + panicError() + return float64(xpos), float64(ypos) +} + +// SetCursorPos sets the position of the cursor. The specified window must +// be focused. If the window does not have focus when this function is called, +// it fails silently. +// +// If the cursor is disabled (with CursorDisabled) then the cursor position is +// unbounded and limited only by the minimum and maximum values of a double. +func (w *Window) SetCursorPos(xpos, ypos float64) { + C.glfwSetCursorPos(w.data, C.double(xpos), C.double(ypos)) + panicError() +} + +// CreateCursor creates a new custom cursor image that can be set for a window with SetCursor. +// The cursor can be destroyed with Destroy. Any remaining cursors are destroyed by Terminate. +// +// The image is ideally provided in the form of *image.NRGBA. +// The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight +// bits per channel with the red channel first. They are arranged canonically +// as packed sequential rows, starting from the top-left corner. If the image +// type is not *image.NRGBA, it will be converted to it. +// +// The cursor hotspot is specified in pixels, relative to the upper-left corner of the cursor image. +// Like all other coordinate systems in GLFW, the X-axis points to the right and the Y-axis points down. +func CreateCursor(img image.Image, xhot, yhot int) *Cursor { + var imgC C.GLFWimage + var pixels []uint8 + b := img.Bounds() + + switch img := img.(type) { + case *image.NRGBA: + pixels = img.Pix + default: + m := image.NewNRGBA(image.Rect(0, 0, b.Dx(), b.Dy())) + draw.Draw(m, m.Bounds(), img, b.Min, draw.Src) + pixels = m.Pix + } + + pix, free := bytes(pixels) + + imgC.width = C.int(b.Dx()) + imgC.height = C.int(b.Dy()) + imgC.pixels = (*C.uchar)(pix) + + c := C.glfwCreateCursor(&imgC, C.int(xhot), C.int(yhot)) + + free() + panicError() + + return &Cursor{c} +} + +// CreateStandardCursor returns a cursor with a standard shape, +// that can be set for a window with SetCursor. +func CreateStandardCursor(shape StandardCursor) *Cursor { + c := C.glfwCreateStandardCursor(C.int(shape)) + panicError() + return &Cursor{c} +} + +// Destroy destroys a cursor previously created with CreateCursor. +// Any remaining cursors will be destroyed by Terminate. +func (c *Cursor) Destroy() { + C.glfwDestroyCursor(c.data) + panicError() +} + +// SetCursor sets the cursor image to be used when the cursor is over the client area +// of the specified window. The set cursor will only be visible when the cursor mode of the +// window is CursorNormal. +// +// On some platforms, the set cursor may not be visible unless the window also has input focus. +func (w *Window) SetCursor(c *Cursor) { + if c == nil { + C.glfwSetCursor(w.data, nil) + } else { + C.glfwSetCursor(w.data, c.data) + } + panicError() +} + +// JoystickCallback is the joystick configuration callback. +type JoystickCallback func(joy, event int) + +// SetJoystickCallback sets the joystick configuration callback, or removes the +// currently set callback. This is called when a joystick is connected to or +// disconnected from the system. +func SetJoystickCallback(cbfun JoystickCallback) (previous JoystickCallback) { + previous = fJoystickHolder + fJoystickHolder = cbfun + if cbfun == nil { + C.glfwSetJoystickCallback(nil) + } else { + C.glfwSetJoystickCallbackCB() + } + panicError() + return previous +} + +// KeyCallback is the key callback. +type KeyCallback func(w *Window, key Key, scancode int, action Action, mods ModifierKey) + +// SetKeyCallback sets the key callback which is called when a key is pressed, +// repeated or released. +// +// The key functions deal with physical keys, with layout independent key tokens +// named after their values in the standard US keyboard layout. If you want to +// input text, use the SetCharCallback instead. +// +// When a window loses focus, it will generate synthetic key release events for +// all pressed keys. You can tell these events from user-generated events by the +// fact that the synthetic ones are generated after the window has lost focus, +// i.e. Focused will be false and the focus callback will have already been +// called. +func (w *Window) SetKeyCallback(cbfun KeyCallback) (previous KeyCallback) { + previous = w.fKeyHolder + w.fKeyHolder = cbfun + if cbfun == nil { + C.glfwSetKeyCallback(w.data, nil) + } else { + C.glfwSetKeyCallbackCB(w.data) + } + panicError() + return previous +} + +// CharCallback is the character callback. +type CharCallback func(w *Window, char rune) + +// SetCharCallback sets the character callback which is called when a +// Unicode character is input. +// +// The character callback is intended for Unicode text input. As it deals with +// characters, it is keyboard layout dependent, whereas the +// key callback is not. Characters do not map 1:1 +// to physical keys, as a key may produce zero, one or more characters. If you +// want to know whether a specific physical key was pressed or released, see +// the key callback instead. +// +// The character callback behaves as system text input normally does and will +// not be called if modifier keys are held down that would prevent normal text +// input on that platform, for example a Super (Command) key on OS X or Alt key +// on Windows. There is a character with modifiers callback that receives these events. +func (w *Window) SetCharCallback(cbfun CharCallback) (previous CharCallback) { + previous = w.fCharHolder + w.fCharHolder = cbfun + if cbfun == nil { + C.glfwSetCharCallback(w.data, nil) + } else { + C.glfwSetCharCallbackCB(w.data) + } + panicError() + return previous +} + +// CharModsCallback is the character with modifiers callback. +type CharModsCallback func(w *Window, char rune, mods ModifierKey) + +// SetCharModsCallback sets the character with modifiers callback which is called when a +// Unicode character is input regardless of what modifier keys are used. +// +// The character with modifiers callback is intended for implementing custom +// Unicode character input. For regular Unicode text input, see the +// character callback. Like the character callback, the character with modifiers callback +// deals with characters and is keyboard layout dependent. Characters do not +// map 1:1 to physical keys, as a key may produce zero, one or more characters. +// If you want to know whether a specific physical key was pressed or released, +// see the key callback instead. +func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback) { + previous = w.fCharModsHolder + w.fCharModsHolder = cbfun + if cbfun == nil { + C.glfwSetCharModsCallback(w.data, nil) + } else { + C.glfwSetCharModsCallbackCB(w.data) + } + panicError() + return previous +} + +// MouseButtonCallback is the mouse button callback. +type MouseButtonCallback func(w *Window, button MouseButton, action Action, mod ModifierKey) + +// SetMouseButtonCallback sets the mouse button callback which is called when a +// mouse button is pressed or released. +// +// When a window loses focus, it will generate synthetic mouse button release +// events for all pressed mouse buttons. You can tell these events from +// user-generated events by the fact that the synthetic ones are generated after +// the window has lost focus, i.e. Focused will be false and the focus +// callback will have already been called. +func (w *Window) SetMouseButtonCallback(cbfun MouseButtonCallback) (previous MouseButtonCallback) { + previous = w.fMouseButtonHolder + w.fMouseButtonHolder = cbfun + if cbfun == nil { + C.glfwSetMouseButtonCallback(w.data, nil) + } else { + C.glfwSetMouseButtonCallbackCB(w.data) + } + panicError() + return previous +} + +// CursorPosCallback the cursor position callback. +type CursorPosCallback func(w *Window, xpos float64, ypos float64) + +// SetCursorPosCallback sets the cursor position callback which is called +// when the cursor is moved. The callback is provided with the position relative +// to the upper-left corner of the client area of the window. +func (w *Window) SetCursorPosCallback(cbfun CursorPosCallback) (previous CursorPosCallback) { + previous = w.fCursorPosHolder + w.fCursorPosHolder = cbfun + if cbfun == nil { + C.glfwSetCursorPosCallback(w.data, nil) + } else { + C.glfwSetCursorPosCallbackCB(w.data) + } + panicError() + return previous +} + +// CursorEnterCallback is the cursor boundary crossing callback. +type CursorEnterCallback func(w *Window, entered bool) + +// SetCursorEnterCallback the cursor boundary crossing callback which is called +// when the cursor enters or leaves the client area of the window. +func (w *Window) SetCursorEnterCallback(cbfun CursorEnterCallback) (previous CursorEnterCallback) { + previous = w.fCursorEnterHolder + w.fCursorEnterHolder = cbfun + if cbfun == nil { + C.glfwSetCursorEnterCallback(w.data, nil) + } else { + C.glfwSetCursorEnterCallbackCB(w.data) + } + panicError() + return previous +} + +// ScrollCallback is the scroll callback. +type ScrollCallback func(w *Window, xoff float64, yoff float64) + +// SetScrollCallback sets the scroll callback which is called when a scrolling +// device is used, such as a mouse wheel or scrolling area of a touchpad. +func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback) { + previous = w.fScrollHolder + w.fScrollHolder = cbfun + if cbfun == nil { + C.glfwSetScrollCallback(w.data, nil) + } else { + C.glfwSetScrollCallbackCB(w.data) + } + panicError() + return previous +} + +// DropCallback is the drop callback. +type DropCallback func(w *Window, names []string) + +// SetDropCallback sets the drop callback which is called when an object +// is dropped over the window. +func (w *Window) SetDropCallback(cbfun DropCallback) (previous DropCallback) { + previous = w.fDropHolder + w.fDropHolder = cbfun + if cbfun == nil { + C.glfwSetDropCallback(w.data, nil) + } else { + C.glfwSetDropCallbackCB(w.data) + } + panicError() + return previous +} + +// JoystickPresent reports whether the specified joystick is present. +func JoystickPresent(joy Joystick) bool { + ret := glfwbool(C.glfwJoystickPresent(C.int(joy))) + panicError() + return ret +} + +// GetJoystickAxes returns a slice of axis values. +func GetJoystickAxes(joy Joystick) []float32 { + var length int + + axis := C.glfwGetJoystickAxes(C.int(joy), (*C.int)(unsafe.Pointer(&length))) + panicError() + if axis == nil { + return nil + } + + a := make([]float32, length) + for i := 0; i < length; i++ { + a[i] = float32(C.GetAxisAtIndex(axis, C.int(i))) + } + return a +} + +// GetJoystickButtons returns a slice of button values. +func GetJoystickButtons(joy Joystick) []byte { + var length int + + buttons := C.glfwGetJoystickButtons(C.int(joy), (*C.int)(unsafe.Pointer(&length))) + panicError() + if buttons == nil { + return nil + } + + b := make([]byte, length) + for i := 0; i < length; i++ { + b[i] = byte(C.GetButtonsAtIndex(buttons, C.int(i))) + } + return b +} + +// GetJoystickName returns the name, encoded as UTF-8, of the specified joystick. +func GetJoystickName(joy Joystick) string { + jn := C.glfwGetJoystickName(C.int(joy)) + panicError() + return C.GoString(jn) +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/monitor.c b/vendor/github.com/go-gl/glfw/v3.2/glfw/monitor.c new file mode 100644 index 0000000..6ae35aa --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/monitor.c @@ -0,0 +1,25 @@ +#include "_cgo_export.h" + +GLFWmonitor *GetMonitorAtIndex(GLFWmonitor **monitors, int index) { + return monitors[index]; +} + +GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index) { + return vidmodes[index]; +} + +void glfwMonitorCB(GLFWmonitor* monitor, int event) { + goMonitorCB(monitor, event); +} + +void glfwSetMonitorCallbackCB() { + glfwSetMonitorCallback(glfwMonitorCB); +} + +unsigned int GetGammaAtIndex(unsigned short *color, int i) { + return color[i]; +} + +void SetGammaAtIndex(unsigned short *color, int i, unsigned short value) { + color[i] = value; +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/monitor.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/monitor.go new file mode 100644 index 0000000..5428189 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/monitor.go @@ -0,0 +1,208 @@ +package glfw + +//#include "glfw/include/GLFW/glfw3.h" +//GLFWmonitor* GetMonitorAtIndex(GLFWmonitor **monitors, int index); +//GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index); +//void glfwSetMonitorCallbackCB(); +//unsigned int GetGammaAtIndex(unsigned short *color, int i); +//void SetGammaAtIndex(unsigned short *color, int i, unsigned short value); +import "C" + +import ( + "unsafe" +) + +// Monitor represents a monitor. +type Monitor struct { + data *C.GLFWmonitor +} + +// MonitorEvent corresponds to a monitor configuration event. +type MonitorEvent int + +// GammaRamp describes the gamma ramp for a monitor. +type GammaRamp struct { + Red []uint16 // A slice of value describing the response of the red channel. + Green []uint16 // A slice of value describing the response of the green channel. + Blue []uint16 // A slice of value describing the response of the blue channel. +} + +// Monitor events. +const ( + Connected MonitorEvent = C.GLFW_CONNECTED + Disconnected MonitorEvent = C.GLFW_DISCONNECTED +) + +// VidMode describes a single video mode. +type VidMode struct { + Width int // The width, in pixels, of the video mode. + Height int // The height, in pixels, of the video mode. + RedBits int // The bit depth of the red channel of the video mode. + GreenBits int // The bit depth of the green channel of the video mode. + BlueBits int // The bit depth of the blue channel of the video mode. + RefreshRate int // The refresh rate, in Hz, of the video mode. +} + +var fMonitorHolder func(monitor *Monitor, event MonitorEvent) + +//export goMonitorCB +func goMonitorCB(monitor unsafe.Pointer, event C.int) { + fMonitorHolder(&Monitor{(*C.GLFWmonitor)(monitor)}, MonitorEvent(event)) +} + +// GetMonitors returns a slice of handles for all currently connected monitors. +func GetMonitors() []*Monitor { + var length int + + mC := C.glfwGetMonitors((*C.int)(unsafe.Pointer(&length))) + panicError() + if mC == nil { + return nil + } + + m := make([]*Monitor, length) + + for i := 0; i < length; i++ { + m[i] = &Monitor{C.GetMonitorAtIndex(mC, C.int(i))} + } + + return m +} + +// GetPrimaryMonitor returns the primary monitor. This is usually the monitor +// where elements like the Windows task bar or the OS X menu bar is located. +func GetPrimaryMonitor() *Monitor { + m := C.glfwGetPrimaryMonitor() + panicError() + if m == nil { + return nil + } + return &Monitor{m} +} + +// GetPos returns the position, in screen coordinates, of the upper-left +// corner of the monitor. +func (m *Monitor) GetPos() (x, y int) { + var xpos, ypos C.int + C.glfwGetMonitorPos(m.data, &xpos, &ypos) + panicError() + return int(xpos), int(ypos) +} + +// GetPhysicalSize returns the size, in millimetres, of the display area of the +// monitor. +// +// Note: Some operating systems do not provide accurate information, either +// because the monitor's EDID data is incorrect, or because the driver does not +// report it accurately. +func (m *Monitor) GetPhysicalSize() (width, height int) { + var wi, h C.int + C.glfwGetMonitorPhysicalSize(m.data, &wi, &h) + panicError() + return int(wi), int(h) +} + +// GetName returns a human-readable name of the monitor, encoded as UTF-8. +func (m *Monitor) GetName() string { + mn := C.glfwGetMonitorName(m.data) + panicError() + if mn == nil { + return "" + } + return C.GoString(mn) +} + +// SetMonitorCallback sets the monitor configuration callback, or removes the +// currently set callback. This is called when a monitor is connected to or +// disconnected from the system. +func SetMonitorCallback(cbfun func(monitor *Monitor, event MonitorEvent)) { + if cbfun == nil { + C.glfwSetMonitorCallback(nil) + } else { + fMonitorHolder = cbfun + C.glfwSetMonitorCallbackCB() + } + panicError() +} + +// GetVideoModes returns an array of all video modes supported by the monitor. +// The returned array is sorted in ascending order, first by color bit depth +// (the sum of all channel depths) and then by resolution area (the product of +// width and height). +func (m *Monitor) GetVideoModes() []*VidMode { + var length int + + vC := C.glfwGetVideoModes(m.data, (*C.int)(unsafe.Pointer(&length))) + panicError() + if vC == nil { + return nil + } + + v := make([]*VidMode, length) + + for i := 0; i < length; i++ { + t := C.GetVidmodeAtIndex(vC, C.int(i)) + v[i] = &VidMode{int(t.width), int(t.height), int(t.redBits), int(t.greenBits), int(t.blueBits), int(t.refreshRate)} + } + + return v +} + +// GetVideoMode returns the current video mode of the monitor. If you +// are using a full screen window, the return value will therefore depend on +// whether it is focused. +func (m *Monitor) GetVideoMode() *VidMode { + t := C.glfwGetVideoMode(m.data) + if t == nil { + return nil + } + panicError() + return &VidMode{int(t.width), int(t.height), int(t.redBits), int(t.greenBits), int(t.blueBits), int(t.refreshRate)} +} + +// SetGamma generates a 256-element gamma ramp from the specified exponent and then calls +// SetGamma with it. +func (m *Monitor) SetGamma(gamma float32) { + C.glfwSetGamma(m.data, C.float(gamma)) + panicError() +} + +// GetGammaRamp retrieves the current gamma ramp of the monitor. +func (m *Monitor) GetGammaRamp() *GammaRamp { + var ramp GammaRamp + + rampC := C.glfwGetGammaRamp(m.data) + panicError() + if rampC == nil { + return nil + } + + length := int(rampC.size) + ramp.Red = make([]uint16, length) + ramp.Green = make([]uint16, length) + ramp.Blue = make([]uint16, length) + + for i := 0; i < length; i++ { + ramp.Red[i] = uint16(C.GetGammaAtIndex(rampC.red, C.int(i))) + ramp.Green[i] = uint16(C.GetGammaAtIndex(rampC.green, C.int(i))) + ramp.Blue[i] = uint16(C.GetGammaAtIndex(rampC.blue, C.int(i))) + } + + return &ramp +} + +// SetGammaRamp sets the current gamma ramp for the monitor. +func (m *Monitor) SetGammaRamp(ramp *GammaRamp) { + var rampC C.GLFWgammaramp + + length := len(ramp.Red) + + for i := 0; i < length; i++ { + C.SetGammaAtIndex(rampC.red, C.int(i), C.ushort(ramp.Red[i])) + C.SetGammaAtIndex(rampC.green, C.int(i), C.ushort(ramp.Green[i])) + C.SetGammaAtIndex(rampC.blue, C.int(i), C.ushort(ramp.Blue[i])) + } + + C.glfwSetGammaRamp(m.data, &rampC) + panicError() +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/native_darwin.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/native_darwin.go new file mode 100644 index 0000000..12be6ee --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/native_darwin.go @@ -0,0 +1,39 @@ +package glfw + +/* +#define GLFW_EXPOSE_NATIVE_COCOA +#define GLFW_EXPOSE_NATIVE_NSGL +#include "glfw/include/GLFW/glfw3.h" +#include "glfw/include/GLFW/glfw3native.h" + +// workaround wrappers needed due to a cgo and/or LLVM bug. +// See: https://github.com/go-gl/glfw/issues/136 +void *workaround_glfwGetCocoaWindow(GLFWwindow *w) { + return (void *)glfwGetCocoaWindow(w); +} +void *workaround_glfwGetNSGLContext(GLFWwindow *w) { + return (void *)glfwGetNSGLContext(w); +} +*/ +import "C" + +// GetCocoaMonitor returns the CGDirectDisplayID of the monitor. +func (m *Monitor) GetCocoaMonitor() uintptr { + ret := uintptr(C.glfwGetCocoaMonitor(m.data)) + panicError() + return ret +} + +// GetCocoaWindow returns the NSWindow of the window. +func (w *Window) GetCocoaWindow() uintptr { + ret := uintptr(C.workaround_glfwGetCocoaWindow(w.data)) + panicError() + return ret +} + +// GetNSGLContext returns the NSOpenGLContext of the window. +func (w *Window) GetNSGLContext() uintptr { + ret := uintptr(C.workaround_glfwGetNSGLContext(w.data)) + panicError() + return ret +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/native_linbsd.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/native_linbsd.go new file mode 100644 index 0000000..2885778 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/native_linbsd.go @@ -0,0 +1,50 @@ +// +build linux freebsd + +package glfw + +//#define GLFW_EXPOSE_NATIVE_X11 +//#define GLFW_EXPOSE_NATIVE_GLX +//#include "glfw/include/GLFW/glfw3.h" +//#include "glfw/include/GLFW/glfw3native.h" +import "C" + +func GetX11Display() *C.Display { + ret := C.glfwGetX11Display() + panicError() + return ret +} + +// GetX11Adapter returns the RRCrtc of the monitor. +func (m *Monitor) GetX11Adapter() C.RRCrtc { + ret := C.glfwGetX11Adapter(m.data) + panicError() + return ret +} + +// GetX11Monitor returns the RROutput of the monitor. +func (m *Monitor) GetX11Monitor() C.RROutput { + ret := C.glfwGetX11Monitor(m.data) + panicError() + return ret +} + +// GetX11Window returns the Window of the window. +func (w *Window) GetX11Window() C.Window { + ret := C.glfwGetX11Window(w.data) + panicError() + return ret +} + +// GetGLXContext returns the GLXContext of the window. +func (w *Window) GetGLXContext() C.GLXContext { + ret := C.glfwGetGLXContext(w.data) + panicError() + return ret +} + +// GetGLXWindow returns the GLXWindow of the window. +func (w *Window) GetGLXWindow() C.GLXWindow { + ret := C.glfwGetGLXWindow(w.data) + panicError() + return ret +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/native_windows.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/native_windows.go new file mode 100644 index 0000000..5ee0d36 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/native_windows.go @@ -0,0 +1,35 @@ +package glfw + +//#define GLFW_EXPOSE_NATIVE_WIN32 +//#define GLFW_EXPOSE_NATIVE_WGL +//#include "glfw/include/GLFW/glfw3.h" +//#include "glfw/include/GLFW/glfw3native.h" +import "C" + +// GetWin32Adapter returns the adapter device name of the monitor. +func (m *Monitor) GetWin32Adapter() string { + ret := C.glfwGetWin32Adapter(m.data) + panicError() + return C.GoString(ret) +} + +// GetWin32Monitor returns the display device name of the monitor. +func (m *Monitor) GetWin32Monitor() string { + ret := C.glfwGetWin32Monitor(m.data) + panicError() + return C.GoString(ret) +} + +// GetWin32Window returns the HWND of the window. +func (w *Window) GetWin32Window() C.HWND { + ret := C.glfwGetWin32Window(w.data) + panicError() + return ret +} + +// GetWGLContext returns the HGLRC of the window. +func (w *Window) GetWGLContext() C.HGLRC { + ret := C.glfwGetWGLContext(w.data) + panicError() + return ret +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/time.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/time.go new file mode 100644 index 0000000..f3d93cb --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/time.go @@ -0,0 +1,41 @@ +package glfw + +//#include "glfw/include/GLFW/glfw3.h" +import "C" + +// GetTime returns the value of the GLFW timer. Unless the timer has been set +// using SetTime, the timer measures time elapsed since GLFW was initialized. +// +// The resolution of the timer is system dependent, but is usually on the order +// of a few micro- or nanoseconds. It uses the highest-resolution monotonic time +// source on each supported platform. +func GetTime() float64 { + ret := float64(C.glfwGetTime()) + panicError() + return ret +} + +// SetTime sets the value of the GLFW timer. It then continues to count up from +// that value. +// +// The resolution of the timer is system dependent, but is usually on the order +// of a few micro- or nanoseconds. It uses the highest-resolution monotonic time +// source on each supported platform. +func SetTime(time float64) { + C.glfwSetTime(C.double(time)) + panicError() +} + +// GetTimerFrequency returns frequency of the timer, in Hz, or zero if an error occurred. +func GetTimerFrequency() uint64 { + ret := uint64(C.glfwGetTimerFrequency()) + panicError() + return ret +} + +// GetTimerValue returns the current value of the raw timer, measured in 1 / frequency seconds. +func GetTimerValue() uint64 { + ret := uint64(C.glfwGetTimerValue()) + panicError() + return ret +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/util.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/util.go new file mode 100644 index 0000000..d5be751 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/util.go @@ -0,0 +1,37 @@ +package glfw + +//#include +//#include "glfw/include/GLFW/glfw3.h" +import "C" + +import ( + "reflect" + "unsafe" +) + +func glfwbool(b C.int) bool { + if b == C.GL_TRUE { + return true + } + return false +} + +func bytes(origin []byte) (pointer *uint8, free func()) { + n := len(origin) + + if n == 0 { + return nil, func() {} + } + + data := C.malloc(C.size_t(n)) + + dataSlice := *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ + Data: uintptr(data), + Len: n, + Cap: n, + })) + + copy(dataSlice, origin) + + return &dataSlice[0], func() { C.free(data) } +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/vulkan.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/vulkan.go new file mode 100644 index 0000000..6afdd59 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/vulkan.go @@ -0,0 +1,14 @@ +package glfw + +//#include "glfw/include/GLFW/glfw3.h" +import "C" + +// VulkanSupported reports whether the Vulkan loader has been found. This check is performed by Init. +// +// The availability of a Vulkan loader does not by itself guarantee that window surface creation or +// even device creation is possible. Call GetRequiredInstanceExtensions to check whether the +// extensions necessary for Vulkan surface creation are available and GetPhysicalDevicePresentationSupport +// to check whether a queue family of a physical device supports image presentation. +func VulkanSupported() bool { + return glfwbool(C.glfwVulkanSupported()) +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/window.c b/vendor/github.com/go-gl/glfw/v3.2/glfw/window.c new file mode 100644 index 0000000..d9cc0d4 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/window.c @@ -0,0 +1,57 @@ +#include "_cgo_export.h" + +void glfwWindowPosCB(GLFWwindow* window, int xpos, int ypos) { + goWindowPosCB(window, xpos, ypos); +} + +void glfwWindowSizeCB(GLFWwindow* window, int width, int height) { + goWindowSizeCB(window, width, height); +} + +void glfwFramebufferSizeCB(GLFWwindow* window, int width, int height) { + goFramebufferSizeCB(window, width, height); +} + +void glfwWindowCloseCB(GLFWwindow* window) { + goWindowCloseCB(window); +} + +void glfwWindowRefreshCB(GLFWwindow* window) { + goWindowRefreshCB(window); +} + +void glfwWindowFocusCB(GLFWwindow* window, int focused) { + goWindowFocusCB(window, focused); +} + +void glfwWindowIconifyCB(GLFWwindow* window, int iconified) { + goWindowIconifyCB(window, iconified); +} + +void glfwSetWindowPosCallbackCB(GLFWwindow* window) { + glfwSetWindowPosCallback(window, glfwWindowPosCB); +} + +void glfwSetWindowSizeCallbackCB(GLFWwindow* window) { + glfwSetWindowSizeCallback(window, glfwWindowSizeCB); +} + +void glfwSetFramebufferSizeCallbackCB(GLFWwindow* window) { + glfwSetFramebufferSizeCallback(window, glfwFramebufferSizeCB); +} + +void glfwSetWindowCloseCallbackCB(GLFWwindow* window) { + glfwSetWindowCloseCallback(window, glfwWindowCloseCB); +} + +void glfwSetWindowRefreshCallbackCB(GLFWwindow* window) { + glfwSetWindowRefreshCallback(window, glfwWindowRefreshCB); +} + +void glfwSetWindowFocusCallbackCB(GLFWwindow* window) { + glfwSetWindowFocusCallback(window, glfwWindowFocusCB); +} + +void glfwSetWindowIconifyCallbackCB(GLFWwindow* window) { + glfwSetWindowIconifyCallback(window, glfwWindowIconifyCB); +} diff --git a/vendor/github.com/go-gl/glfw/v3.2/glfw/window.go b/vendor/github.com/go-gl/glfw/v3.2/glfw/window.go new file mode 100644 index 0000000..be25de4 --- /dev/null +++ b/vendor/github.com/go-gl/glfw/v3.2/glfw/window.go @@ -0,0 +1,830 @@ +package glfw + +//#include +//#include "glfw/include/GLFW/glfw3.h" +//void glfwSetWindowPosCallbackCB(GLFWwindow *window); +//void glfwSetWindowSizeCallbackCB(GLFWwindow *window); +//void glfwSetFramebufferSizeCallbackCB(GLFWwindow *window); +//void glfwSetWindowCloseCallbackCB(GLFWwindow *window); +//void glfwSetWindowRefreshCallbackCB(GLFWwindow *window); +//void glfwSetWindowFocusCallbackCB(GLFWwindow *window); +//void glfwSetWindowIconifyCallbackCB(GLFWwindow *window); +import "C" + +import ( + "image" + "image/draw" + "sync" + "unsafe" +) + +// Internal window list stuff +type windowList struct { + l sync.Mutex + m map[*C.GLFWwindow]*Window +} + +var windows = windowList{m: map[*C.GLFWwindow]*Window{}} + +func (w *windowList) put(wnd *Window) { + w.l.Lock() + defer w.l.Unlock() + w.m[wnd.data] = wnd +} + +func (w *windowList) remove(wnd *C.GLFWwindow) { + w.l.Lock() + defer w.l.Unlock() + delete(w.m, wnd) +} + +func (w *windowList) get(wnd *C.GLFWwindow) *Window { + w.l.Lock() + defer w.l.Unlock() + return w.m[wnd] +} + +// Hint corresponds to hints that can be set before creating a window. +// +// Hint also corresponds to the attributes of the window that can be get after +// its creation. +type Hint int + +// Window related hints. +const ( + Focused Hint = C.GLFW_FOCUSED // Specifies whether the window will be given input focus when created. This hint is ignored for full screen and initially hidden windows. + Iconified Hint = C.GLFW_ICONIFIED // Specifies whether the window will be minimized. + Maximized Hint = C.GLFW_MAXIMIZED // Specifies whether the window is maximized. + Visible Hint = C.GLFW_VISIBLE // Specifies whether the window will be initially visible. + Resizable Hint = C.GLFW_RESIZABLE // Specifies whether the window will be resizable by the user. + Decorated Hint = C.GLFW_DECORATED // Specifies whether the window will have window decorations such as a border, a close widget, etc. + Floating Hint = C.GLFW_FLOATING // Specifies whether the window will be always-on-top. + AutoIconify Hint = C.GLFW_AUTO_ICONIFY // Specifies whether fullscreen windows automatically iconify (and restore the previous video mode) on focus loss. +) + +// Context related hints. +const ( + ClientAPI Hint = C.GLFW_CLIENT_API // Specifies which client API to create the context for. Hard constraint. + ContextVersionMajor Hint = C.GLFW_CONTEXT_VERSION_MAJOR // Specifies the client API version that the created context must be compatible with. + ContextVersionMinor Hint = C.GLFW_CONTEXT_VERSION_MINOR // Specifies the client API version that the created context must be compatible with. + ContextRobustness Hint = C.GLFW_CONTEXT_ROBUSTNESS // Specifies the robustness strategy to be used by the context. + ContextReleaseBehavior Hint = C.GLFW_CONTEXT_RELEASE_BEHAVIOR // Specifies the release behavior to be used by the context. + OpenGLForwardCompatible Hint = C.GLFW_OPENGL_FORWARD_COMPAT // Specifies whether the OpenGL context should be forward-compatible. Hard constraint. + OpenGLDebugContext Hint = C.GLFW_OPENGL_DEBUG_CONTEXT // Specifies whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality. If OpenGL ES is requested, this hint is ignored. + OpenGLProfile Hint = C.GLFW_OPENGL_PROFILE // Specifies which OpenGL profile to create the context for. Hard constraint. + ContextCreationAPI Hint = C.GLFW_CONTEXT_CREATION_API // Specifies which context creation API to use to create the context. +) + +// Framebuffer related hints. +const ( + ContextRevision Hint = C.GLFW_CONTEXT_REVISION + RedBits Hint = C.GLFW_RED_BITS // Specifies the desired bit depth of the default framebuffer. + GreenBits Hint = C.GLFW_GREEN_BITS // Specifies the desired bit depth of the default framebuffer. + BlueBits Hint = C.GLFW_BLUE_BITS // Specifies the desired bit depth of the default framebuffer. + AlphaBits Hint = C.GLFW_ALPHA_BITS // Specifies the desired bit depth of the default framebuffer. + DepthBits Hint = C.GLFW_DEPTH_BITS // Specifies the desired bit depth of the default framebuffer. + StencilBits Hint = C.GLFW_STENCIL_BITS // Specifies the desired bit depth of the default framebuffer. + AccumRedBits Hint = C.GLFW_ACCUM_RED_BITS // Specifies the desired bit depth of the accumulation buffer. + AccumGreenBits Hint = C.GLFW_ACCUM_GREEN_BITS // Specifies the desired bit depth of the accumulation buffer. + AccumBlueBits Hint = C.GLFW_ACCUM_BLUE_BITS // Specifies the desired bit depth of the accumulation buffer. + AccumAlphaBits Hint = C.GLFW_ACCUM_ALPHA_BITS // Specifies the desired bit depth of the accumulation buffer. + AuxBuffers Hint = C.GLFW_AUX_BUFFERS // Specifies the desired number of auxiliary buffers. + Stereo Hint = C.GLFW_STEREO // Specifies whether to use stereoscopic rendering. Hard constraint. + Samples Hint = C.GLFW_SAMPLES // Specifies the desired number of samples to use for multisampling. Zero disables multisampling. + SRGBCapable Hint = C.GLFW_SRGB_CAPABLE // Specifies whether the framebuffer should be sRGB capable. + RefreshRate Hint = C.GLFW_REFRESH_RATE // Specifies the desired refresh rate for full screen windows. If set to zero, the highest available refresh rate will be used. This hint is ignored for windowed mode windows. + DoubleBuffer Hint = C.GLFW_DOUBLEBUFFER // Specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. +) + +// Values for the ClientAPI hint. +const ( + OpenGLAPI int = C.GLFW_OPENGL_API + OpenGLESAPI int = C.GLFW_OPENGL_ES_API + NoAPI int = C.GLFW_NO_API +) + +// Values for ContextCreationAPI hint. +const ( + NativeContextAPI int = C.GLFW_NATIVE_CONTEXT_API + EGLContextAPI int = C.GLFW_EGL_CONTEXT_API +) + +// Values for the ContextRobustness hint. +const ( + NoRobustness int = C.GLFW_NO_ROBUSTNESS + NoResetNotification int = C.GLFW_NO_RESET_NOTIFICATION + LoseContextOnReset int = C.GLFW_LOSE_CONTEXT_ON_RESET +) + +// Values for ContextReleaseBehavior hint. +const ( + AnyReleaseBehavior int = C.GLFW_ANY_RELEASE_BEHAVIOR + ReleaseBehaviorFlush int = C.GLFW_RELEASE_BEHAVIOR_FLUSH + ReleaseBehaviorNone int = C.GLFW_RELEASE_BEHAVIOR_NONE +) + +// Values for the OpenGLProfile hint. +const ( + OpenGLAnyProfile int = C.GLFW_OPENGL_ANY_PROFILE + OpenGLCoreProfile int = C.GLFW_OPENGL_CORE_PROFILE + OpenGLCompatProfile int = C.GLFW_OPENGL_COMPAT_PROFILE +) + +// Other values. +const ( + True int = C.GL_TRUE + False int = C.GL_FALSE + DontCare int = C.GLFW_DONT_CARE +) + +// Window represents a window. +type Window struct { + data *C.GLFWwindow + + // Window. + fPosHolder func(w *Window, xpos int, ypos int) + fSizeHolder func(w *Window, width int, height int) + fFramebufferSizeHolder func(w *Window, width int, height int) + fCloseHolder func(w *Window) + fRefreshHolder func(w *Window) + fFocusHolder func(w *Window, focused bool) + fIconifyHolder func(w *Window, iconified bool) + + // Input. + fMouseButtonHolder func(w *Window, button MouseButton, action Action, mod ModifierKey) + fCursorPosHolder func(w *Window, xpos float64, ypos float64) + fCursorEnterHolder func(w *Window, entered bool) + fScrollHolder func(w *Window, xoff float64, yoff float64) + fKeyHolder func(w *Window, key Key, scancode int, action Action, mods ModifierKey) + fCharHolder func(w *Window, char rune) + fCharModsHolder func(w *Window, char rune, mods ModifierKey) + fDropHolder func(w *Window, names []string) +} + +// GLFWWindow returns a *C.GLFWwindow reference (i.e. the GLFW window itself). This can be used for +// passing the GLFW window handle to external C libraries. +func (w *Window) GLFWWindow() uintptr { + return uintptr(unsafe.Pointer(w.data)) +} + +//export goWindowPosCB +func goWindowPosCB(window unsafe.Pointer, xpos, ypos C.int) { + w := windows.get((*C.GLFWwindow)(window)) + w.fPosHolder(w, int(xpos), int(ypos)) +} + +//export goWindowSizeCB +func goWindowSizeCB(window unsafe.Pointer, width, height C.int) { + w := windows.get((*C.GLFWwindow)(window)) + w.fSizeHolder(w, int(width), int(height)) +} + +//export goFramebufferSizeCB +func goFramebufferSizeCB(window unsafe.Pointer, width, height C.int) { + w := windows.get((*C.GLFWwindow)(window)) + w.fFramebufferSizeHolder(w, int(width), int(height)) +} + +//export goWindowCloseCB +func goWindowCloseCB(window unsafe.Pointer) { + w := windows.get((*C.GLFWwindow)(window)) + w.fCloseHolder(w) +} + +//export goWindowRefreshCB +func goWindowRefreshCB(window unsafe.Pointer) { + w := windows.get((*C.GLFWwindow)(window)) + w.fRefreshHolder(w) +} + +//export goWindowFocusCB +func goWindowFocusCB(window unsafe.Pointer, focused C.int) { + w := windows.get((*C.GLFWwindow)(window)) + isFocused := glfwbool(focused) + w.fFocusHolder(w, isFocused) +} + +//export goWindowIconifyCB +func goWindowIconifyCB(window unsafe.Pointer, iconified C.int) { + isIconified := glfwbool(iconified) + w := windows.get((*C.GLFWwindow)(window)) + w.fIconifyHolder(w, isIconified) +} + +// DefaultWindowHints resets all window hints to their default values. +// +// This function may only be called from the main thread. +func DefaultWindowHints() { + C.glfwDefaultWindowHints() + panicError() +} + +// WindowHint sets hints for the next call to CreateWindow. The hints, +// once set, retain their values until changed by a call to WindowHint or +// DefaultWindowHints, or until the library is terminated with Terminate. +// +// This function may only be called from the main thread. +func WindowHint(target Hint, hint int) { + C.glfwWindowHint(C.int(target), C.int(hint)) + panicError() +} + +// CreateWindow creates a window and its associated context. Most of the options +// controlling how the window and its context should be created are specified +// through Hint. +// +// Successful creation does not change which context is current. Before you can +// use the newly created context, you need to make it current using +// MakeContextCurrent. +// +// Note that the created window and context may differ from what you requested, +// as not all parameters and hints are hard constraints. This includes the size +// of the window, especially for full screen windows. To retrieve the actual +// attributes of the created window and context, use queries like +// GetWindowAttrib and GetWindowSize. +// +// To create the window at a specific position, make it initially invisible using +// the Visible window hint, set its position and then show it. +// +// If a fullscreen window is active, the screensaver is prohibited from starting. +// +// Windows: If the executable has an icon resource named GLFW_ICON, it will be +// set as the icon for the window. If no such icon is present, the IDI_WINLOGO +// icon will be used instead. +// +// Mac OS X: The GLFW window has no icon, as it is not a document window, but the +// dock icon will be the same as the application bundle's icon. Also, the first +// time a window is opened the menu bar is populated with common commands like +// Hide, Quit and About. The (minimal) about dialog uses information from the +// application's bundle. For more information on bundles, see the Bundle +// Programming Guide provided by Apple. +// +// This function may only be called from the main thread. +func CreateWindow(width, height int, title string, monitor *Monitor, share *Window) (*Window, error) { + var ( + m *C.GLFWmonitor + s *C.GLFWwindow + ) + + t := C.CString(title) + defer C.free(unsafe.Pointer(t)) + + if monitor != nil { + m = monitor.data + } + + if share != nil { + s = share.data + } + + w := C.glfwCreateWindow(C.int(width), C.int(height), t, m, s) + if w == nil { + return nil, acceptError(APIUnavailable, VersionUnavailable) + } + + wnd := &Window{data: w} + windows.put(wnd) + return wnd, nil +} + +// Destroy destroys the specified window and its context. On calling this +// function, no further callbacks will be called for that window. +// +// This function may only be called from the main thread. +func (w *Window) Destroy() { + windows.remove(w.data) + C.glfwDestroyWindow(w.data) + panicError() +} + +// ShouldClose reports the value of the close flag of the specified window. +func (w *Window) ShouldClose() bool { + ret := glfwbool(C.glfwWindowShouldClose(w.data)) + panicError() + return ret +} + +// SetShouldClose sets the value of the close flag of the window. This can be +// used to override the user's attempt to close the window, or to signal that it +// should be closed. +func (w *Window) SetShouldClose(value bool) { + if !value { + C.glfwSetWindowShouldClose(w.data, C.GL_FALSE) + } else { + C.glfwSetWindowShouldClose(w.data, C.GL_TRUE) + } + panicError() +} + +// SetTitle sets the window title, encoded as UTF-8, of the window. +// +// This function may only be called from the main thread. +func (w *Window) SetTitle(title string) { + t := C.CString(title) + defer C.free(unsafe.Pointer(t)) + C.glfwSetWindowTitle(w.data, t) + panicError() +} + +// SetIcon sets the icon of the specified window. If passed an array of candidate images, +// those of or closest to the sizes desired by the system are selected. If no images are +// specified, the window reverts to its default icon. +// +// The image is ideally provided in the form of *image.NRGBA. +// The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight +// bits per channel with the red channel first. They are arranged canonically +// as packed sequential rows, starting from the top-left corner. If the image +// type is not *image.NRGBA, it will be converted to it. +// +// The desired image sizes varies depending on platform and system settings. The selected +// images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48. +func (w *Window) SetIcon(images []image.Image) { + count := len(images) + cimages := make([]C.GLFWimage, count) + freePixels := make([]func(), count) + + for i, img := range images { + var pixels []uint8 + b := img.Bounds() + + switch img := img.(type) { + case *image.NRGBA: + pixels = img.Pix + default: + m := image.NewNRGBA(image.Rect(0, 0, b.Dx(), b.Dy())) + draw.Draw(m, m.Bounds(), img, b.Min, draw.Src) + pixels = m.Pix + } + + pix, free := bytes(pixels) + freePixels[i] = free + + cimages[i].width = C.int(b.Dx()) + cimages[i].height = C.int(b.Dy()) + cimages[i].pixels = (*C.uchar)(pix) + } + + var p *C.GLFWimage + if count > 0 { + p = &cimages[0] + } + C.glfwSetWindowIcon(w.data, C.int(count), p) + + for _, v := range freePixels { + v() + } + + panicError() +} + +// GetPos returns the position, in screen coordinates, of the upper-left +// corner of the client area of the window. +func (w *Window) GetPos() (x, y int) { + var xpos, ypos C.int + C.glfwGetWindowPos(w.data, &xpos, &ypos) + panicError() + return int(xpos), int(ypos) +} + +// SetPos sets the position, in screen coordinates, of the upper-left corner +// of the client area of the window. +// +// If it is a full screen window, this function does nothing. +// +// If you wish to set an initial window position you should create a hidden +// window (using Hint and Visible), set its position and then show it. +// +// It is very rarely a good idea to move an already visible window, as it will +// confuse and annoy the user. +// +// The window manager may put limits on what positions are allowed. +// +// This function may only be called from the main thread. +func (w *Window) SetPos(xpos, ypos int) { + C.glfwSetWindowPos(w.data, C.int(xpos), C.int(ypos)) + panicError() +} + +// GetSize returns the size, in screen coordinates, of the client area of the +// specified window. +func (w *Window) GetSize() (width, height int) { + var wi, h C.int + C.glfwGetWindowSize(w.data, &wi, &h) + panicError() + return int(wi), int(h) +} + +// SetSize sets the size, in screen coordinates, of the client area of the +// window. +// +// For full screen windows, this function selects and switches to the resolution +// closest to the specified size, without affecting the window's context. As the +// context is unaffected, the bit depths of the framebuffer remain unchanged. +// +// The window manager may put limits on what window sizes are allowed. +// +// This function may only be called from the main thread. +func (w *Window) SetSize(width, height int) { + C.glfwSetWindowSize(w.data, C.int(width), C.int(height)) + panicError() +} + +// SetSizeLimits sets the size limits of the client area of the specified window. +// If the window is full screen or not resizable, this function does nothing. +// +// The size limits are applied immediately and may cause the window to be resized. +func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int) { + C.glfwSetWindowSizeLimits(w.data, C.int(minw), C.int(minh), C.int(maxw), C.int(maxh)) + panicError() +} + +// SetAspectRatio sets the required aspect ratio of the client area of the specified window. +// If the window is full screen or not resizable, this function does nothing. +// +// The aspect ratio is specified as a numerator and a denominator and both values must be greater +// than zero. For example, the common 16:9 aspect ratio is specified as 16 and 9, respectively. +// +// If the numerator and denominator is set to glfw.DontCare then the aspect ratio limit is disabled. +// +// The aspect ratio is applied immediately and may cause the window to be resized. +func (w *Window) SetAspectRatio(numer, denom int) { + C.glfwSetWindowAspectRatio(w.data, C.int(numer), C.int(denom)) + panicError() +} + +// GetFramebufferSize retrieves the size, in pixels, of the framebuffer of the +// specified window. +func (w *Window) GetFramebufferSize() (width, height int) { + var wi, h C.int + C.glfwGetFramebufferSize(w.data, &wi, &h) + panicError() + return int(wi), int(h) +} + +// GetFrameSize retrieves the size, in screen coordinates, of each edge of the frame +// of the specified window. This size includes the title bar, if the window has one. +// The size of the frame may vary depending on the window-related hints used to create it. +// +// Because this function retrieves the size of each window frame edge and not the offset +// along a particular coordinate axis, the retrieved values will always be zero or positive. +func (w *Window) GetFrameSize() (left, top, right, bottom int) { + var l, t, r, b C.int + C.glfwGetWindowFrameSize(w.data, &l, &t, &r, &b) + panicError() + return int(l), int(t), int(r), int(b) +} + +// Focus brings the specified window to front and sets input focus. +// The window should already be visible and not iconified. +// +// By default, both windowed and full screen mode windows are focused when initially created. +// Set the glfw.Focused to disable this behavior. +// +// Do not use this function to steal focus from other applications unless you are certain that +// is what the user wants. Focus stealing can be extremely disruptive. +func (w *Window) Focus() error { + C.glfwFocusWindow(w.data) + return acceptError(APIUnavailable) +} + +// Iconify iconifies/minimizes the window, if it was previously restored. If it +// is a full screen window, the original monitor resolution is restored until the +// window is restored. If the window is already iconified, this function does +// nothing. +// +// This function may only be called from the main thread. +func (w *Window) Iconify() error { + C.glfwIconifyWindow(w.data) + return acceptError(APIUnavailable) +} + +// Maximize maximizes the specified window if it was previously not maximized. +// If the window is already maximized, this function does nothing. +// +// If the specified window is a full screen window, this function does nothing. +func (w *Window) Maximize() error { + C.glfwMaximizeWindow(w.data) + return acceptError(APIUnavailable) +} + +// Restore restores the window, if it was previously iconified/minimized. If it +// is a full screen window, the resolution chosen for the window is restored on +// the selected monitor. If the window is already restored, this function does +// nothing. +// +// This function may only be called from the main thread. +func (w *Window) Restore() error { + C.glfwRestoreWindow(w.data) + return acceptError(APIUnavailable) +} + +// Show makes the window visible, if it was previously hidden. If the window is +// already visible or is in full screen mode, this function does nothing. +// +// This function may only be called from the main thread. +func (w *Window) Show() { + C.glfwShowWindow(w.data) + panicError() +} + +// Hide hides the window, if it was previously visible. If the window is already +// hidden or is in full screen mode, this function does nothing. +// +// This function may only be called from the main thread. +func (w *Window) Hide() { + C.glfwHideWindow(w.data) + panicError() +} + +// GetMonitor returns the handle of the monitor that the window is in +// fullscreen on. +// +// Returns nil if the window is in windowed mode. +func (w *Window) GetMonitor() *Monitor { + m := C.glfwGetWindowMonitor(w.data) + panicError() + if m == nil { + return nil + } + return &Monitor{m} +} + +// SetMonitor sets the monitor that the window uses for full screen mode or, +// if the monitor is NULL, makes it windowed mode. +// +// When setting a monitor, this function updates the width, height and refresh +// rate of the desired video mode and switches to the video mode closest to it. +// The window position is ignored when setting a monitor. +// +// When the monitor is NULL, the position, width and height are used to place +// the window client area. The refresh rate is ignored when no monitor is specified. +// If you only wish to update the resolution of a full screen window or the size of +// a windowed mode window, see window.SetSize. +// +// When a window transitions from full screen to windowed mode, this function +// restores any previous window settings such as whether it is decorated, floating, +// resizable, has size or aspect ratio limits, etc.. +func (w *Window) SetMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int) { + var m *C.GLFWmonitor + if monitor == nil { + m = nil + } else { + m = monitor.data + } + C.glfwSetWindowMonitor(w.data, m, C.int(xpos), C.int(ypos), C.int(width), C.int(height), C.int(refreshRate)) + panicError() +} + +// GetAttrib returns an attribute of the window. There are many attributes, +// some related to the window and others to its context. +func (w *Window) GetAttrib(attrib Hint) int { + ret := int(C.glfwGetWindowAttrib(w.data, C.int(attrib))) + panicError() + return ret +} + +// SetUserPointer sets the user-defined pointer of the window. The current value +// is retained until the window is destroyed. The initial value is nil. +func (w *Window) SetUserPointer(pointer unsafe.Pointer) { + C.glfwSetWindowUserPointer(w.data, pointer) + panicError() +} + +// GetUserPointer returns the current value of the user-defined pointer of the +// window. The initial value is nil. +func (w *Window) GetUserPointer() unsafe.Pointer { + ret := C.glfwGetWindowUserPointer(w.data) + panicError() + return ret +} + +// PosCallback is the window position callback. +type PosCallback func(w *Window, xpos int, ypos int) + +// SetPosCallback sets the position callback of the window, which is called +// when the window is moved. The callback is provided with the screen position +// of the upper-left corner of the client area of the window. +func (w *Window) SetPosCallback(cbfun PosCallback) (previous PosCallback) { + previous = w.fPosHolder + w.fPosHolder = cbfun + if cbfun == nil { + C.glfwSetWindowPosCallback(w.data, nil) + } else { + C.glfwSetWindowPosCallbackCB(w.data) + } + panicError() + return previous +} + +// SizeCallback is the window size callback. +type SizeCallback func(w *Window, width int, height int) + +// SetSizeCallback sets the size callback of the window, which is called when +// the window is resized. The callback is provided with the size, in screen +// coordinates, of the client area of the window. +func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback) { + previous = w.fSizeHolder + w.fSizeHolder = cbfun + if cbfun == nil { + C.glfwSetWindowSizeCallback(w.data, nil) + } else { + C.glfwSetWindowSizeCallbackCB(w.data) + } + panicError() + return previous +} + +// FramebufferSizeCallback is the framebuffer size callback. +type FramebufferSizeCallback func(w *Window, width int, height int) + +// SetFramebufferSizeCallback sets the framebuffer resize callback of the specified +// window, which is called when the framebuffer of the specified window is resized. +func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback) { + previous = w.fFramebufferSizeHolder + w.fFramebufferSizeHolder = cbfun + if cbfun == nil { + C.glfwSetFramebufferSizeCallback(w.data, nil) + } else { + C.glfwSetFramebufferSizeCallbackCB(w.data) + } + panicError() + return previous +} + +// CloseCallback is the window close callback. +type CloseCallback func(w *Window) + +// SetCloseCallback sets the close callback of the window, which is called when +// the user attempts to close the window, for example by clicking the close +// widget in the title bar. +// +// The close flag is set before this callback is called, but you can modify it at +// any time with SetShouldClose. +// +// Mac OS X: Selecting Quit from the application menu will trigger the close +// callback for all windows. +func (w *Window) SetCloseCallback(cbfun CloseCallback) (previous CloseCallback) { + previous = w.fCloseHolder + w.fCloseHolder = cbfun + if cbfun == nil { + C.glfwSetWindowCloseCallback(w.data, nil) + } else { + C.glfwSetWindowCloseCallbackCB(w.data) + } + panicError() + return previous +} + +// RefreshCallback is the window refresh callback. +type RefreshCallback func(w *Window) + +// SetRefreshCallback sets the refresh callback of the window, which +// is called when the client area of the window needs to be redrawn, for example +// if the window has been exposed after having been covered by another window. +// +// On compositing window systems such as Aero, Compiz or Aqua, where the window +// contents are saved off-screen, this callback may be called only very +// infrequently or never at all. +func (w *Window) SetRefreshCallback(cbfun RefreshCallback) (previous RefreshCallback) { + previous = w.fRefreshHolder + w.fRefreshHolder = cbfun + if cbfun == nil { + C.glfwSetWindowRefreshCallback(w.data, nil) + } else { + C.glfwSetWindowRefreshCallbackCB(w.data) + } + panicError() + return previous +} + +// FocusCallback is the window focus callback. +type FocusCallback func(w *Window, focused bool) + +// SetFocusCallback sets the focus callback of the window, which is called when +// the window gains or loses focus. +// +// After the focus callback is called for a window that lost focus, synthetic key +// and mouse button release events will be generated for all such that had been +// pressed. For more information, see SetKeyCallback and SetMouseButtonCallback. +func (w *Window) SetFocusCallback(cbfun FocusCallback) (previous FocusCallback) { + previous = w.fFocusHolder + w.fFocusHolder = cbfun + if cbfun == nil { + C.glfwSetWindowFocusCallback(w.data, nil) + } else { + C.glfwSetWindowFocusCallbackCB(w.data) + } + panicError() + return previous +} + +// IconifyCallback is the window iconification callback. +type IconifyCallback func(w *Window, iconified bool) + +// SetIconifyCallback sets the iconification callback of the window, which is +// called when the window is iconified or restored. +func (w *Window) SetIconifyCallback(cbfun IconifyCallback) (previous IconifyCallback) { + previous = w.fIconifyHolder + w.fIconifyHolder = cbfun + if cbfun == nil { + C.glfwSetWindowIconifyCallback(w.data, nil) + } else { + C.glfwSetWindowIconifyCallbackCB(w.data) + } + panicError() + return previous +} + +// SetClipboardString sets the system clipboard to the specified UTF-8 encoded +// string. +// +// This function may only be called from the main thread. +func (w *Window) SetClipboardString(str string) { + cp := C.CString(str) + defer C.free(unsafe.Pointer(cp)) + C.glfwSetClipboardString(w.data, cp) + panicError() +} + +// GetClipboardString returns the contents of the system clipboard, if it +// contains or is convertible to a UTF-8 encoded string. +// +// This function may only be called from the main thread. +func (w *Window) GetClipboardString() (string, error) { + cs := C.glfwGetClipboardString(w.data) + if cs == nil { + return "", acceptError(FormatUnavailable) + } + return C.GoString(cs), nil +} + +// PollEvents processes only those events that have already been received and +// then returns immediately. Processing events will cause the window and input +// callbacks associated with those events to be called. +// +// This function is not required for joystick input to work. +// +// This function may not be called from a callback. +// +// This function may only be called from the main thread. +func PollEvents() { + C.glfwPollEvents() + panicError() +} + +// WaitEvents puts the calling thread to sleep until at least one event has been +// received. Once one or more events have been recevied, it behaves as if +// PollEvents was called, i.e. the events are processed and the function then +// returns immediately. Processing events will cause the window and input +// callbacks associated with those events to be called. +// +// Since not all events are associated with callbacks, this function may return +// without a callback having been called even if you are monitoring all +// callbacks. +// +// This function may not be called from a callback. +// +// This function may only be called from the main thread. +func WaitEvents() { + C.glfwWaitEvents() + panicError() +} + +// WaitEventsTimeout puts the calling thread to sleep until at least one event is available in the +// event queue, or until the specified timeout is reached. If one or more events are available, +// it behaves exactly like PollEvents, i.e. the events in the queue are processed and the function +// then returns immediately. Processing events will cause the window and input callbacks associated +// with those events to be called. +// +// The timeout value must be a positive finite number. +// +// Since not all events are associated with callbacks, this function may return without a callback +// having been called even if you are monitoring all callbacks. +// +// On some platforms, a window move, resize or menu operation will cause event processing to block. +// This is due to how event processing is designed on those platforms. You can use the window +// refresh callback to redraw the contents of your window when necessary during such operations. +// +// On some platforms, certain callbacks may be called outside of a call to one of the event +// processing functions. +// +// If no windows exist, this function returns immediately. For synchronization of threads in +// applications that do not create windows, use native Go primitives. +// +// Event processing is not required for joystick input to work. +func WaitEventsTimeout(timeout float64) { + C.glfwWaitEventsTimeout(C.double(timeout)) + panicError() +} + +// PostEmptyEvent posts an empty event from the current thread to the main +// thread event queue, causing WaitEvents to return. +// +// If no windows exist, this function returns immediately. For synchronization of threads in +// applications that do not create windows, use native Go primitives. +// +// This function may be called from secondary threads. +func PostEmptyEvent() { + C.glfwPostEmptyEvent() + panicError() +} diff --git a/vendor/github.com/go-gl/mathgl/AUTHORS b/vendor/github.com/go-gl/mathgl/AUTHORS new file mode 100644 index 0000000..3de97dc --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/AUTHORS @@ -0,0 +1,14 @@ +# This is the official list of go-gl/mathgl authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# Please keep the list sorted. + +Alex Vasi +Dmitri Shuralyov +GlenKelley +Zoe Juozapaitis diff --git a/vendor/github.com/go-gl/mathgl/CONTRIBUTORS b/vendor/github.com/go-gl/mathgl/CONTRIBUTORS new file mode 100644 index 0000000..88569cd --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/CONTRIBUTORS @@ -0,0 +1,21 @@ +# This is the official list of people who can contribute +# (and typically have contributed) code to the mathgl +# repository. +# +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees would be listed here +# but not in AUTHORS, because Google would hold the copyright. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file. +# +# Names should be added to this file like so: +# Name +# +# Please keep the list sorted. + +Alex Vasi +Dmitri Shuralyov +GlenKelley +Zoe Juozapaitis diff --git a/vendor/github.com/go-gl/mathgl/LICENSE b/vendor/github.com/go-gl/mathgl/LICENSE new file mode 100644 index 0000000..a780cbd --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/LICENSE @@ -0,0 +1,23 @@ +Copyright ©2013 The go-gl Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the gonum project nor the names of its authors and + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/go-gl/mathgl/mgl32/codegen.go b/vendor/github.com/go-gl/mathgl/mgl32/codegen.go new file mode 100644 index 0000000..747c39d --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/codegen.go @@ -0,0 +1,276 @@ +// Copyright 2014 The go-gl/mathgl 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 ignore + +// codegen generates go code from templates. Intended to be +// used with go generate; Also makes mgl64 from mgl32. +// See the invocation in mgl32/util.go for details. +// To use it, just run "go generate github.com/go-gl/mathgl/mgl32" +// (or "go generate" in mgl32 directory). + +package main + +import ( + "bytes" + "flag" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + "text/template" +) + +type Context struct { + Comment string + TemplateName string +} + +type MatrixIter struct { + M int // row + N int // column + index int +} + +var mgl64RewriteRules = []string{ + "mgl32 -> mgl64", + "float32 -> float64", + "f32 -> f64", + "a.Float32 -> a.Float64", + "math.MaxFloat32 -> math.MaxFloat64", + "math.SmallestNonzeroFloat32 -> math.SmallestNonzeroFloat64", +} + +func main() { + flag.Usage = func() { + fmt.Println("Usage: codegen -template file.tmpl -output file.go") + fmt.Println("Usage: codegen -mgl64 [-dir ../mgl64]") + flag.PrintDefaults() + } + + tmplPath := flag.String("template", "file.tmpl", "template path") + oPath := flag.String("output", "file.go", "output path") + mgl64 := flag.Bool("mgl64", false, "make mgl64") + mgl64Path := flag.String("dir", "../mgl64", "path to mgl64 location") + + flag.Parse() + if flag.NArg() > 0 || flag.NFlag() == 0 { + flag.Usage() + os.Exit(2) + } + + if *mgl64 { + genMgl64(*mgl64Path) + return + } + + tmpl := template.New("").Delims("<<", ">>").Funcs(template.FuncMap{ + "typename": typenameHelper, + "elementname": elementNameHelper, + "iter": iterHelper, + "matiter": matrixIterHelper, + "enum": enumHelper, + "sep": separatorHelper, + "repeat": repeatHelper, + "add": addHelper, + "mul": mulHelper, + }) + tmpl = template.Must(tmpl.ParseFiles(*tmplPath)) + tmplName := filepath.Base(*tmplPath) + + oFile, err := os.Create(*oPath) + if err != nil { + panic(err) + } + + context := Context{ + Comment: "This file is generated by codegen.go; DO NOT EDIT", + TemplateName: tmplName, + } + if err = tmpl.ExecuteTemplate(oFile, tmplName, context); err != nil { + panic(err) + } + oFile.Close() + + if err = rungofmt(*oPath, false, nil); err != nil { + panic(err) + } +} + +func genMgl64(destPath string) { + HandleFile := func(source string, info os.FileInfo, err error) error { + if err != nil { + return err + } + dest := filepath.Join(destPath, source) + + if info.IsDir() { + return os.MkdirAll(dest, info.Mode()) + } + if !strings.HasSuffix(source, ".go") || info.Name() == "codegen.go" { + return nil + } + if !info.Mode().IsRegular() { + fmt.Println("Ignored, not a regular file:", source) + return nil + } + + in, err := ioutil.ReadFile(source) + if err != nil { + return err + } + + out, err := os.OpenFile(dest, os.O_RDWR|os.O_CREATE|os.O_TRUNC, + info.Mode()) + if err != nil { + return err + } + defer out.Close() + + comment := fmt.Sprintf( + "// This file is generated from mgl32/%s; DO NOT EDIT\n\n", + source) + if _, err = out.WriteString(comment); err != nil { + return err + } + + r := strings.NewReplacer("//go:generate ", "//#go:generate ") // We don't want go generate directives in mgl64 package. + + if _, err = r.WriteString(out, string(in)); err != nil { + return err + } + + return rungofmt(dest, true, mgl64RewriteRules) + } + + if err := filepath.Walk(".", HandleFile); err != nil { + panic(err) + } +} + +func rungofmt(path string, fiximports bool, rewriteRules []string) error { + args := []string{"-w", path} + output, err := exec.Command("gofmt", args...).CombinedOutput() + + for i := 0; err == nil && i < len(rewriteRules); i++ { + args = []string{"-w", "-r", rewriteRules[i], path} + output, err = exec.Command("gofmt", args...).CombinedOutput() + } + + if fiximports && err == nil { + args = []string{"-w", path} + output, err = exec.Command("goimports", args...).CombinedOutput() + } + + if err != nil { + fmt.Println("Error executing gofmt", strings.Join(args, " ")) + os.Stdout.Write(output) + } + + return err +} + +func typenameHelper(m, n int) string { + if m == 1 { + return fmt.Sprintf("Vec%d", n) + } + if n == 1 { + return fmt.Sprintf("Vec%d", m) + } + if m == n { + return fmt.Sprintf("Mat%d", m) + } + return fmt.Sprintf("Mat%dx%d", m, n) +} + +func elementNameHelper(m int) string { + switch m { + case 0: + return "X" + case 1: + return "Y" + case 2: + return "Z" + case 3: + return "W" + default: + panic("Can't generate element name") + } +} + +func iterHelper(start, end int) []int { + iter := make([]int, end-start) + for i := start; i < end; i++ { + iter[i] = i + } + return iter +} + +func matrixIterHelper(rows, cols int) []MatrixIter { + res := make([]MatrixIter, 0, rows*cols) + + for n := 0; n < cols; n++ { + for m := 0; m < rows; m++ { + res = append(res, MatrixIter{ + M: m, + N: n, + index: n*rows + m, + }) + } + } + + return res +} + +// Template function that returns slice from its arguments. Indended to be used +// in range loops. +func enumHelper(args ...int) []int { + return args +} + +// Template function to insert commas and '+' in range loops. +func separatorHelper(sep string, iterCond int) string { + if iterCond > 0 { + return sep + } + return "" +} + +// Template function to repeat string 'count' times. Inserting 'sep' between +// repetitions. Also changes all occurrences of '%d' to repetition number. +// For example, repeatHelper(3, "col%d", ",") will output "col0, col1, col2" +func repeatHelper(count int, text string, sep string) string { + var res bytes.Buffer + + for i := 0; i < count; i++ { + if i > 0 { + res.WriteString(sep) + } + res.WriteString(strings.Replace(text, "%d", fmt.Sprintf("%d", i), -1)) + } + + return res.String() +} + +func addHelper(args ...int) int { + res := 0 + for _, a := range args { + res += a + } + return res +} + +func mulHelper(args ...int) int { + res := 1 + for _, a := range args { + res *= a + } + return res +} + +func (i MatrixIter) String() string { + return fmt.Sprintf("%d", i.index) +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/conv.go b/vendor/github.com/go-gl/mathgl/mgl32/conv.go new file mode 100644 index 0000000..ad5b472 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/conv.go @@ -0,0 +1,94 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "math" +) + +// Converts 3-dimensional cartesian coordinates (x,y,z) to spherical +// coordinates with radius r, inclination theta, and azimuth phi. +// +// All angles are in radians. +func CartesianToSpherical(coord Vec3) (r, theta, phi float32) { + r = coord.Len() + theta = float32(math.Acos(float64(coord[2] / r))) + phi = float32(math.Atan2(float64(coord[1]), float64(coord[0]))) + + return +} + +// Converts 3-dimensional cartesian coordinates (x,y,z) to cylindrical +// coordinates with radial distance r, azimuth phi, and height z. +// +// All angles are in radians. +func CartesianToCylindical(coord Vec3) (rho, phi, z float32) { + rho = float32(math.Hypot(float64(coord[0]), float64(coord[1]))) + + phi = float32(math.Atan2(float64(coord[1]), float64(coord[0]))) + + z = coord[2] + + return +} + +// Converts spherical coordinates with radius r, inclination theta, +// and azimuth phi to cartesian coordinates (x,y,z). +// +// Angles are in radians. +func SphericalToCartesian(r, theta, phi float32) Vec3 { + st, ct := math.Sincos(float64(theta)) + sp, cp := math.Sincos(float64(phi)) + + return Vec3{r * float32(st*cp), r * float32(st*sp), r * float32(ct)} +} + +// Converts spherical coordinates with radius r, inclination theta, +// and azimuth phi to cylindrical coordinates with radial distance r, +// azimuth phi, and height z. +// +// Angles are in radians +func SphericalToCylindrical(r, theta, phi float32) (rho, phi2, z float32) { + s, c := math.Sincos(float64(theta)) + + rho = r * float32(s) + z = r * float32(c) + phi2 = phi + + return +} + +// Converts cylindrical coordinates with radial distance r, +// azimuth phi, and height z to spherical coordinates with radius r, +// inclination theta, and azimuth phi. +// +// Angles are in radians +func CylindircalToSpherical(rho, phi, z float32) (r, theta, phi2 float32) { + r = float32(math.Hypot(float64(rho), float64(z))) + phi2 = phi + theta = float32(math.Atan2(float64(rho), float64(z))) + + return +} + +// Converts cylindrical coordinates with radial distance r, +// azimuth phi, and height z to cartesian coordinates (x,y,z) +// +// Angles are in radians. +func CylindricalToCartesian(rho, phi, z float32) Vec3 { + s, c := math.Sincos(float64(phi)) + + return Vec3{rho * float32(c), rho * float32(s), z} +} + +// Converts degrees to radians +func DegToRad(angle float32) float32 { + return angle * float32(math.Pi) / 180 +} + +// Converts radians to degrees +func RadToDeg(angle float32) float32 { + return angle * 180 / float32(math.Pi) +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/doc.go b/vendor/github.com/go-gl/mathgl/mgl32/doc.go new file mode 100644 index 0000000..c7fcf9f --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/doc.go @@ -0,0 +1,22 @@ +// Copyright 2014 The go-gl 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 mgl[32|64] (an abbreviation of mathgl since the packages were split between 32 and 64-bit versions) +is a pure Go math package specialized for 3D math, with inspiration from GLM. It provides statically-sized vectors and matrices with +compile-time generated calculations for most basic math operations. It also provides several basic graphics utilities such as bezier curves and surfaces, +generation of basic primitives like circles, easy creation of common matrices such as perspective or rotation, and common operations like converting +to/from screen/OpenGL coordinates or Projecting/Unprojecting from an MVP matrix. Quaternions are also supported. + +The basic vectors and matrices are written with code generation, so looking directly at the source will probably be a bit confusing. I recommend looking at the Godoc +instead, as all basic functions are documented. + +This package is written in Column Major Order to make it easier with OpenGL. This means for uniform blocks you can use the default ordering, and when you call +pass-in functions you can leave the "transpose" argument as false. + +The package now contains variable sized vectors and matrices. Using these is discouraged. They exist for corner cases where you need "small" matrices that are still +bigger than 4x4. An example may be a Jacobean used for inverse kinematics. Things like computer vision or general linear algebra are best left to packages +more directly suited for that task -- OpenCV, BLAS, LAPACK, numpy, gonum (if you want to stay in Go), and so on. +*/ +package mgl32 diff --git a/vendor/github.com/go-gl/mathgl/mgl32/matmn.go b/vendor/github.com/go-gl/mathgl/mgl32/matmn.go new file mode 100644 index 0000000..ea2e1d3 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/matmn.go @@ -0,0 +1,494 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "math" +) + +// An arbitrary mxn matrix backed by a slice of floats. +// +// This is emphatically not recommended for hardcore n-dimensional +// linear algebra. For that purpose I recommend github.com/gonum/matrix or +// well-tested C libraries such as BLAS or LAPACK. +// +// This is meant to complement future algorithms that may require matrices larger than +// 4x4, but still relatively small (e.g. Jacobeans for inverse kinematics). +// +// It makes use of the same memory sync.Pool set that VecN does, with the same sizing rules. +// +// MatMN will always check if the receiver is nil on any method. Meaning MathMN(nil).Add(dst,m2) +// should always work. Except for the Reshape function, the semantics of this is to "propogate" nils +// forward, so if an invalid operation occurs in a long chain of matrix operations, the overall result will be nil. +type MatMxN struct { + m, n int + dat []float32 +} + +// Creates a matrix backed by a new slice of size m*n +func NewMatrix(m, n int) (mat *MatMxN) { + if shouldPool { + return &MatMxN{m: m, n: n, dat: grabFromPool(m * n)} + } else { + return &MatMxN{m: m, n: n, dat: make([]float32, m*n)} + } +} + +// Returns a matrix with data specified by the data in src +// +// For instance, to create a 3x3 MatMN from a Mat3 +// +// m1 := mgl32.Rotate3DX(3.14159) +// mat := mgl32.NewBackedMatrix(m1[:],3,3) +// +// will create an MN matrix matching the data in the original +// rotation matrix. This matrix is NOT backed by the initial slice; +// it's a copy of the data +// +// If m*n > cap(src), this function will panic. +func NewMatrixFromData(src []float32, m, n int) *MatMxN { + var internal []float32 + if shouldPool { + internal = grabFromPool(m * n) + } else { + internal = make([]float32, m*n) + } + copy(internal, src[:m*n]) + + return &MatMxN{m: m, n: n, dat: internal} +} + +// Copies src into dst. This Reshapes dst +// to the same size as src. +// +// If dst or src is nil, this is a no-op +func CopyMatMN(dst, src *MatMxN) { + if dst == nil || src == nil { + return + } + dst.Reshape(src.m, src.n) + copy(dst.dat, src.dat) +} + +// Stores the NxN identity matrix in dst, reallocating as necessary. +func IdentN(dst *MatMxN, n int) *MatMxN { + dst = dst.Reshape(n, n) + + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + if i == j { + dst.Set(i, j, 1) + } else { + dst.Set(i, j, 0) + } + } + } + + return dst +} + +// Creates an NxN diagonal matrix seeded by the diagonal vector +// diag. Meaning: for all entries, where i==j, dst.At(i,j) = diag[i]. Otherwise +// dst.At(i,j) = 0 +// +// This reshapes dst to the correct size, returning/grabbing from the memory pool as necessary. +func DiagN(dst *MatMxN, diag *VecN) *MatMxN { + dst = dst.Reshape(len(diag.vec), len(diag.vec)) + n := len(diag.vec) + + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + if i == j { + dst.Set(i, j, diag.vec[i]) + } else { + dst.Set(i, j, 0) + } + } + } + + return dst +} + +// Reshapes the matrix to m by n and zeroes out all +// elements. +func (mat *MatMxN) Zero(m, n int) { + if mat == nil { + return + } + + mat.Reshape(m, n) + for i := range mat.dat { + mat.dat[i] = 0 + } +} + +// Returns the underlying matrix slice to the memory pool +func (mat *MatMxN) destroy() { + if mat == nil { + return + } + + if shouldPool && mat.dat != nil { + returnToPool(mat.dat) + } + mat.m, mat.n = 0, 0 + mat.dat = nil +} + +// Reshapes the matrix to the desired dimensions. +// If the overall size of the new matrix (m*n) is bigger +// than the current size, the underlying slice will +// be grown, sending the current slice to the memory pool +// and grabbing a bigger one if necessary +// +// If the caller is a nil pointer, the return value will be a new +// matrix, as if NewMatrix(m,n) had been called. Otherwise it's +// simply the caller. +func (mat *MatMxN) Reshape(m, n int) *MatMxN { + if mat == nil { + return NewMatrix(m, n) + } + + if m*n <= cap(mat.dat) { + if mat.dat != nil { + mat.dat = mat.dat[:m*n] + } else { + mat.dat = []float32{} + } + mat.m, mat.n = m, n + return mat + } + + if shouldPool && mat.dat != nil { + returnToPool(mat.dat) + } + (*mat) = (*NewMatrix(m, n)) + + return mat +} + +// Infers an MxN matrix from a constant matrix from this package. For instance, +// a Mat2x3 inferred with this function will work just like NewMatrixFromData(m[:],2,3) +// where m is the Mat2x3. This uses a type switch. +// +// I personally recommend using NewMatrixFromData, because it avoids a potentially costly type switch. +// However, this is also more robust and less error prone if you change the size of your matrix somewhere. +// +// If the value passed in is not recognized, it returns an InferMatrixError. +func (mat *MatMxN) InferMatrix(m interface{}) (*MatMxN, error) { + switch raw := m.(type) { + case Mat2: + return NewMatrixFromData(raw[:], 2, 2), nil + case Mat2x3: + return NewMatrixFromData(raw[:], 2, 3), nil + case Mat2x4: + return NewMatrixFromData(raw[:], 2, 4), nil + case Mat3: + return NewMatrixFromData(raw[:], 3, 3), nil + case Mat3x2: + return NewMatrixFromData(raw[:], 3, 2), nil + case Mat3x4: + return NewMatrixFromData(raw[:], 3, 4), nil + case Mat4: + return NewMatrixFromData(raw[:], 4, 4), nil + case Mat4x2: + return NewMatrixFromData(raw[:], 4, 2), nil + case Mat4x3: + return NewMatrixFromData(raw[:], 4, 3), nil + default: + return nil, InferMatrixError{} + } +} + +// Returns the trace of a square matrix (sum of all diagonal elements). If the matrix +// is nil, or not square, the result will be NaN. +func (mat *MatMxN) Trace() float32 { + if mat == nil || mat.m != mat.n { + return float32(math.NaN()) + } + + var out float32 + for i := 0; i < mat.m; i++ { + out += mat.At(i, i) + } + + return out +} + +// Takes the transpose of mat and puts it in dst. +// +// If dst is not of the correct dimensions, it will be Reshaped, +// if dst and mat are the same, a temporary matrix of the correct size will +// be allocated; these resources will be released via the memory pool. +// +// This should be improved in the future. +func (mat *MatMxN) Transpose(dst *MatMxN) (t *MatMxN) { + if mat == nil { + return nil + } + + if dst == mat { + dst = NewMatrix(mat.n, mat.m) + + // Copy data to correct matrix, + // delete temporary buffer, + // and set the return value to the + // correct one + defer func() { + copy(mat.dat, dst.dat) + + mat.m, mat.n = mat.n, mat.m + + dst.destroy() + t = mat + }() + + return mat + } else { + dst = dst.Reshape(mat.n, mat.m) + } + + for r := 0; r < mat.m; r++ { + for c := 0; c < mat.n; c++ { + dst.dat[r*dst.m+c] = mat.dat[c*mat.m+r] + } + } + + return dst +} + +// Returns the raw slice backing this matrix +func (mat *MatMxN) Raw() []float32 { + if mat == nil { + return nil + } + + return mat.dat +} + +// Returns the number of rows in this matrix +func (mat *MatMxN) NumRows() int { + return mat.m +} + +// Returns the number of columns in this matrix +func (mat *MatMxN) NumCols() int { + return mat.n +} + +// Returns the number of rows and columns in this matrix +// as a single operation +func (mat *MatMxN) NumRowCols() (rows, cols int) { + return mat.m, mat.n +} + +// Returns the element at the given row and column. +// This is garbage in/garbage out and does no bounds +// checking. If the computation happens to lead to an invalid +// element, it will be returned; or it may panic. +func (mat *MatMxN) At(row, col int) float32 { + return mat.dat[col*mat.m+row] +} + +// Sets the element at the given row and column. +// This is garbage in/garbage out and does no bounds +// checking. If the computation happens to lead to an invalid +// element, it will be set; or it may panic. +func (mat *MatMxN) Set(row, col int, val float32) { + mat.dat[col*mat.m+row] = val +} + +func (mat *MatMxN) Add(dst *MatMxN, addend *MatMxN) *MatMxN { + if mat == nil || addend == nil || mat.m != addend.m || mat.n != addend.n { + return nil + } + + dst = dst.Reshape(mat.m, mat.n) + + // No need to care about rows and columns + // since it's element-wise anyway + for i, el := range mat.dat { + dst.dat[i] = el + addend.dat[i] + } + + return dst +} + +func (mat *MatMxN) Sub(dst *MatMxN, subtrahend *MatMxN) *MatMxN { + if mat == nil || subtrahend == nil || mat.m != subtrahend.m || mat.n != subtrahend.n { + return nil + } + + dst = dst.Reshape(mat.m, mat.n) + + // No need to care about rows and columns + // since it's element-wise anyway + for i, el := range mat.dat { + dst.dat[i] = el - subtrahend.dat[i] + } + + return dst +} + +// Performs matrix multiplication on MxN matrix mat and NxO matrix mul, storing the result in dst. +// This returns dst, or nil if the operation is not able to be performed. +// +// If mat == dst, or mul == dst a temporary matrix will be used. +// +// This uses the naive algorithm (though on smaller matrices, +// this can actually be faster; about len(mat)+len(mul) < ~100) +func (mat *MatMxN) MulMxN(dst *MatMxN, mul *MatMxN) *MatMxN { + if mat == nil || mul == nil || mat.n != mul.m { + return nil + } + + if dst == mul { + mul = NewMatrix(mul.m, mul.n) + copy(mul.dat, dst.dat) + + // If mat==dst==mul, we need to change + // mat too or we have a bug + if mat == dst { + mat = mul + } + + defer mul.destroy() + } else if dst == mat { + mat = NewMatrix(mat.m, mat.n) + copy(mat.dat, dst.dat) + + defer mat.destroy() + } + + dst = dst.Reshape(mat.m, mul.n) + for r1 := 0; r1 < mat.m; r1++ { + for c2 := 0; c2 < mul.n; c2++ { + + dst.dat[c2*mat.m+r1] = 0 + for i := 0; i < mat.n; i++ { + dst.dat[c2*mat.m+r1] += mat.dat[i*mat.m+r1] * mul.dat[c2*mul.m+i] + } + + } + } + + return dst +} + +// Performs a scalar multiplication between mat and some constant c, +// storing the result in dst. Mat and dst can be equal. If dst is not the +// correct size, a Reshape will occur. +func (mat *MatMxN) Mul(dst *MatMxN, c float32) *MatMxN { + if mat == nil { + return nil + } + + dst = dst.Reshape(mat.m, mat.n) + + for i, el := range mat.dat { + dst.dat[i] = el * c + } + + return dst +} + +// Multiplies the matrix by a vector of size n. If mat or v is +// nil, this returns nil. If the number of columns in mat does not match +// the Size of v, this also returns nil. +// +// Dst will be resized if it's not big enough. If dst == v; a temporary +// vector will be allocated and returned via the realloc callback when complete. +func (mat *MatMxN) MulNx1(dst, v *VecN) *VecN { + if mat == nil || v == nil || mat.n != len(v.vec) { + return nil + } + if dst == v { + v = NewVecN(len(v.vec)) + copy(v.vec, dst.vec) + + defer v.destroy() + } + + dst = dst.Resize(mat.m) + + for r := 0; r < mat.m; r++ { + dst.vec[r] = 0 + + for c := 0; c < mat.n; c++ { + dst.vec[r] += mat.At(r, c) * v.vec[c] + } + } + + return dst +} + +func (mat *MatMxN) ApproxEqual(m2 *MatMxN) bool { + if mat == m2 { + return true + } + if mat.m != m2.m || mat.n != m2.n { + return false + } + + for i, el := range mat.dat { + if !FloatEqual(el, m2.dat[i]) { + return false + } + } + + return true +} + +func (mat *MatMxN) ApproxEqualThreshold(m2 *MatMxN, epsilon float32) bool { + if mat == m2 { + return true + } + if mat.m != m2.m || mat.n != m2.n { + return false + } + + for i, el := range mat.dat { + if !FloatEqualThreshold(el, m2.dat[i], epsilon) { + return false + } + } + + return true +} + +func (mat *MatMxN) ApproxEqualFunc(m2 *MatMxN, comp func(float32, float32) bool) bool { + if mat == m2 { + return true + } + if mat.m != m2.m || mat.n != m2.n { + return false + } + + for i, el := range mat.dat { + if !comp(el, m2.dat[i]) { + return false + } + } + + return true +} + +type InferMatrixError struct{} + +func (me InferMatrixError) Error() string { + return "could not infer matrix. Make sure you're using a constant matrix such as Mat3 from within the same package (meaning: mgl32.MatMxN can't handle a mgl64.Mat2x3)." +} + +type RectangularMatrixError struct{} + +func (mse RectangularMatrixError) Error() string { + return "the matrix was the wrong shape, needed a square matrix." +} + +type NilMatrixError struct{} + +func (me NilMatrixError) Error() string { + return "the matrix is nil" +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/matrix.go b/vendor/github.com/go-gl/mathgl/mgl32/matrix.go new file mode 100644 index 0000000..b5bee85 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/matrix.go @@ -0,0 +1,2341 @@ +// Copyright 2014 The go-gl/mathgl Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is generated by codegen.go; DO NOT EDIT +// Edit matrix.tmpl and run "go generate" to make changes. + +package mgl32 + +import ( + "bytes" + "fmt" + "golang.org/x/image/math/f32" + "text/tabwriter" +) + +type Mat2 [4]float32 +type Mat2x3 [6]float32 +type Mat2x4 [8]float32 +type Mat3x2 [6]float32 +type Mat3 f32.Mat3 +type Mat3x4 [12]float32 +type Mat4x2 [8]float32 +type Mat4x3 [12]float32 +type Mat4 f32.Mat4 + +func (m Mat2) Mat3() Mat3 { + col0, col1 := m.Cols() + return Mat3FromCols( + col0.Vec3(0), + col1.Vec3(0), + Vec3{0, 0, 1}, + ) +} + +func (m Mat2) Mat4() Mat4 { + col0, col1 := m.Cols() + return Mat4FromCols( + col0.Vec4(0, 0), + col1.Vec4(0, 0), + Vec4{0, 0, 1, 0}, + Vec4{0, 0, 0, 1}, + ) +} + +func (m Mat3) Mat2() Mat2 { + col0, col1, _ := m.Cols() + return Mat2FromCols( + col0.Vec2(), + col1.Vec2(), + ) +} + +func (m Mat3) Mat4() Mat4 { + col0, col1, col2 := m.Cols() + return Mat4FromCols( + col0.Vec4(0), + col1.Vec4(0), + col2.Vec4(0), + Vec4{0, 0, 0, 1}, + ) +} + +func (m Mat4) Mat2() Mat2 { + col0, col1, _, _ := m.Cols() + return Mat2FromCols( + col0.Vec2(), + col1.Vec2(), + ) +} + +func (m Mat4) Mat3() Mat3 { + col0, col1, col2, _ := m.Cols() + return Mat3FromCols( + col0.Vec3(), + col1.Vec3(), + col2.Vec3(), + ) +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat2) SetCol(col int, v Vec2) { + m[col*2+0], m[col*2+1] = v[0], v[1] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat2) SetRow(row int, v Vec2) { + m[row+0], m[row+2] = v[0], v[1] +} + +// Diag is a basic operation on a square matrix that simply +// returns main diagonal (meaning all elements such that row==col). +func (m Mat2) Diag() Vec2 { + return Vec2{m[0], m[3]} +} + +// Ident2 returns the 2x2 identity matrix. +// The identity matrix is a square matrix with the value 1 on its +// diagonals. The characteristic property of the identity matrix is that +// any matrix multiplied by it is itself. (MI = M; IN = N) +func Ident2() Mat2 { + return Mat2{1, 0, 0, 1} +} + +// Diag2 creates a diagonal matrix from the entries of the input vector. +// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0. +// +// Another way to think about it is that the identity is this function where the every vector element is 1. +func Diag2(v Vec2) Mat2 { + var m Mat2 + m[0], m[3] = v[0], v[1] + return m +} + +// Mat2FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat2FromRows(row0, row1 Vec2) Mat2 { + return Mat2{row0[0], row1[0], row0[1], row1[1]} +} + +// Mat2FromCols builds a new matrix from column vectors. +func Mat2FromCols(col0, col1 Vec2) Mat2 { + return Mat2{col0[0], col0[1], col1[0], col1[1]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat2) Add(m2 Mat2) Mat2 { + return Mat2{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat2) Sub(m2 Mat2) Mat2 { + return Mat2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat2) Mul(c float32) Mat2 { + return Mat2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c} +} + +// Mul2x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2) Mul2x1(m2 Vec2) Vec2 { + return Vec2{ + m1[0]*m2[0] + m1[2]*m2[1], + m1[1]*m2[0] + m1[3]*m2[1], + } +} + +// Mul2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2) Mul2(m2 Mat2) Mat2 { + return Mat2{ + m1[0]*m2[0] + m1[2]*m2[1], + m1[1]*m2[0] + m1[3]*m2[1], + m1[0]*m2[2] + m1[2]*m2[3], + m1[1]*m2[2] + m1[3]*m2[3], + } +} + +// Mul2x3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2) Mul2x3(m2 Mat2x3) Mat2x3 { + return Mat2x3{ + m1[0]*m2[0] + m1[2]*m2[1], + m1[1]*m2[0] + m1[3]*m2[1], + m1[0]*m2[2] + m1[2]*m2[3], + m1[1]*m2[2] + m1[3]*m2[3], + m1[0]*m2[4] + m1[2]*m2[5], + m1[1]*m2[4] + m1[3]*m2[5], + } +} + +// Mul2x4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2) Mul2x4(m2 Mat2x4) Mat2x4 { + return Mat2x4{ + m1[0]*m2[0] + m1[2]*m2[1], + m1[1]*m2[0] + m1[3]*m2[1], + m1[0]*m2[2] + m1[2]*m2[3], + m1[1]*m2[2] + m1[3]*m2[3], + m1[0]*m2[4] + m1[2]*m2[5], + m1[1]*m2[4] + m1[3]*m2[5], + m1[0]*m2[6] + m1[2]*m2[7], + m1[1]*m2[6] + m1[3]*m2[7], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat2) Transpose() Mat2 { + return Mat2{m1[0], m1[2], m1[1], m1[3]} +} + +// The determinant of a matrix is a measure of a square matrix's +// singularity and invertability, among other things. In this library, the +// determinant is hard coded based on pre-computed cofactor expansion, and uses +// no loops. Of course, the addition and multiplication must still be done. +func (m Mat2) Det() float32 { + return m[0]*m[3] - m[1]*m[2] +} + +// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the +// original, yields the identity. +// +// M_inv * M = M * M_inv = I +// +// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling +// are still done. This can still be (relatively) expensive for a 4x4. +// +// This function checks the determinant to see if the matrix is invertible. +// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is +// entirely plausible to get a false positive or negative. +// In the future, an alternate function may be written which takes in a pre-computed determinant. +func (m Mat2) Inv() Mat2 { + det := m.Det() + if FloatEqual(det, float32(0.0)) { + return Mat2{} + } + + retMat := Mat2{m[3], -m[1], -m[2], m[0]} + + return retMat.Mul(1 / det) +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat2) ApproxEqual(m2 Mat2) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat2) ApproxEqualThreshold(m2 Mat2, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat2) ApproxFuncEqual(m2 Mat2, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat2) At(row, col int) float32 { + return m[col*2+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat2) Set(row, col int, value float32) { + m[col*2+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat2) Index(row, col int) int { + return col*2 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat2) Row(row int) Vec2 { + return Vec2{m[row+0], m[row+2]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat2) Rows() (row0, row1 Vec2) { + return m.Row(0), m.Row(1) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat2) Col(col int) Vec2 { + return Vec2{m[col*2+0], m[col*2+1]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat2) Cols() (col0, col1 Vec2) { + return m.Col(0), m.Col(1) +} + +// Trace is a basic operation on a square matrix that simply +// sums up all elements on the main diagonal (meaning all elements such that row==col). +func (m Mat2) Trace() float32 { + return m[0] + m[3] +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat2) Abs() Mat2 { + return Mat2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3])} +} + +// Pretty prints the matrix +func (m Mat2) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 2; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat2x3) SetCol(col int, v Vec2) { + m[col*2+0], m[col*2+1] = v[0], v[1] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat2x3) SetRow(row int, v Vec3) { + m[row+0], m[row+2], m[row+4] = v[0], v[1], v[2] +} + +// Mat2x3FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat2x3FromRows(row0, row1 Vec3) Mat2x3 { + return Mat2x3{row0[0], row1[0], row0[1], row1[1], row0[2], row1[2]} +} + +// Mat2x3FromCols builds a new matrix from column vectors. +func Mat2x3FromCols(col0, col1, col2 Vec2) Mat2x3 { + return Mat2x3{col0[0], col0[1], col1[0], col1[1], col2[0], col2[1]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat2x3) Add(m2 Mat2x3) Mat2x3 { + return Mat2x3{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat2x3) Sub(m2 Mat2x3) Mat2x3 { + return Mat2x3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat2x3) Mul(c float32) Mat2x3 { + return Mat2x3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c} +} + +// Mul3x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x3) Mul3x1(m2 Vec3) Vec2 { + return Vec2{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2], + } +} + +// Mul3x2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x3) Mul3x2(m2 Mat3x2) Mat2 { + return Mat2{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2], + m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5], + m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5], + } +} + +// Mul3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x3) Mul3(m2 Mat3) Mat2x3 { + return Mat2x3{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2], + m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5], + m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5], + m1[0]*m2[6] + m1[2]*m2[7] + m1[4]*m2[8], + m1[1]*m2[6] + m1[3]*m2[7] + m1[5]*m2[8], + } +} + +// Mul3x4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x3) Mul3x4(m2 Mat3x4) Mat2x4 { + return Mat2x4{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2], + m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5], + m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5], + m1[0]*m2[6] + m1[2]*m2[7] + m1[4]*m2[8], + m1[1]*m2[6] + m1[3]*m2[7] + m1[5]*m2[8], + m1[0]*m2[9] + m1[2]*m2[10] + m1[4]*m2[11], + m1[1]*m2[9] + m1[3]*m2[10] + m1[5]*m2[11], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat2x3) Transpose() Mat3x2 { + return Mat3x2{m1[0], m1[2], m1[4], m1[1], m1[3], m1[5]} +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat2x3) ApproxEqual(m2 Mat2x3) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat2x3) ApproxEqualThreshold(m2 Mat2x3, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat2x3) ApproxFuncEqual(m2 Mat2x3, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat2x3) At(row, col int) float32 { + return m[col*2+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat2x3) Set(row, col int, value float32) { + m[col*2+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat2x3) Index(row, col int) int { + return col*2 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat2x3) Row(row int) Vec3 { + return Vec3{m[row+0], m[row+2], m[row+4]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat2x3) Rows() (row0, row1 Vec3) { + return m.Row(0), m.Row(1) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat2x3) Col(col int) Vec2 { + return Vec2{m[col*2+0], m[col*2+1]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat2x3) Cols() (col0, col1, col2 Vec2) { + return m.Col(0), m.Col(1), m.Col(2) +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat2x3) Abs() Mat2x3 { + return Mat2x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5])} +} + +// Pretty prints the matrix +func (m Mat2x3) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 2; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat2x4) SetCol(col int, v Vec2) { + m[col*2+0], m[col*2+1] = v[0], v[1] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat2x4) SetRow(row int, v Vec4) { + m[row+0], m[row+2], m[row+4], m[row+6] = v[0], v[1], v[2], v[3] +} + +// Mat2x4FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat2x4FromRows(row0, row1 Vec4) Mat2x4 { + return Mat2x4{row0[0], row1[0], row0[1], row1[1], row0[2], row1[2], row0[3], row1[3]} +} + +// Mat2x4FromCols builds a new matrix from column vectors. +func Mat2x4FromCols(col0, col1, col2, col3 Vec2) Mat2x4 { + return Mat2x4{col0[0], col0[1], col1[0], col1[1], col2[0], col2[1], col3[0], col3[1]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat2x4) Add(m2 Mat2x4) Mat2x4 { + return Mat2x4{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat2x4) Sub(m2 Mat2x4) Mat2x4 { + return Mat2x4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat2x4) Mul(c float32) Mat2x4 { + return Mat2x4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c} +} + +// Mul4x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x4) Mul4x1(m2 Vec4) Vec2 { + return Vec2{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3], + } +} + +// Mul4x2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x4) Mul4x2(m2 Mat4x2) Mat2 { + return Mat2{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3], + m1[0]*m2[4] + m1[2]*m2[5] + m1[4]*m2[6] + m1[6]*m2[7], + m1[1]*m2[4] + m1[3]*m2[5] + m1[5]*m2[6] + m1[7]*m2[7], + } +} + +// Mul4x3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x4) Mul4x3(m2 Mat4x3) Mat2x3 { + return Mat2x3{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3], + m1[0]*m2[4] + m1[2]*m2[5] + m1[4]*m2[6] + m1[6]*m2[7], + m1[1]*m2[4] + m1[3]*m2[5] + m1[5]*m2[6] + m1[7]*m2[7], + m1[0]*m2[8] + m1[2]*m2[9] + m1[4]*m2[10] + m1[6]*m2[11], + m1[1]*m2[8] + m1[3]*m2[9] + m1[5]*m2[10] + m1[7]*m2[11], + } +} + +// Mul4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat2x4) Mul4(m2 Mat4) Mat2x4 { + return Mat2x4{ + m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3], + m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3], + m1[0]*m2[4] + m1[2]*m2[5] + m1[4]*m2[6] + m1[6]*m2[7], + m1[1]*m2[4] + m1[3]*m2[5] + m1[5]*m2[6] + m1[7]*m2[7], + m1[0]*m2[8] + m1[2]*m2[9] + m1[4]*m2[10] + m1[6]*m2[11], + m1[1]*m2[8] + m1[3]*m2[9] + m1[5]*m2[10] + m1[7]*m2[11], + m1[0]*m2[12] + m1[2]*m2[13] + m1[4]*m2[14] + m1[6]*m2[15], + m1[1]*m2[12] + m1[3]*m2[13] + m1[5]*m2[14] + m1[7]*m2[15], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat2x4) Transpose() Mat4x2 { + return Mat4x2{m1[0], m1[2], m1[4], m1[6], m1[1], m1[3], m1[5], m1[7]} +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat2x4) ApproxEqual(m2 Mat2x4) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat2x4) ApproxEqualThreshold(m2 Mat2x4, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat2x4) ApproxFuncEqual(m2 Mat2x4, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat2x4) At(row, col int) float32 { + return m[col*2+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat2x4) Set(row, col int, value float32) { + m[col*2+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat2x4) Index(row, col int) int { + return col*2 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat2x4) Row(row int) Vec4 { + return Vec4{m[row+0], m[row+2], m[row+4], m[row+6]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat2x4) Rows() (row0, row1 Vec4) { + return m.Row(0), m.Row(1) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat2x4) Col(col int) Vec2 { + return Vec2{m[col*2+0], m[col*2+1]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat2x4) Cols() (col0, col1, col2, col3 Vec2) { + return m.Col(0), m.Col(1), m.Col(2), m.Col(3) +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat2x4) Abs() Mat2x4 { + return Mat2x4{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7])} +} + +// Pretty prints the matrix +func (m Mat2x4) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 2; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat3x2) SetCol(col int, v Vec3) { + m[col*3+0], m[col*3+1], m[col*3+2] = v[0], v[1], v[2] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat3x2) SetRow(row int, v Vec2) { + m[row+0], m[row+3] = v[0], v[1] +} + +// Mat3x2FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat3x2FromRows(row0, row1, row2 Vec2) Mat3x2 { + return Mat3x2{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1]} +} + +// Mat3x2FromCols builds a new matrix from column vectors. +func Mat3x2FromCols(col0, col1 Vec3) Mat3x2 { + return Mat3x2{col0[0], col0[1], col0[2], col1[0], col1[1], col1[2]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat3x2) Add(m2 Mat3x2) Mat3x2 { + return Mat3x2{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat3x2) Sub(m2 Mat3x2) Mat3x2 { + return Mat3x2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat3x2) Mul(c float32) Mat3x2 { + return Mat3x2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c} +} + +// Mul2x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x2) Mul2x1(m2 Vec2) Vec3 { + return Vec3{ + m1[0]*m2[0] + m1[3]*m2[1], + m1[1]*m2[0] + m1[4]*m2[1], + m1[2]*m2[0] + m1[5]*m2[1], + } +} + +// Mul2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x2) Mul2(m2 Mat2) Mat3x2 { + return Mat3x2{ + m1[0]*m2[0] + m1[3]*m2[1], + m1[1]*m2[0] + m1[4]*m2[1], + m1[2]*m2[0] + m1[5]*m2[1], + m1[0]*m2[2] + m1[3]*m2[3], + m1[1]*m2[2] + m1[4]*m2[3], + m1[2]*m2[2] + m1[5]*m2[3], + } +} + +// Mul2x3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x2) Mul2x3(m2 Mat2x3) Mat3 { + return Mat3{ + m1[0]*m2[0] + m1[3]*m2[1], + m1[1]*m2[0] + m1[4]*m2[1], + m1[2]*m2[0] + m1[5]*m2[1], + m1[0]*m2[2] + m1[3]*m2[3], + m1[1]*m2[2] + m1[4]*m2[3], + m1[2]*m2[2] + m1[5]*m2[3], + m1[0]*m2[4] + m1[3]*m2[5], + m1[1]*m2[4] + m1[4]*m2[5], + m1[2]*m2[4] + m1[5]*m2[5], + } +} + +// Mul2x4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x2) Mul2x4(m2 Mat2x4) Mat3x4 { + return Mat3x4{ + m1[0]*m2[0] + m1[3]*m2[1], + m1[1]*m2[0] + m1[4]*m2[1], + m1[2]*m2[0] + m1[5]*m2[1], + m1[0]*m2[2] + m1[3]*m2[3], + m1[1]*m2[2] + m1[4]*m2[3], + m1[2]*m2[2] + m1[5]*m2[3], + m1[0]*m2[4] + m1[3]*m2[5], + m1[1]*m2[4] + m1[4]*m2[5], + m1[2]*m2[4] + m1[5]*m2[5], + m1[0]*m2[6] + m1[3]*m2[7], + m1[1]*m2[6] + m1[4]*m2[7], + m1[2]*m2[6] + m1[5]*m2[7], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat3x2) Transpose() Mat2x3 { + return Mat2x3{m1[0], m1[3], m1[1], m1[4], m1[2], m1[5]} +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat3x2) ApproxEqual(m2 Mat3x2) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat3x2) ApproxEqualThreshold(m2 Mat3x2, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat3x2) ApproxFuncEqual(m2 Mat3x2, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat3x2) At(row, col int) float32 { + return m[col*3+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat3x2) Set(row, col int, value float32) { + m[col*3+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat3x2) Index(row, col int) int { + return col*3 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat3x2) Row(row int) Vec2 { + return Vec2{m[row+0], m[row+3]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat3x2) Rows() (row0, row1, row2 Vec2) { + return m.Row(0), m.Row(1), m.Row(2) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat3x2) Col(col int) Vec3 { + return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat3x2) Cols() (col0, col1 Vec3) { + return m.Col(0), m.Col(1) +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat3x2) Abs() Mat3x2 { + return Mat3x2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5])} +} + +// Pretty prints the matrix +func (m Mat3x2) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 3; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat3) SetCol(col int, v Vec3) { + m[col*3+0], m[col*3+1], m[col*3+2] = v[0], v[1], v[2] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat3) SetRow(row int, v Vec3) { + m[row+0], m[row+3], m[row+6] = v[0], v[1], v[2] +} + +// Diag is a basic operation on a square matrix that simply +// returns main diagonal (meaning all elements such that row==col). +func (m Mat3) Diag() Vec3 { + return Vec3{m[0], m[4], m[8]} +} + +// Ident3 returns the 3x3 identity matrix. +// The identity matrix is a square matrix with the value 1 on its +// diagonals. The characteristic property of the identity matrix is that +// any matrix multiplied by it is itself. (MI = M; IN = N) +func Ident3() Mat3 { + return Mat3{1, 0, 0, 0, 1, 0, 0, 0, 1} +} + +// Diag3 creates a diagonal matrix from the entries of the input vector. +// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0. +// +// Another way to think about it is that the identity is this function where the every vector element is 1. +func Diag3(v Vec3) Mat3 { + var m Mat3 + m[0], m[4], m[8] = v[0], v[1], v[2] + return m +} + +// Mat3FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat3FromRows(row0, row1, row2 Vec3) Mat3 { + return Mat3{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1], row0[2], row1[2], row2[2]} +} + +// Mat3FromCols builds a new matrix from column vectors. +func Mat3FromCols(col0, col1, col2 Vec3) Mat3 { + return Mat3{col0[0], col0[1], col0[2], col1[0], col1[1], col1[2], col2[0], col2[1], col2[2]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat3) Add(m2 Mat3) Mat3 { + return Mat3{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat3) Sub(m2 Mat3) Mat3 { + return Mat3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat3) Mul(c float32) Mat3 { + return Mat3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c} +} + +// Mul3x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3) Mul3x1(m2 Vec3) Vec3 { + return Vec3{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2], + } +} + +// Mul3x2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3) Mul3x2(m2 Mat3x2) Mat3x2 { + return Mat3x2{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2], + m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5], + m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5], + m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5], + } +} + +// Mul3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3) Mul3(m2 Mat3) Mat3 { + return Mat3{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2], + m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5], + m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5], + m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5], + m1[0]*m2[6] + m1[3]*m2[7] + m1[6]*m2[8], + m1[1]*m2[6] + m1[4]*m2[7] + m1[7]*m2[8], + m1[2]*m2[6] + m1[5]*m2[7] + m1[8]*m2[8], + } +} + +// Mul3x4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3) Mul3x4(m2 Mat3x4) Mat3x4 { + return Mat3x4{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2], + m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5], + m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5], + m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5], + m1[0]*m2[6] + m1[3]*m2[7] + m1[6]*m2[8], + m1[1]*m2[6] + m1[4]*m2[7] + m1[7]*m2[8], + m1[2]*m2[6] + m1[5]*m2[7] + m1[8]*m2[8], + m1[0]*m2[9] + m1[3]*m2[10] + m1[6]*m2[11], + m1[1]*m2[9] + m1[4]*m2[10] + m1[7]*m2[11], + m1[2]*m2[9] + m1[5]*m2[10] + m1[8]*m2[11], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat3) Transpose() Mat3 { + return Mat3{m1[0], m1[3], m1[6], m1[1], m1[4], m1[7], m1[2], m1[5], m1[8]} +} + +// The determinant of a matrix is a measure of a square matrix's +// singularity and invertability, among other things. In this library, the +// determinant is hard coded based on pre-computed cofactor expansion, and uses +// no loops. Of course, the addition and multiplication must still be done. +func (m Mat3) Det() float32 { + return m[0]*m[4]*m[8] + m[3]*m[7]*m[2] + m[6]*m[1]*m[5] - m[6]*m[4]*m[2] - m[3]*m[1]*m[8] - m[0]*m[7]*m[5] +} + +// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the +// original, yields the identity. +// +// M_inv * M = M * M_inv = I +// +// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling +// are still done. This can still be (relatively) expensive for a 4x4. +// +// This function checks the determinant to see if the matrix is invertible. +// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is +// entirely plausible to get a false positive or negative. +// In the future, an alternate function may be written which takes in a pre-computed determinant. +func (m Mat3) Inv() Mat3 { + det := m.Det() + if FloatEqual(det, float32(0.0)) { + return Mat3{} + } + + retMat := Mat3{ + m[4]*m[8] - m[5]*m[7], + m[2]*m[7] - m[1]*m[8], + m[1]*m[5] - m[2]*m[4], + m[5]*m[6] - m[3]*m[8], + m[0]*m[8] - m[2]*m[6], + m[2]*m[3] - m[0]*m[5], + m[3]*m[7] - m[4]*m[6], + m[1]*m[6] - m[0]*m[7], + m[0]*m[4] - m[1]*m[3], + } + + return retMat.Mul(1 / det) +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat3) ApproxEqual(m2 Mat3) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat3) ApproxEqualThreshold(m2 Mat3, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat3) ApproxFuncEqual(m2 Mat3, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat3) At(row, col int) float32 { + return m[col*3+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat3) Set(row, col int, value float32) { + m[col*3+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat3) Index(row, col int) int { + return col*3 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat3) Row(row int) Vec3 { + return Vec3{m[row+0], m[row+3], m[row+6]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat3) Rows() (row0, row1, row2 Vec3) { + return m.Row(0), m.Row(1), m.Row(2) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat3) Col(col int) Vec3 { + return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat3) Cols() (col0, col1, col2 Vec3) { + return m.Col(0), m.Col(1), m.Col(2) +} + +// Trace is a basic operation on a square matrix that simply +// sums up all elements on the main diagonal (meaning all elements such that row==col). +func (m Mat3) Trace() float32 { + return m[0] + m[4] + m[8] +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat3) Abs() Mat3 { + return Mat3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8])} +} + +// Pretty prints the matrix +func (m Mat3) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 3; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat3x4) SetCol(col int, v Vec3) { + m[col*3+0], m[col*3+1], m[col*3+2] = v[0], v[1], v[2] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat3x4) SetRow(row int, v Vec4) { + m[row+0], m[row+3], m[row+6], m[row+9] = v[0], v[1], v[2], v[3] +} + +// Mat3x4FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat3x4FromRows(row0, row1, row2 Vec4) Mat3x4 { + return Mat3x4{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1], row0[2], row1[2], row2[2], row0[3], row1[3], row2[3]} +} + +// Mat3x4FromCols builds a new matrix from column vectors. +func Mat3x4FromCols(col0, col1, col2, col3 Vec3) Mat3x4 { + return Mat3x4{col0[0], col0[1], col0[2], col1[0], col1[1], col1[2], col2[0], col2[1], col2[2], col3[0], col3[1], col3[2]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat3x4) Add(m2 Mat3x4) Mat3x4 { + return Mat3x4{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8], m1[9] + m2[9], m1[10] + m2[10], m1[11] + m2[11]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat3x4) Sub(m2 Mat3x4) Mat3x4 { + return Mat3x4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat3x4) Mul(c float32) Mat3x4 { + return Mat3x4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c} +} + +// Mul4x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x4) Mul4x1(m2 Vec4) Vec3 { + return Vec3{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3], + } +} + +// Mul4x2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x4) Mul4x2(m2 Mat4x2) Mat3x2 { + return Mat3x2{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3], + m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7], + m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7], + m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7], + } +} + +// Mul4x3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x4) Mul4x3(m2 Mat4x3) Mat3 { + return Mat3{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3], + m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7], + m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7], + m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7], + m1[0]*m2[8] + m1[3]*m2[9] + m1[6]*m2[10] + m1[9]*m2[11], + m1[1]*m2[8] + m1[4]*m2[9] + m1[7]*m2[10] + m1[10]*m2[11], + m1[2]*m2[8] + m1[5]*m2[9] + m1[8]*m2[10] + m1[11]*m2[11], + } +} + +// Mul4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat3x4) Mul4(m2 Mat4) Mat3x4 { + return Mat3x4{ + m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3], + m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3], + m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3], + m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7], + m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7], + m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7], + m1[0]*m2[8] + m1[3]*m2[9] + m1[6]*m2[10] + m1[9]*m2[11], + m1[1]*m2[8] + m1[4]*m2[9] + m1[7]*m2[10] + m1[10]*m2[11], + m1[2]*m2[8] + m1[5]*m2[9] + m1[8]*m2[10] + m1[11]*m2[11], + m1[0]*m2[12] + m1[3]*m2[13] + m1[6]*m2[14] + m1[9]*m2[15], + m1[1]*m2[12] + m1[4]*m2[13] + m1[7]*m2[14] + m1[10]*m2[15], + m1[2]*m2[12] + m1[5]*m2[13] + m1[8]*m2[14] + m1[11]*m2[15], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat3x4) Transpose() Mat4x3 { + return Mat4x3{m1[0], m1[3], m1[6], m1[9], m1[1], m1[4], m1[7], m1[10], m1[2], m1[5], m1[8], m1[11]} +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat3x4) ApproxEqual(m2 Mat3x4) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat3x4) ApproxEqualThreshold(m2 Mat3x4, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat3x4) ApproxFuncEqual(m2 Mat3x4, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat3x4) At(row, col int) float32 { + return m[col*3+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat3x4) Set(row, col int, value float32) { + m[col*3+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat3x4) Index(row, col int) int { + return col*3 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat3x4) Row(row int) Vec4 { + return Vec4{m[row+0], m[row+3], m[row+6], m[row+9]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat3x4) Rows() (row0, row1, row2 Vec4) { + return m.Row(0), m.Row(1), m.Row(2) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat3x4) Col(col int) Vec3 { + return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat3x4) Cols() (col0, col1, col2, col3 Vec3) { + return m.Col(0), m.Col(1), m.Col(2), m.Col(3) +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat3x4) Abs() Mat3x4 { + return Mat3x4{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11])} +} + +// Pretty prints the matrix +func (m Mat3x4) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 3; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat4x2) SetCol(col int, v Vec4) { + m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat4x2) SetRow(row int, v Vec2) { + m[row+0], m[row+4] = v[0], v[1] +} + +// Mat4x2FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat4x2FromRows(row0, row1, row2, row3 Vec2) Mat4x2 { + return Mat4x2{row0[0], row1[0], row2[0], row3[0], row0[1], row1[1], row2[1], row3[1]} +} + +// Mat4x2FromCols builds a new matrix from column vectors. +func Mat4x2FromCols(col0, col1 Vec4) Mat4x2 { + return Mat4x2{col0[0], col0[1], col0[2], col0[3], col1[0], col1[1], col1[2], col1[3]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat4x2) Add(m2 Mat4x2) Mat4x2 { + return Mat4x2{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat4x2) Sub(m2 Mat4x2) Mat4x2 { + return Mat4x2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat4x2) Mul(c float32) Mat4x2 { + return Mat4x2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c} +} + +// Mul2x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x2) Mul2x1(m2 Vec2) Vec4 { + return Vec4{ + m1[0]*m2[0] + m1[4]*m2[1], + m1[1]*m2[0] + m1[5]*m2[1], + m1[2]*m2[0] + m1[6]*m2[1], + m1[3]*m2[0] + m1[7]*m2[1], + } +} + +// Mul2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x2) Mul2(m2 Mat2) Mat4x2 { + return Mat4x2{ + m1[0]*m2[0] + m1[4]*m2[1], + m1[1]*m2[0] + m1[5]*m2[1], + m1[2]*m2[0] + m1[6]*m2[1], + m1[3]*m2[0] + m1[7]*m2[1], + m1[0]*m2[2] + m1[4]*m2[3], + m1[1]*m2[2] + m1[5]*m2[3], + m1[2]*m2[2] + m1[6]*m2[3], + m1[3]*m2[2] + m1[7]*m2[3], + } +} + +// Mul2x3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x2) Mul2x3(m2 Mat2x3) Mat4x3 { + return Mat4x3{ + m1[0]*m2[0] + m1[4]*m2[1], + m1[1]*m2[0] + m1[5]*m2[1], + m1[2]*m2[0] + m1[6]*m2[1], + m1[3]*m2[0] + m1[7]*m2[1], + m1[0]*m2[2] + m1[4]*m2[3], + m1[1]*m2[2] + m1[5]*m2[3], + m1[2]*m2[2] + m1[6]*m2[3], + m1[3]*m2[2] + m1[7]*m2[3], + m1[0]*m2[4] + m1[4]*m2[5], + m1[1]*m2[4] + m1[5]*m2[5], + m1[2]*m2[4] + m1[6]*m2[5], + m1[3]*m2[4] + m1[7]*m2[5], + } +} + +// Mul2x4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x2) Mul2x4(m2 Mat2x4) Mat4 { + return Mat4{ + m1[0]*m2[0] + m1[4]*m2[1], + m1[1]*m2[0] + m1[5]*m2[1], + m1[2]*m2[0] + m1[6]*m2[1], + m1[3]*m2[0] + m1[7]*m2[1], + m1[0]*m2[2] + m1[4]*m2[3], + m1[1]*m2[2] + m1[5]*m2[3], + m1[2]*m2[2] + m1[6]*m2[3], + m1[3]*m2[2] + m1[7]*m2[3], + m1[0]*m2[4] + m1[4]*m2[5], + m1[1]*m2[4] + m1[5]*m2[5], + m1[2]*m2[4] + m1[6]*m2[5], + m1[3]*m2[4] + m1[7]*m2[5], + m1[0]*m2[6] + m1[4]*m2[7], + m1[1]*m2[6] + m1[5]*m2[7], + m1[2]*m2[6] + m1[6]*m2[7], + m1[3]*m2[6] + m1[7]*m2[7], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat4x2) Transpose() Mat2x4 { + return Mat2x4{m1[0], m1[4], m1[1], m1[5], m1[2], m1[6], m1[3], m1[7]} +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat4x2) ApproxEqual(m2 Mat4x2) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat4x2) ApproxEqualThreshold(m2 Mat4x2, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat4x2) ApproxFuncEqual(m2 Mat4x2, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat4x2) At(row, col int) float32 { + return m[col*4+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat4x2) Set(row, col int, value float32) { + m[col*4+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat4x2) Index(row, col int) int { + return col*4 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat4x2) Row(row int) Vec2 { + return Vec2{m[row+0], m[row+4]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat4x2) Rows() (row0, row1, row2, row3 Vec2) { + return m.Row(0), m.Row(1), m.Row(2), m.Row(3) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat4x2) Col(col int) Vec4 { + return Vec4{m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat4x2) Cols() (col0, col1 Vec4) { + return m.Col(0), m.Col(1) +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat4x2) Abs() Mat4x2 { + return Mat4x2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7])} +} + +// Pretty prints the matrix +func (m Mat4x2) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 4; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat4x3) SetCol(col int, v Vec4) { + m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat4x3) SetRow(row int, v Vec3) { + m[row+0], m[row+4], m[row+8] = v[0], v[1], v[2] +} + +// Mat4x3FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat4x3FromRows(row0, row1, row2, row3 Vec3) Mat4x3 { + return Mat4x3{row0[0], row1[0], row2[0], row3[0], row0[1], row1[1], row2[1], row3[1], row0[2], row1[2], row2[2], row3[2]} +} + +// Mat4x3FromCols builds a new matrix from column vectors. +func Mat4x3FromCols(col0, col1, col2 Vec4) Mat4x3 { + return Mat4x3{col0[0], col0[1], col0[2], col0[3], col1[0], col1[1], col1[2], col1[3], col2[0], col2[1], col2[2], col2[3]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat4x3) Add(m2 Mat4x3) Mat4x3 { + return Mat4x3{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8], m1[9] + m2[9], m1[10] + m2[10], m1[11] + m2[11]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat4x3) Sub(m2 Mat4x3) Mat4x3 { + return Mat4x3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat4x3) Mul(c float32) Mat4x3 { + return Mat4x3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c} +} + +// Mul3x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x3) Mul3x1(m2 Vec3) Vec4 { + return Vec4{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2], + } +} + +// Mul3x2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x3) Mul3x2(m2 Mat3x2) Mat4x2 { + return Mat4x2{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2], + m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5], + m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5], + m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5], + m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5], + } +} + +// Mul3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x3) Mul3(m2 Mat3) Mat4x3 { + return Mat4x3{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2], + m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5], + m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5], + m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5], + m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5], + m1[0]*m2[6] + m1[4]*m2[7] + m1[8]*m2[8], + m1[1]*m2[6] + m1[5]*m2[7] + m1[9]*m2[8], + m1[2]*m2[6] + m1[6]*m2[7] + m1[10]*m2[8], + m1[3]*m2[6] + m1[7]*m2[7] + m1[11]*m2[8], + } +} + +// Mul3x4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4x3) Mul3x4(m2 Mat3x4) Mat4 { + return Mat4{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2], + m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5], + m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5], + m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5], + m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5], + m1[0]*m2[6] + m1[4]*m2[7] + m1[8]*m2[8], + m1[1]*m2[6] + m1[5]*m2[7] + m1[9]*m2[8], + m1[2]*m2[6] + m1[6]*m2[7] + m1[10]*m2[8], + m1[3]*m2[6] + m1[7]*m2[7] + m1[11]*m2[8], + m1[0]*m2[9] + m1[4]*m2[10] + m1[8]*m2[11], + m1[1]*m2[9] + m1[5]*m2[10] + m1[9]*m2[11], + m1[2]*m2[9] + m1[6]*m2[10] + m1[10]*m2[11], + m1[3]*m2[9] + m1[7]*m2[10] + m1[11]*m2[11], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat4x3) Transpose() Mat3x4 { + return Mat3x4{m1[0], m1[4], m1[8], m1[1], m1[5], m1[9], m1[2], m1[6], m1[10], m1[3], m1[7], m1[11]} +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat4x3) ApproxEqual(m2 Mat4x3) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat4x3) ApproxEqualThreshold(m2 Mat4x3, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat4x3) ApproxFuncEqual(m2 Mat4x3, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat4x3) At(row, col int) float32 { + return m[col*4+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat4x3) Set(row, col int, value float32) { + m[col*4+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat4x3) Index(row, col int) int { + return col*4 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat4x3) Row(row int) Vec3 { + return Vec3{m[row+0], m[row+4], m[row+8]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat4x3) Rows() (row0, row1, row2, row3 Vec3) { + return m.Row(0), m.Row(1), m.Row(2), m.Row(3) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat4x3) Col(col int) Vec4 { + return Vec4{m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat4x3) Cols() (col0, col1, col2 Vec4) { + return m.Col(0), m.Col(1), m.Col(2) +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat4x3) Abs() Mat4x3 { + return Mat4x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11])} +} + +// Pretty prints the matrix +func (m Mat4x3) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 4; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *Mat4) SetCol(col int, v Vec4) { + m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3] +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *Mat4) SetRow(row int, v Vec4) { + m[row+0], m[row+4], m[row+8], m[row+12] = v[0], v[1], v[2], v[3] +} + +// Diag is a basic operation on a square matrix that simply +// returns main diagonal (meaning all elements such that row==col). +func (m Mat4) Diag() Vec4 { + return Vec4{m[0], m[5], m[10], m[15]} +} + +// Ident4 returns the 4x4 identity matrix. +// The identity matrix is a square matrix with the value 1 on its +// diagonals. The characteristic property of the identity matrix is that +// any matrix multiplied by it is itself. (MI = M; IN = N) +func Ident4() Mat4 { + return Mat4{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1} +} + +// Diag4 creates a diagonal matrix from the entries of the input vector. +// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0. +// +// Another way to think about it is that the identity is this function where the every vector element is 1. +func Diag4(v Vec4) Mat4 { + var m Mat4 + m[0], m[5], m[10], m[15] = v[0], v[1], v[2], v[3] + return m +} + +// Mat4FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func Mat4FromRows(row0, row1, row2, row3 Vec4) Mat4 { + return Mat4{row0[0], row1[0], row2[0], row3[0], row0[1], row1[1], row2[1], row3[1], row0[2], row1[2], row2[2], row3[2], row0[3], row1[3], row2[3], row3[3]} +} + +// Mat4FromCols builds a new matrix from column vectors. +func Mat4FromCols(col0, col1, col2, col3 Vec4) Mat4 { + return Mat4{col0[0], col0[1], col0[2], col0[3], col1[0], col1[1], col1[2], col1[3], col2[0], col2[1], col2[2], col2[3], col3[0], col3[1], col3[2], col3[3]} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 Mat4) Add(m2 Mat4) Mat4 { + return Mat4{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8], m1[9] + m2[9], m1[10] + m2[10], m1[11] + m2[11], m1[12] + m2[12], m1[13] + m2[13], m1[14] + m2[14], m1[15] + m2[15]} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 Mat4) Sub(m2 Mat4) Mat4 { + return Mat4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11], m1[12] - m2[12], m1[13] - m2[13], m1[14] - m2[14], m1[15] - m2[15]} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 Mat4) Mul(c float32) Mat4 { + return Mat4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c, m1[12] * c, m1[13] * c, m1[14] * c, m1[15] * c} +} + +// Mul4x1 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4) Mul4x1(m2 Vec4) Vec4 { + return Vec4{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3], + } +} + +// Mul4x2 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4) Mul4x2(m2 Mat4x2) Mat4x2 { + return Mat4x2{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3], + m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7], + m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7], + m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7], + m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7], + } +} + +// Mul4x3 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4) Mul4x3(m2 Mat4x3) Mat4x3 { + return Mat4x3{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3], + m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7], + m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7], + m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7], + m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7], + m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11], + m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11], + m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11], + m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11], + } +} + +// Mul4 performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 Mat4) Mul4(m2 Mat4) Mat4 { + return Mat4{ + m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3], + m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3], + m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3], + m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3], + m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7], + m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7], + m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7], + m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7], + m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11], + m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11], + m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11], + m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11], + m1[0]*m2[12] + m1[4]*m2[13] + m1[8]*m2[14] + m1[12]*m2[15], + m1[1]*m2[12] + m1[5]*m2[13] + m1[9]*m2[14] + m1[13]*m2[15], + m1[2]*m2[12] + m1[6]*m2[13] + m1[10]*m2[14] + m1[14]*m2[15], + m1[3]*m2[12] + m1[7]*m2[13] + m1[11]*m2[14] + m1[15]*m2[15], + } +} + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 Mat4) Transpose() Mat4 { + return Mat4{m1[0], m1[4], m1[8], m1[12], m1[1], m1[5], m1[9], m1[13], m1[2], m1[6], m1[10], m1[14], m1[3], m1[7], m1[11], m1[15]} +} + +// The determinant of a matrix is a measure of a square matrix's +// singularity and invertability, among other things. In this library, the +// determinant is hard coded based on pre-computed cofactor expansion, and uses +// no loops. Of course, the addition and multiplication must still be done. +func (m Mat4) Det() float32 { + return m[0]*m[5]*m[10]*m[15] - m[0]*m[5]*m[11]*m[14] - m[0]*m[6]*m[9]*m[15] + m[0]*m[6]*m[11]*m[13] + m[0]*m[7]*m[9]*m[14] - m[0]*m[7]*m[10]*m[13] - m[1]*m[4]*m[10]*m[15] + m[1]*m[4]*m[11]*m[14] + m[1]*m[6]*m[8]*m[15] - m[1]*m[6]*m[11]*m[12] - m[1]*m[7]*m[8]*m[14] + m[1]*m[7]*m[10]*m[12] + m[2]*m[4]*m[9]*m[15] - m[2]*m[4]*m[11]*m[13] - m[2]*m[5]*m[8]*m[15] + m[2]*m[5]*m[11]*m[12] + m[2]*m[7]*m[8]*m[13] - m[2]*m[7]*m[9]*m[12] - m[3]*m[4]*m[9]*m[14] + m[3]*m[4]*m[10]*m[13] + m[3]*m[5]*m[8]*m[14] - m[3]*m[5]*m[10]*m[12] - m[3]*m[6]*m[8]*m[13] + m[3]*m[6]*m[9]*m[12] +} + +// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the +// original, yields the identity. +// +// M_inv * M = M * M_inv = I +// +// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling +// are still done. This can still be (relatively) expensive for a 4x4. +// +// This function checks the determinant to see if the matrix is invertible. +// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is +// entirely plausible to get a false positive or negative. +// In the future, an alternate function may be written which takes in a pre-computed determinant. +func (m Mat4) Inv() Mat4 { + det := m.Det() + if FloatEqual(det, float32(0.0)) { + return Mat4{} + } + + retMat := Mat4{ + -m[7]*m[10]*m[13] + m[6]*m[11]*m[13] + m[7]*m[9]*m[14] - m[5]*m[11]*m[14] - m[6]*m[9]*m[15] + m[5]*m[10]*m[15], + m[3]*m[10]*m[13] - m[2]*m[11]*m[13] - m[3]*m[9]*m[14] + m[1]*m[11]*m[14] + m[2]*m[9]*m[15] - m[1]*m[10]*m[15], + -m[3]*m[6]*m[13] + m[2]*m[7]*m[13] + m[3]*m[5]*m[14] - m[1]*m[7]*m[14] - m[2]*m[5]*m[15] + m[1]*m[6]*m[15], + m[3]*m[6]*m[9] - m[2]*m[7]*m[9] - m[3]*m[5]*m[10] + m[1]*m[7]*m[10] + m[2]*m[5]*m[11] - m[1]*m[6]*m[11], + m[7]*m[10]*m[12] - m[6]*m[11]*m[12] - m[7]*m[8]*m[14] + m[4]*m[11]*m[14] + m[6]*m[8]*m[15] - m[4]*m[10]*m[15], + -m[3]*m[10]*m[12] + m[2]*m[11]*m[12] + m[3]*m[8]*m[14] - m[0]*m[11]*m[14] - m[2]*m[8]*m[15] + m[0]*m[10]*m[15], + m[3]*m[6]*m[12] - m[2]*m[7]*m[12] - m[3]*m[4]*m[14] + m[0]*m[7]*m[14] + m[2]*m[4]*m[15] - m[0]*m[6]*m[15], + -m[3]*m[6]*m[8] + m[2]*m[7]*m[8] + m[3]*m[4]*m[10] - m[0]*m[7]*m[10] - m[2]*m[4]*m[11] + m[0]*m[6]*m[11], + -m[7]*m[9]*m[12] + m[5]*m[11]*m[12] + m[7]*m[8]*m[13] - m[4]*m[11]*m[13] - m[5]*m[8]*m[15] + m[4]*m[9]*m[15], + m[3]*m[9]*m[12] - m[1]*m[11]*m[12] - m[3]*m[8]*m[13] + m[0]*m[11]*m[13] + m[1]*m[8]*m[15] - m[0]*m[9]*m[15], + -m[3]*m[5]*m[12] + m[1]*m[7]*m[12] + m[3]*m[4]*m[13] - m[0]*m[7]*m[13] - m[1]*m[4]*m[15] + m[0]*m[5]*m[15], + m[3]*m[5]*m[8] - m[1]*m[7]*m[8] - m[3]*m[4]*m[9] + m[0]*m[7]*m[9] + m[1]*m[4]*m[11] - m[0]*m[5]*m[11], + m[6]*m[9]*m[12] - m[5]*m[10]*m[12] - m[6]*m[8]*m[13] + m[4]*m[10]*m[13] + m[5]*m[8]*m[14] - m[4]*m[9]*m[14], + -m[2]*m[9]*m[12] + m[1]*m[10]*m[12] + m[2]*m[8]*m[13] - m[0]*m[10]*m[13] - m[1]*m[8]*m[14] + m[0]*m[9]*m[14], + m[2]*m[5]*m[12] - m[1]*m[6]*m[12] - m[2]*m[4]*m[13] + m[0]*m[6]*m[13] + m[1]*m[4]*m[14] - m[0]*m[5]*m[14], + -m[2]*m[5]*m[8] + m[1]*m[6]*m[8] + m[2]*m[4]*m[9] - m[0]*m[6]*m[9] - m[1]*m[4]*m[10] + m[0]*m[5]*m[10], + } + + return retMat.Mul(1 / det) +} + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 Mat4) ApproxEqual(m2 Mat4) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 Mat4) ApproxEqualThreshold(m2 Mat4, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 Mat4) ApproxFuncEqual(m2 Mat4, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m Mat4) At(row, col int) float32 { + return m[col*4+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *Mat4) Set(row, col int, value float32) { + m[col*4+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m Mat4) Index(row, col int) int { + return col*4 + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m Mat4) Row(row int) Vec4 { + return Vec4{m[row+0], m[row+4], m[row+8], m[row+12]} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m Mat4) Rows() (row0, row1, row2, row3 Vec4) { + return m.Row(0), m.Row(1), m.Row(2), m.Row(3) +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m Mat4) Col(col int) Vec4 { + return Vec4{m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3]} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m Mat4) Cols() (col0, col1, col2, col3 Vec4) { + return m.Col(0), m.Col(1), m.Col(2), m.Col(3) +} + +// Trace is a basic operation on a square matrix that simply +// sums up all elements on the main diagonal (meaning all elements such that row==col). +func (m Mat4) Trace() float32 { + return m[0] + m[5] + m[10] + m[15] +} + +// Abs returns the element-wise absolute value of this matrix +func (m Mat4) Abs() Mat4 { + return Mat4{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11]), Abs(m[12]), Abs(m[13]), Abs(m[14]), Abs(m[15])} +} + +// Pretty prints the matrix +func (m Mat4) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < 4; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/matrix.tmpl b/vendor/github.com/go-gl/mathgl/mgl32/matrix.tmpl new file mode 100644 index 0000000..ab32e58 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/matrix.tmpl @@ -0,0 +1,370 @@ +// Copyright 2014 The go-gl/mathgl Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// <<.Comment>> +// Edit <<.TemplateName>> and run "go generate" to make changes. + +package mgl32 + +import ( + "bytes" + "fmt" + "golang.org/x/image/math/f32" + "text/tabwriter" +) + +type Mat2 [4]float32 +type Mat2x3 [6]float32 +type Mat2x4 [8]float32 +type Mat3x2 [6]float32 +type Mat3 f32.Mat3 +type Mat3x4 [12]float32 +type Mat4x2 [8]float32 +type Mat4x3 [12]float32 +type Mat4 f32.Mat4 + +func (m Mat2) Mat3() Mat3 { + col0, col1 := m.Cols() + return Mat3FromCols( + col0.Vec3(0), + col1.Vec3(0), + Vec3{0, 0, 1}, + ) +} + +func (m Mat2) Mat4() Mat4 { + col0, col1 := m.Cols() + return Mat4FromCols( + col0.Vec4(0, 0), + col1.Vec4(0, 0), + Vec4{0, 0, 1, 0}, + Vec4{0, 0, 0, 1}, + ) +} + +func (m Mat3) Mat2() Mat2 { + col0, col1, _ := m.Cols() + return Mat2FromCols( + col0.Vec2(), + col1.Vec2(), + ) +} + +func (m Mat3) Mat4() Mat4 { + col0, col1, col2 := m.Cols() + return Mat4FromCols( + col0.Vec4(0), + col1.Vec4(0), + col2.Vec4(0), + Vec4{0, 0, 0, 1}, + ) +} + +func (m Mat4) Mat2() Mat2 { + col0, col1, _, _ := m.Cols() + return Mat2FromCols( + col0.Vec2(), + col1.Vec2(), + ) +} + +func (m Mat4) Mat3() Mat3 { + col0, col1, col2, _ := m.Cols() + return Mat3FromCols( + col0.Vec3(), + col1.Vec3(), + col2.Vec3(), + ) +} + + +<> +<><> +<<$type := typename $m $n>> + +// Sets a Column within the Matrix, so it mutates the calling matrix. +func (m *<<$type>>) SetCol(col int, v <>) { + <><>m[col*<<$m>>+<<$i>>]<> = <> +} + +// Sets a Row within the Matrix, so it mutates the calling matrix. +func (m *<<$type>>) SetRow(row int, v <>) { + <><>m[row+<>]<> = <> +} + +<> +// Diag is a basic operation on a square matrix that simply +// returns main diagonal (meaning all elements such that row==col). +func (m <<$type>>) Diag() <> { + return <>{<>m[<>],<>} +} +<> + +<> +// Ident<<$m>> returns the <<$m>>x<<$n>> identity matrix. +// The identity matrix is a square matrix with the value 1 on its +// diagonals. The characteristic property of the identity matrix is that +// any matrix multiplied by it is itself. (MI = M; IN = N) +func Ident<<$m>>() <<$type>> { + return <<$type>>{<><>1<>0<>,<>} +} +<> + +<> +// Diag<<$m>> creates a diagonal matrix from the entries of the input vector. +// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0. +// +// Another way to think about it is that the identity is this function where the every vector element is 1. +func Diag<<$m>>(v <>) <<$type>> { + var m <<$type>> + <><>m[<>]<> = <> + return m +} +<> + +// <<$type>>FromRows builds a new matrix from row vectors. +// The resulting matrix will still be in column major order, but this can be +// good for hand-building matrices. + +func <<$type>>FromRows(<><>row<<$i>><> <>) <<$type>> { + return <<$type>>{<>row<<$i.M>>[<<$i.N>>],<>} +} + +// <<$type>>FromCols builds a new matrix from column vectors. +func <<$type>>FromCols(<> <>) <<$type>> { + return <<$type>>{<>col<<$i.N>>[<<$i.M>>], <>} +} + +// Add performs an element-wise addition of two matrices, this is +// equivalent to iterating over every element of m1 and adding the corresponding value of m2. +func (m1 <<$type>>) Add(m2 <<$type>>) <<$type>> { + return <<$type>>{<< range $i := matiter $m $n>>m1[<<$i>>] + m2[<<$i>>], <>} +} + +// Sub performs an element-wise subtraction of two matrices, this is +// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2. +func (m1 <<$type>>) Sub(m2 <<$type>>) <<$type>> { + return <<$type>>{<< range $i := matiter $m $n>>m1[<<$i>>] - m2[<<$i>>], <>} +} + +// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating +// over every element of the matrix and multiply it by c. +func (m1 <<$type>>) Mul(c float32) <<$type>> { + return <<$type>>{<< range $i := matiter $m $n>>m1[<<$i>>] * c, <>} +} + +<> +// Mul<<$n>><>x<<$o>><> performs a "matrix product" between this matrix +// and another of the given dimension. For any two matrices of dimensionality +// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using +// Mul4x2 will result in a Mat4x2. +func (m1 <<$type>>) Mul<<$n>><>x<<$o>><>(m2 <>) <> { + return <>{<> + <><>m1[<>]*m2[<>]<>,<> + } +} +<> + +// Transpose produces the transpose of this matrix. For any MxN matrix +// the transpose is an NxM matrix with the rows swapped with the columns. For instance +// the transpose of the Mat3x2 is a Mat2x3 like so: +// +// [[a b]] [[a c e]] +// [[c d]] = [[b d f]] +// [[e f]] +func (m1 <<$type>>) Transpose() <> { + return <>{<>m1[<>], <>} +} + +<> +// The determinant of a matrix is a measure of a square matrix's +// singularity and invertability, among other things. In this library, the +// determinant is hard coded based on pre-computed cofactor expansion, and uses +// no loops. Of course, the addition and multiplication must still be done. +func (m <<$type>>) Det() float32 { + <> + return m[0]*m[3] - m[1]*m[2] + <> + return m[0]*m[4]*m[8] + m[3]*m[7]*m[2] + m[6]*m[1]*m[5] - m[6]*m[4]*m[2] - m[3]*m[1]*m[8] - m[0]*m[7]*m[5] + <> + return m[0]*m[5]*m[10]*m[15] - m[0]*m[5]*m[11]*m[14] - m[0]*m[6]*m[9]*m[15] + m[0]*m[6]*m[11]*m[13] + m[0]*m[7]*m[9]*m[14] - m[0]*m[7]*m[10]*m[13] - m[1]*m[4]*m[10]*m[15] + m[1]*m[4]*m[11]*m[14] + m[1]*m[6]*m[8]*m[15] - m[1]*m[6]*m[11]*m[12] - m[1]*m[7]*m[8]*m[14] + m[1]*m[7]*m[10]*m[12] + m[2]*m[4]*m[9]*m[15] - m[2]*m[4]*m[11]*m[13] - m[2]*m[5]*m[8]*m[15] + m[2]*m[5]*m[11]*m[12] + m[2]*m[7]*m[8]*m[13] - m[2]*m[7]*m[9]*m[12] - m[3]*m[4]*m[9]*m[14] + m[3]*m[4]*m[10]*m[13] + m[3]*m[5]*m[8]*m[14] - m[3]*m[5]*m[10]*m[12] - m[3]*m[6]*m[8]*m[13] + m[3]*m[6]*m[9]*m[12] + <> +} +<> + +<> +// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the +// original, yields the identity. +// +// M_inv * M = M * M_inv = I +// +// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling +// are still done. This can still be (relatively) expensive for a 4x4. +// +// This function checks the determinant to see if the matrix is invertible. +// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is +// entirely plausible to get a false positive or negative. +// In the future, an alternate function may be written which takes in a pre-computed determinant. +func (m <<$type>>) Inv() <<$type>> { + det := m.Det() + if FloatEqual(det, float32(0.0)) { + return <<$type>>{} + } + <> + retMat := Mat2{m[3], -m[1], -m[2], m[0]} + <> + retMat := Mat3{ + m[4]*m[8] - m[5]*m[7], + m[2]*m[7] - m[1]*m[8], + m[1]*m[5] - m[2]*m[4], + m[5]*m[6] - m[3]*m[8], + m[0]*m[8] - m[2]*m[6], + m[2]*m[3] - m[0]*m[5], + m[3]*m[7] - m[4]*m[6], + m[1]*m[6] - m[0]*m[7], + m[0]*m[4] - m[1]*m[3], + } + <> + retMat := Mat4{ + -m[7]*m[10]*m[13] + m[6]*m[11]*m[13] + m[7]*m[9]*m[14] - m[5]*m[11]*m[14] - m[6]*m[9]*m[15] + m[5]*m[10]*m[15], + m[3]*m[10]*m[13] - m[2]*m[11]*m[13] - m[3]*m[9]*m[14] + m[1]*m[11]*m[14] + m[2]*m[9]*m[15] - m[1]*m[10]*m[15], + -m[3]*m[6]*m[13] + m[2]*m[7]*m[13] + m[3]*m[5]*m[14] - m[1]*m[7]*m[14] - m[2]*m[5]*m[15] + m[1]*m[6]*m[15], + m[3]*m[6]*m[9] - m[2]*m[7]*m[9] - m[3]*m[5]*m[10] + m[1]*m[7]*m[10] + m[2]*m[5]*m[11] - m[1]*m[6]*m[11], + m[7]*m[10]*m[12] - m[6]*m[11]*m[12] - m[7]*m[8]*m[14] + m[4]*m[11]*m[14] + m[6]*m[8]*m[15] - m[4]*m[10]*m[15], + -m[3]*m[10]*m[12] + m[2]*m[11]*m[12] + m[3]*m[8]*m[14] - m[0]*m[11]*m[14] - m[2]*m[8]*m[15] + m[0]*m[10]*m[15], + m[3]*m[6]*m[12] - m[2]*m[7]*m[12] - m[3]*m[4]*m[14] + m[0]*m[7]*m[14] + m[2]*m[4]*m[15] - m[0]*m[6]*m[15], + -m[3]*m[6]*m[8] + m[2]*m[7]*m[8] + m[3]*m[4]*m[10] - m[0]*m[7]*m[10] - m[2]*m[4]*m[11] + m[0]*m[6]*m[11], + -m[7]*m[9]*m[12] + m[5]*m[11]*m[12] + m[7]*m[8]*m[13] - m[4]*m[11]*m[13] - m[5]*m[8]*m[15] + m[4]*m[9]*m[15], + m[3]*m[9]*m[12] - m[1]*m[11]*m[12] - m[3]*m[8]*m[13] + m[0]*m[11]*m[13] + m[1]*m[8]*m[15] - m[0]*m[9]*m[15], + -m[3]*m[5]*m[12] + m[1]*m[7]*m[12] + m[3]*m[4]*m[13] - m[0]*m[7]*m[13] - m[1]*m[4]*m[15] + m[0]*m[5]*m[15], + m[3]*m[5]*m[8] - m[1]*m[7]*m[8] - m[3]*m[4]*m[9] + m[0]*m[7]*m[9] + m[1]*m[4]*m[11] - m[0]*m[5]*m[11], + m[6]*m[9]*m[12] - m[5]*m[10]*m[12] - m[6]*m[8]*m[13] + m[4]*m[10]*m[13] + m[5]*m[8]*m[14] - m[4]*m[9]*m[14], + -m[2]*m[9]*m[12] + m[1]*m[10]*m[12] + m[2]*m[8]*m[13] - m[0]*m[10]*m[13] - m[1]*m[8]*m[14] + m[0]*m[9]*m[14], + m[2]*m[5]*m[12] - m[1]*m[6]*m[12] - m[2]*m[4]*m[13] + m[0]*m[6]*m[13] + m[1]*m[4]*m[14] - m[0]*m[5]*m[14], + -m[2]*m[5]*m[8] + m[1]*m[6]*m[8] + m[2]*m[4]*m[9] - m[0]*m[6]*m[9] - m[1]*m[4]*m[10] + m[0]*m[5]*m[10], + } + <> + return retMat.Mul(1 / det) +} +<> + +// ApproxEqual performs an element-wise approximate equality test between two matrices, +// as if FloatEqual had been used. +func (m1 <<$type>>) ApproxEqual(m2 <<$type>>) bool { + for i := range m1 { + if !FloatEqual(m1[i], m2[i]) { + return false + } + } + return true +} + +// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices +// with a given epsilon threshold, as if FloatEqualThreshold had been used. +func (m1 <<$type>>) ApproxEqualThreshold(m2 <<$type>>, threshold float32) bool { + for i := range m1 { + if !FloatEqualThreshold(m1[i], m2[i], threshold) { + return false + } + } + return true +} + +// ApproxEqualFunc performs an element-wise approximate equality test between two matrices +// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison +// function may be used in practice. +func (m1 <<$type>>) ApproxFuncEqual(m2 <<$type>>, eq func(float32, float32) bool) bool { + for i := range m1 { + if !eq(m1[i], m2[i]) { + return false + } + } + return true +} + +// At returns the matrix element at the given row and column. +// This is equivalent to mat[col * numRow + row] where numRow is constant +// (E.G. for a Mat3x2 it's equal to 3) +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds. +func (m <<$type>>) At(row, col int) float32 { + return m[col*<<$m>>+row] +} + +// Set sets the corresponding matrix element at the given row and column. +// This has a pointer receiver because it mutates the matrix. +// +// This method is garbage-in garbage-out. For instance, on a Mat4 asking for +// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds. +func (m *<<$type>>) Set(row, col int, value float32) { + m[col*<<$m>>+row] = value +} + +// Index returns the index of the given row and column, to be used with direct +// access. E.G. Index(0,0) = 0. +// +// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of +// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause +// a panic if you try to access the array with it if it's truly out of bounds. +func (m <<$type>>) Index(row, col int) int { + return col*<<$m>> + row +} + +// Row returns a vector representing the corresponding row (starting at row 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecM for a MxN matrix. +func (m <<$type>>) Row(row int) <> { + return <>{<>m[row+<>],<>} +} + +// Rows decomposes a matrix into its corresponding row vectors. +// This is equivalent to calling mat.Row for each row. +func (m <<$type>>) Rows() (<> <>) { + return <> +} + +// Col returns a vector representing the corresponding column (starting at col 0). +// This package makes no distinction between row and column vectors, so it +// will be a normal VecN for a MxN matrix. +func (m <<$type>>) Col(col int) <> { + return <>{<>m[col*<<$m>>+<<$i>>],<>} +} + +// Cols decomposes a matrix into its corresponding column vectors. +// This is equivalent to calling mat.Col for each column. +func (m <<$type>>) Cols() (<> <>) { + return <> +} + +<> +// Trace is a basic operation on a square matrix that simply +// sums up all elements on the main diagonal (meaning all elements such that row==col). +func (m <<$type>>) Trace() float32 { + return <><> m[<>]<> +} +<> + +// Abs returns the element-wise absolute value of this matrix +func (m <<$type>>) Abs() <<$type>> { + return <<$type>>{<>} +} + +// Pretty prints the matrix +func (m <<$type>>) String() string { + buf := new(bytes.Buffer) + w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight) + for i := 0; i < <<$m>>; i++ { + for _, col := range m.Row(i) { + fmt.Fprintf(w, "%f\t", col) + } + + fmt.Fprintln(w, "") + } + w.Flush() + + return buf.String() +} + +<><> <> diff --git a/vendor/github.com/go-gl/mathgl/mgl32/mempool.go b/vendor/github.com/go-gl/mathgl/mgl32/mempool.go new file mode 100644 index 0000000..9c27151 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/mempool.go @@ -0,0 +1,121 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "sync" +) + +var ( + slicePools []*sync.Pool + listLock sync.RWMutex +) + +var shouldPool = true + +func DisableMemoryPooling() { + shouldPool = false +} + +// Returns the given memory pool. If the pool doesn't exist, it will +// create all pools up to element i. The number "i" corresponds to "p" +// in most other comments. That is, it's Ceil(log_2(whatever)). So i=0 +// means you'll get the pool for slices of size 1, i=1 for size 2, i=2 for size 4, +// and so on. +// +// This is concurrency safe and uses an RWMutex to protect the list expansion. +func getPool(i int) *sync.Pool { + listLock.RLock() + if i >= len(slicePools) { + + // Promote to a write lock because we now + // need to mutate the pool + listLock.RUnlock() + listLock.Lock() + defer listLock.Unlock() + + for n := i - len(slicePools); n >= 0; n-- { + newFunc := genPoolNew(1 << uint(len(slicePools))) + slicePools = append(slicePools, &sync.Pool{New: newFunc}) + } + } else { + defer listLock.RUnlock() + } + + return slicePools[i] +} + +func genPoolNew(i int) func() interface{} { + return func() interface{} { + return make([]float32, 0, i) + } +} + +// Grabs a slice from the memory pool, such that its cap +// is 2^p where p is Ceil(log_2(size)). It will be downsliced +// such that the len is size. +func grabFromPool(size int) []float32 { + pool, exact := binLog(size) + + // Tried to grab something of size + // zero or less + if pool == -1 { + return nil + } + + // If the log is not exact, we + // need to "overallocate" so we have + // log+1 + if !exact { + pool++ + } + + slice := getPool(pool).Get().([]float32) + slice = slice[:size] + return slice +} + +// Returns a slice to the appropriate pool. If the slice does not have a cap that's precisely +// a power of 2, this will panic. +func returnToPool(slice []float32) { + if cap(slice) == 0 { + return + } + + pool, exact := binLog(cap(slice)) + + if !exact { + panic("attempt to pool slice with non-exact cap. If you're a user, please file an issue with github.com/go-gl/mathgl about this bug. This should never happen.") + } + + getPool(pool).Put(slice) +} + +// This returns the integer base 2 log of the value +// and whether the log is exact or rounded down. +// +// This is only for positive integers. +// +// There are faster ways to do this, I'm open to suggestions. Most rely on knowing system endianness +// which Go makes hard to do. I'm hesistant to use float conversions and the math package because of off-by-one errors. +func binLog(val int) (int, bool) { + if val <= 0 { + return -1, false + } + + exact := true + l := 0 + for ; val > 1; val = val >> 1 { + // If the current lsb is 1 and the number + // is not equal to 1, this is not an exact + // log, but rather a rounding of it + if val&1 != 0 { + exact = false + } + l++ + } + + return l, exact +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/project.go b/vendor/github.com/go-gl/mathgl/mgl32/project.go new file mode 100644 index 0000000..5d0da14 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/project.go @@ -0,0 +1,98 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "errors" + "math" +) + +func Ortho(left, right, bottom, top, near, far float32) Mat4 { + rml, tmb, fmn := (right - left), (top - bottom), (far - near) + + return Mat4{float32(2. / rml), 0, 0, 0, 0, float32(2. / tmb), 0, 0, 0, 0, float32(-2. / fmn), 0, float32(-(right + left) / rml), float32(-(top + bottom) / tmb), float32(-(far + near) / fmn), 1} +} + +// Equivalent to Ortho with the near and far planes being -1 and 1, respectively +func Ortho2D(left, right, bottom, top float32) Mat4 { + return Ortho(left, right, bottom, top, -1, 1) +} + +func Perspective(fovy, aspect, near, far float32) Mat4 { + // fovy = (fovy * math.Pi) / 180.0 // convert from degrees to radians + nmf, f := near-far, float32(1./math.Tan(float64(fovy)/2.0)) + + return Mat4{float32(f / aspect), 0, 0, 0, 0, float32(f), 0, 0, 0, 0, float32((near + far) / nmf), -1, 0, 0, float32((2. * far * near) / nmf), 0} +} + +func Frustum(left, right, bottom, top, near, far float32) Mat4 { + rml, tmb, fmn := (right - left), (top - bottom), (far - near) + A, B, C, D := (right+left)/rml, (top+bottom)/tmb, -(far+near)/fmn, -(2*far*near)/fmn + + return Mat4{float32((2. * near) / rml), 0, 0, 0, 0, float32((2. * near) / tmb), 0, 0, float32(A), float32(B), float32(C), -1, 0, 0, float32(D), 0} +} + +func LookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ float32) Mat4 { + return LookAtV(Vec3{eyeX, eyeY, eyeZ}, Vec3{centerX, centerY, centerZ}, Vec3{upX, upY, upZ}) +} + +// LookAtV generates a transform matrix from world space into the specific eye space +func LookAtV(eye, center, up Vec3) Mat4 { + f := center.Sub(eye).Normalize() + s := f.Cross(up.Normalize()).Normalize() + u := s.Cross(f) + + M := Mat4{ + s[0], u[0], -f[0], 0, + s[1], u[1], -f[1], 0, + s[2], u[2], -f[2], 0, + 0, 0, 0, 1, + } + + return M.Mul4(Translate3D(float32(-eye[0]), float32(-eye[1]), float32(-eye[2]))) +} + +// Transform a set of coordinates from object space (in obj) to window coordinates (with depth) +// +// Window coordinates are continuous, not discrete (well, as continuous as an IEEE Floating Point can be), so you won't get exact pixel locations +// without rounding or similar +func Project(obj Vec3, modelview, projection Mat4, initialX, initialY, width, height int) (win Vec3) { + obj4 := obj.Vec4(1) + + vpp := projection.Mul4(modelview).Mul4x1(obj4) + vpp = vpp.Mul(1 / vpp.W()) + win[0] = float32(initialX) + (float32(width)*(vpp[0]+1))/2 + win[1] = float32(initialY) + (float32(height)*(vpp[1]+1))/2 + win[2] = (vpp[2] + 1) / 2 + + return win +} + +// Transform a set of window coordinates to object space. If your MVP (projection.Mul(modelview) matrix is not invertible, this will return an error +// +// Note that the projection may not be perfect if you use strict pixel locations rather than the exact values given by Projectf. +// (It's still unlikely to be perfect due to precision errors, but it will be closer) +func UnProject(win Vec3, modelview, projection Mat4, initialX, initialY, width, height int) (obj Vec3, err error) { + inv := projection.Mul4(modelview).Inv() + var blank Mat4 + if inv == blank { + return Vec3{}, errors.New("Could not find matrix inverse (projection times modelview is probably non-singular)") + } + + obj4 := inv.Mul4x1(Vec4{ + (2 * (win[0] - float32(initialX)) / float32(width)) - 1, + (2 * (win[1] - float32(initialY)) / float32(height)) - 1, + 2*win[2] - 1, + 1.0, + }) + obj = obj4.Vec3() + + //if obj4[3] > MinValue {} + obj[0] /= obj4[3] + obj[1] /= obj4[3] + obj[2] /= obj4[3] + + return obj, nil +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/quat.go b/vendor/github.com/go-gl/mathgl/mgl32/quat.go new file mode 100644 index 0000000..a2ede3e --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/quat.go @@ -0,0 +1,458 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "math" +) + +// A rotation order is the order in which +// rotations will be transformed for the purposes of AnglesToQuat +type RotationOrder int + +const ( + XYX RotationOrder = iota + XYZ + XZX + XZY + YXY + YXZ + YZY + YZX + ZYZ + ZYX + ZXZ + ZXY +) + +// A Quaternion is an extension of the imaginary numbers; there's all sorts of +// interesting theory behind it. In 3D graphics we mostly use it as a cheap way of +// representing rotation since quaternions are cheaper to multiply by, and easier to +// interpolate than matrices. +// +// A Quaternion has two parts: W, the so-called scalar component, +// and "V", the vector component. The vector component is considered to +// be the part in 3D space, while W (loosely interpreted) is its 4D coordinate. +type Quat struct { + W float32 + V Vec3 +} + +// The quaternion identity: W=1; V=(0,0,0). +// +// As with all identities, multiplying any quaternion by this will yield the same +// quaternion you started with. +func QuatIdent() Quat { + return Quat{1., Vec3{0, 0, 0}} +} + +// Creates an angle from an axis and an angle relative to that axis. +// +// This is cheaper than HomogRotate3D. +func QuatRotate(angle float32, axis Vec3) Quat { + // angle = (float32(math.Pi) * angle) / 180.0 + + c, s := float32(math.Cos(float64(angle/2))), float32(math.Sin(float64(angle/2))) + + return Quat{c, axis.Mul(s)} +} + +// A convenient alias for q.V[0] +func (q Quat) X() float32 { + return q.V[0] +} + +// A convenient alias for q.V[1] +func (q Quat) Y() float32 { + return q.V[1] +} + +// A convenient alias for q.V[2] +func (q Quat) Z() float32 { + return q.V[2] +} + +// Adds two quaternions. It's no more complicated than +// adding their W and V components. +func (q1 Quat) Add(q2 Quat) Quat { + return Quat{q1.W + q2.W, q1.V.Add(q2.V)} +} + +// Subtracts two quaternions. It's no more complicated than +// subtracting their W and V components. +func (q1 Quat) Sub(q2 Quat) Quat { + return Quat{q1.W - q2.W, q1.V.Sub(q2.V)} +} + +// Multiplies two quaternions. This can be seen as a rotation. Note that +// Multiplication is NOT commutative, meaning q1.Mul(q2) does not necessarily +// equal q2.Mul(q1). +func (q1 Quat) Mul(q2 Quat) Quat { + return Quat{q1.W*q2.W - q1.V.Dot(q2.V), q1.V.Cross(q2.V).Add(q2.V.Mul(q1.W)).Add(q1.V.Mul(q2.W))} +} + +// Scales every element of the quaternion by some constant factor. +func (q1 Quat) Scale(c float32) Quat { + return Quat{q1.W * c, Vec3{q1.V[0] * c, q1.V[1] * c, q1.V[2] * c}} +} + +// Returns the conjugate of a quaternion. Equivalent to +// Quat{q1.W, q1.V.Mul(-1)} +func (q1 Quat) Conjugate() Quat { + return Quat{q1.W, q1.V.Mul(-1)} +} + +// Returns the Length of the quaternion, also known as its Norm. This is the same thing as +// the Len of a Vec4 +func (q1 Quat) Len() float32 { + return float32(math.Sqrt(float64(q1.W*q1.W + q1.V[0]*q1.V[0] + q1.V[1]*q1.V[1] + q1.V[2]*q1.V[2]))) +} + +// Norm() is an alias for Len() since both are very common terms. +func (q1 Quat) Norm() float32 { + return q1.Len() +} + +// Normalizes the quaternion, returning its versor (unit quaternion). +// +// This is the same as normalizing it as a Vec4. +func (q1 Quat) Normalize() Quat { + length := q1.Len() + + if FloatEqual(1, length) { + return q1 + } + if length == 0 { + return QuatIdent() + } + if length == InfPos { + length = MaxValue + } + + return Quat{q1.W * 1 / length, q1.V.Mul(1 / length)} +} + +// The inverse of a quaternion. The inverse is equivalent +// to the conjugate divided by the square of the length. +// +// This method computes the square norm by directly adding the sum +// of the squares of all terms instead of actually squaring q1.Len(), +// both for performance and precision. +func (q1 Quat) Inverse() Quat { + return q1.Conjugate().Scale(1 / q1.Dot(q1)) +} + +// Rotates a vector by the rotation this quaternion represents. +// This will result in a 3D vector. Strictly speaking, this is +// equivalent to q1.v.q* where the "."" is quaternion multiplication and v is interpreted +// as a quaternion with W 0 and V v. In code: +// q1.Mul(Quat{0,v}).Mul(q1.Conjugate()), and +// then retrieving the imaginary (vector) part. +// +// In practice, we hand-compute this in the general case and simplify +// to save a few operations. +func (q1 Quat) Rotate(v Vec3) Vec3 { + cross := q1.V.Cross(v) + // v + 2q_w * (q_v x v) + 2q_v x (q_v x v) + return v.Add(cross.Mul(2 * q1.W)).Add(q1.V.Mul(2).Cross(cross)) +} + +// Returns the homogeneous 3D rotation matrix corresponding to the quaternion. +func (q1 Quat) Mat4() Mat4 { + w, x, y, z := q1.W, q1.V[0], q1.V[1], q1.V[2] + return Mat4{ + 1 - 2*y*y - 2*z*z, 2*x*y + 2*w*z, 2*x*z - 2*w*y, 0, + 2*x*y - 2*w*z, 1 - 2*x*x - 2*z*z, 2*y*z + 2*w*x, 0, + 2*x*z + 2*w*y, 2*y*z - 2*w*x, 1 - 2*x*x - 2*y*y, 0, + 0, 0, 0, 1, + } +} + +// The dot product between two quaternions, equivalent to if this was a Vec4 +func (q1 Quat) Dot(q2 Quat) float32 { + return q1.W*q2.W + q1.V[0]*q2.V[0] + q1.V[1]*q2.V[1] + q1.V[2]*q2.V[2] +} + +// Returns whether the quaternions are approximately equal, as if +// FloatEqual was called on each matching element +func (q1 Quat) ApproxEqual(q2 Quat) bool { + return FloatEqual(q1.W, q2.W) && q1.V.ApproxEqual(q2.V) +} + +// Returns whether the quaternions are approximately equal with a given tolerence, as if +// FloatEqualThreshold was called on each matching element with the given epsilon +func (q1 Quat) ApproxEqualThreshold(q2 Quat, epsilon float32) bool { + return FloatEqualThreshold(q1.W, q2.W, epsilon) && q1.V.ApproxEqualThreshold(q2.V, epsilon) +} + +// Returns whether the quaternions are approximately equal using the given comparison function, as if +// the function had been called on each individual element +func (q1 Quat) ApproxEqualFunc(q2 Quat, f func(float32, float32) bool) bool { + return f(q1.W, q2.W) && q1.V.ApproxFuncEqual(q2.V, f) +} + +// Returns whether the quaternions represents the same orientation +// +// Different values can represent the same orientation (q == -q) because quaternions avoid singularities +// and discontinuities involved with rotation in 3 dimensions by adding extra dimensions +func (q1 Quat) OrientationEqual(q2 Quat) bool { + return q1.OrientationEqualThreshold(q2, Epsilon) +} + +// Returns whether the quaternions represents the same orientation with a given tolerence +func (q1 Quat) OrientationEqualThreshold(q2 Quat, epsilon float32) bool { + return Abs(q1.Normalize().Dot(q2.Normalize())) > 1-epsilon +} + +// Slerp is *S*pherical *L*inear Int*erp*olation, a method of interpolating +// between two quaternions. This always takes the straightest path on the sphere between +// the two quaternions, and maintains constant velocity. +// +// However, it's expensive and QuatSlerp(q1,q2) is not the same as QuatSlerp(q2,q1) +func QuatSlerp(q1, q2 Quat, amount float32) Quat { + q1, q2 = q1.Normalize(), q2.Normalize() + dot := q1.Dot(q2) + + // If the inputs are too close for comfort, linearly interpolate and normalize the result. + if dot > 0.9995 { + return QuatNlerp(q1, q2, amount) + } + + // This is here for precision errors, I'm perfectly aware that *technically* the dot is bound [-1,1], but since Acos will freak out if it's not (even if it's just a liiiiitle bit over due to normal error) we need to clamp it + dot = Clamp(dot, -1, 1) + + theta := float32(math.Acos(float64(dot))) * amount + c, s := float32(math.Cos(float64(theta))), float32(math.Sin(float64(theta))) + rel := q2.Sub(q1.Scale(dot)).Normalize() + + return q1.Scale(c).Add(rel.Scale(s)) +} + +// *L*inear Int*erp*olation between two Quaternions, cheap and simple. +// +// Not excessively useful, but uses can be found. +func QuatLerp(q1, q2 Quat, amount float32) Quat { + return q1.Add(q2.Sub(q1).Scale(amount)) +} + +// *Normalized* *L*inear Int*erp*olation between two Quaternions. Cheaper than Slerp +// and usually just as good. This is literally Lerp with Normalize() called on it. +// +// Unlike Slerp, constant velocity isn't maintained, but it's much faster and +// Nlerp(q1,q2) and Nlerp(q2,q1) return the same path. You should probably +// use this more often unless you're suffering from choppiness due to the +// non-constant velocity problem. +func QuatNlerp(q1, q2 Quat, amount float32) Quat { + return QuatLerp(q1, q2, amount).Normalize() +} + +// Performs a rotation in the specified order. If the order is not +// a valid RotationOrder, this function will panic +// +// The rotation "order" is more of an axis descriptor. For instance XZX would +// tell the function to interpret angle1 as a rotation about the X axis, angle2 about +// the Z axis, and angle3 about the X axis again. +// +// Based off the code for the Matlab function "angle2quat", though this implementation +// only supports 3 single angles as opposed to multiple angles. +func AnglesToQuat(angle1, angle2, angle3 float32, order RotationOrder) Quat { + var s [3]float64 + var c [3]float64 + + s[0], c[0] = math.Sincos(float64(angle1 / 2)) + s[1], c[1] = math.Sincos(float64(angle2 / 2)) + s[2], c[2] = math.Sincos(float64(angle3 / 2)) + + ret := Quat{} + switch order { + case ZYX: + ret.W = float32(c[0]*c[1]*c[2] + s[0]*s[1]*s[2]) + ret.V = Vec3{float32(c[0]*c[1]*s[2] - s[0]*s[1]*c[2]), + float32(c[0]*s[1]*c[2] + s[0]*c[1]*s[2]), + float32(s[0]*c[1]*c[2] - c[0]*s[1]*s[2]), + } + case ZYZ: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2]) + ret.V = Vec3{float32(c[0]*s[1]*s[2] - s[0]*s[1]*c[2]), + float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]), + float32(s[0]*c[1]*c[2] + c[0]*c[1]*s[2]), + } + case ZXY: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*s[1]*s[2]) + ret.V = Vec3{float32(c[0]*s[1]*c[2] - s[0]*c[1]*s[2]), + float32(c[0]*c[1]*s[2] + s[0]*s[1]*c[2]), + float32(c[0]*s[1]*s[2] + s[0]*c[1]*c[2]), + } + case ZXZ: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2]) + ret.V = Vec3{float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]), + float32(s[0]*s[1]*c[2] - c[0]*s[1]*s[2]), + float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]), + } + case YXZ: + ret.W = float32(c[0]*c[1]*c[2] + s[0]*s[1]*s[2]) + ret.V = Vec3{float32(c[0]*s[1]*c[2] + s[0]*c[1]*s[2]), + float32(s[0]*c[1]*c[2] - c[0]*s[1]*s[2]), + float32(c[0]*c[1]*s[2] - s[0]*s[1]*c[2]), + } + case YXY: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2]) + ret.V = Vec3{float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]), + float32(s[0]*c[1]*c[2] + c[0]*c[1]*s[2]), + float32(c[0]*s[1]*s[2] - s[0]*s[1]*c[2]), + } + case YZX: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*s[1]*s[2]) + ret.V = Vec3{float32(c[0]*c[1]*s[2] + s[0]*s[1]*c[2]), + float32(c[0]*s[1]*s[2] + s[0]*c[1]*c[2]), + float32(c[0]*s[1]*c[2] - s[0]*c[1]*s[2]), + } + case YZY: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2]) + ret.V = Vec3{float32(s[0]*s[1]*c[2] - c[0]*s[1]*s[2]), + float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]), + float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]), + } + case XYZ: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*s[1]*s[2]) + ret.V = Vec3{float32(c[0]*s[1]*s[2] + s[0]*c[1]*c[2]), + float32(c[0]*s[1]*c[2] - s[0]*c[1]*s[2]), + float32(c[0]*c[1]*s[2] + s[0]*s[1]*c[2]), + } + case XYX: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2]) + ret.V = Vec3{float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]), + float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]), + float32(s[0]*s[1]*c[2] - c[0]*s[1]*s[2]), + } + case XZY: + ret.W = float32(c[0]*c[1]*c[2] + s[0]*s[1]*s[2]) + ret.V = Vec3{float32(s[0]*c[1]*c[2] - c[0]*s[1]*s[2]), + float32(c[0]*c[1]*s[2] - s[0]*s[1]*c[2]), + float32(c[0]*s[1]*c[2] + s[0]*c[1]*s[2]), + } + case XZX: + ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2]) + ret.V = Vec3{float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]), + float32(c[0]*s[1]*s[2] - s[0]*s[1]*c[2]), + float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]), + } + default: + panic("Unsupported rotation order") + } + return ret +} + +// Mat4ToQuat converts a pure rotation matrix into a quaternion +func Mat4ToQuat(m Mat4) Quat { + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm + + if tr := m[0] + m[5] + m[10]; tr > 0 { + s := float32(0.5 / math.Sqrt(float64(tr+1.0))) + return Quat{ + 0.25 / s, + Vec3{ + (m[6] - m[9]) * s, + (m[8] - m[2]) * s, + (m[1] - m[4]) * s, + }, + } + } + + if (m[0] > m[5]) && (m[0] > m[10]) { + s := float32(2.0 * math.Sqrt(float64(1.0+m[0]-m[5]-m[10]))) + return Quat{ + (m[6] - m[9]) / s, + Vec3{ + 0.25 * s, + (m[4] + m[1]) / s, + (m[8] + m[2]) / s, + }, + } + } + + if m[5] > m[10] { + s := float32(2.0 * math.Sqrt(float64(1.0+m[5]-m[0]-m[10]))) + return Quat{ + (m[8] - m[2]) / s, + Vec3{ + (m[4] + m[1]) / s, + 0.25 * s, + (m[9] + m[6]) / s, + }, + } + + } + + s := float32(2.0 * math.Sqrt(float64(1.0+m[10]-m[0]-m[5]))) + return Quat{ + (m[1] - m[4]) / s, + Vec3{ + (m[8] + m[2]) / s, + (m[9] + m[6]) / s, + 0.25 * s, + }, + } +} + +// QuatLookAtV creates a rotation from an eye vector to a center vector +// +// It assumes the front of the rotated object at Z- and up at Y+ +func QuatLookAtV(eye, center, up Vec3) Quat { + // http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#I_need_an_equivalent_of_gluLookAt__How_do_I_orient_an_object_towards_a_point__ + // https://bitbucket.org/sinbad/ogre/src/d2ef494c4a2f5d6e2f0f17d3bfb9fd936d5423bb/OgreMain/src/OgreCamera.cpp?at=default#cl-161 + + direction := center.Sub(eye).Normalize() + + // Find the rotation between the front of the object (that we assume towards Z-, + // but this depends on your model) and the desired direction + rotDir := QuatBetweenVectors(Vec3{0, 0, -1}, direction) + + // Recompute up so that it's perpendicular to the direction + // You can skip that part if you really want to force up + //right := direction.Cross(up) + //up = right.Cross(direction) + + // Because of the 1rst rotation, the up is probably completely screwed up. + // Find the rotation between the "up" of the rotated object, and the desired up + upCur := rotDir.Rotate(Vec3{0, 1, 0}) + rotUp := QuatBetweenVectors(upCur, up) + + rotTarget := rotUp.Mul(rotDir) // remember, in reverse order. + return rotTarget.Inverse() // camera rotation should be inversed! +} + +// QuatBetweenVectors calculates the rotation between two vectors +func QuatBetweenVectors(start, dest Vec3) Quat { + // http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#I_need_an_equivalent_of_gluLookAt__How_do_I_orient_an_object_towards_a_point__ + // https://github.com/g-truc/glm/blob/0.9.5/glm/gtx/quaternion.inl#L225 + // https://bitbucket.org/sinbad/ogre/src/d2ef494c4a2f5d6e2f0f17d3bfb9fd936d5423bb/OgreMain/include/OgreVector3.h?at=default#cl-654 + + start = start.Normalize() + dest = dest.Normalize() + epsilon := float32(0.001) + + cosTheta := start.Dot(dest) + if cosTheta < -1.0+epsilon { + // special case when vectors in opposite directions: + // there is no "ideal" rotation axis + // So guess one; any will do as long as it's perpendicular to start + axis := Vec3{1, 0, 0}.Cross(start) + if axis.Dot(axis) < epsilon { + // bad luck, they were parallel, try again! + axis = Vec3{0, 1, 0}.Cross(start) + } + + return QuatRotate(math.Pi, axis.Normalize()) + } + + axis := start.Cross(dest) + s := float32(math.Sqrt(float64(1.0+cosTheta) * 2.0)) + + return Quat{ + s * 0.5, + axis.Mul(1.0 / s), + } +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/shapes.go b/vendor/github.com/go-gl/mathgl/mgl32/shapes.go new file mode 100644 index 0000000..5456872 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/shapes.go @@ -0,0 +1,306 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "fmt" + "math" +) + +// Generates a circle centered at (0,0) with a given radius. +// The radii are assumed to be in GL's coordinate sizing. +// +// Technically this draws an ellipse with two axes that match with the X and Y axes, the reason it has a radiusX and radiusY is because GL's coordinate system +// is proportional to screen width and screen height. So if you have a non-square viewport, a single radius will appear +// to "squash" the circle in one direction (usually the Y direction), so the X and Y radius allow for a circle to be made. +// A good way to get the correct radii is with mathgl.ScreenToGLCoords(radius, radius, screenWidth, screenHeight) which will get you the correct +// proportional GL coords. +// +// The numSlices argument specifies how many triangles you want your circle divided into, setting this +// number to too low a value may cause problem (and too high will cause it to take a lot of memory and time to compute +// without much gain in resolution). +// +// This uses discrete triangles, not a triangle fan +func Circle(radiusX, radiusY float32, numSlices int) []Vec2 { + twoPi := float32(2.0 * math.Pi) + + circlePoints := make([]Vec2, 0, numSlices*3) + center := Vec2{0.0, 0.0} + previous := Vec2{radiusX, 0.0} + + for theta := twoPi / float32(numSlices); !FloatEqual(theta, twoPi); theta = Clamp(theta+twoPi/float32(numSlices), 0.0, twoPi) { + sin, cos := math.Sincos(float64(theta)) + curr := Vec2{float32(cos) * radiusX, float32(sin) * radiusY} + + circlePoints = append(circlePoints, center, previous, curr) + previous = curr + } + + // Now add the final point at theta=2pi + circlePoints = append(circlePoints, center, previous, Vec2{radiusX, 0.0}) + return circlePoints +} + +// Generates a 2-triangle rectangle for use with GL_TRIANGLES. The width and height should use GL's proportions (that is, where a width of 1.0 +// is equivalent to half of the width of the render target); however, the y-coordinates grow downwards, not upwards. That is, it +// assumes you want the origin of the rectangle with the top-left corner at (0.0,0.0). +// +// Keep in mind that GL's coordinate system is proportional, so width=height will not result in a square unless your viewport is square. +// If you want to maintain proportionality regardless of screen size, use the results of w,h := ScreenToGLCoordsf(absoluteWidth, absoluteHeight, screenWidth, screenHeight); +// w,h=w+1,h-1 in the call to this function. (The w+1,h-1 step maps the coordinates to start at 0.0 rather than -1.0) +func Rect(width, height float32) []Vec2 { + return []Vec2{ + {0.0, 0.0}, + {0.0, -height}, + {width, -height}, + + {0.0, 0.0}, + {width, -height}, + {width, 0.0}, + } +} + +func QuadraticBezierCurve2D(t float32, cPoint1, cPoint2, cPoint3 Vec2) Vec2 { + if t < 0.0 || t > 1.0 { + panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]") + } + + return cPoint1.Mul((1.0 - t) * (1.0 - t)).Add(cPoint2.Mul(2 * (1 - t) * t)).Add(cPoint3.Mul(t * t)) +} + +func QuadraticBezierCurve3D(t float32, cPoint1, cPoint2, cPoint3 Vec3) Vec3 { + if t < 0.0 || t > 1.0 { + panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]") + } + + return cPoint1.Mul((1.0 - t) * (1.0 - t)).Add(cPoint2.Mul(2 * (1 - t) * t)).Add(cPoint3.Mul(t * t)) +} + +func CubicBezierCurve2D(t float32, cPoint1, cPoint2, cPoint3, cPoint4 Vec2) Vec2 { + if t < 0.0 || t > 1.0 { + panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]") + } + + return cPoint1.Mul((1 - t) * (1 - t) * (1 - t)).Add(cPoint2.Mul(3 * (1 - t) * (1 - t) * t)).Add(cPoint3.Mul(3 * (1 - t) * t * t)).Add(cPoint4.Mul(t * t * t)) +} + +func CubicBezierCurve3D(t float32, cPoint1, cPoint2, cPoint3, cPoint4 Vec3) Vec3 { + if t < 0.0 || t > 1.0 { + panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]") + } + + return cPoint1.Mul((1 - t) * (1 - t) * (1 - t)).Add(cPoint2.Mul(3 * (1 - t) * (1 - t) * t)).Add(cPoint3.Mul(3 * (1 - t) * t * t)).Add(cPoint4.Mul(t * t * t)) +} + +// Returns the point at point t along an n-control point Bezier curve +// +// t must be in the range 0.0 and 1.0 or this function will panic. Consider [0.0,1.0] to be similar to a percentage, +// 0.0 is first control point, and the point at 1.0 is the last control point. Any point in between is how far along the path you are between 0 and 1. +// +// This function is not sensitive to the coordinate system of the control points. It will correctly interpolate regardless of whether they're in screen coords, +// gl coords, or something else entirely +func BezierCurve2D(t float32, cPoints []Vec2) Vec2 { + if t < 0.0 || t > 1.0 { + panic("Input to bezier has t not in range [0,1]. If you think this is a precision error, use mathgl.Clamp[f|d] before calling this function") + } + + n := len(cPoints) - 1 + point := cPoints[0].Mul(float32(math.Pow(float64(1.0-t), float64(n)))) + + for i := 1; i <= n; i++ { + point = point.Add(cPoints[i].Mul(float32(float64(choose(n, i)) * math.Pow(float64(1-t), float64(n-i)) * math.Pow(float64(t), float64(i))))) // P += P_i * nCi * (1-t)^(n-i) * t^i + } + + return point +} + +// Same as the 2D version, except the line is in 3D space +func BezierCurve3D(t float32, cPoints []Vec3) Vec3 { + if t < 0.0 || t > 1.0 { + panic("Input to bezier has t not in range [0,1]. If you think this is a precision error, use mathgl.Clamp[f|d] before calling this function") + } + + n := len(cPoints) - 1 + point := cPoints[0].Mul(float32(math.Pow(float64(1.0-t), float64(n)))) + + for i := 1; i <= n; i++ { + point = point.Add(cPoints[i].Mul(float32(float64(choose(n, i)) * math.Pow(float64(1-t), float64(n-i)) * math.Pow(float64(t), float64(i))))) // P += P_i * nCi * (1-t)^(n-i) * t^i + } + + return point +} + +// Generates a bezier curve with controlPoints cPoints. The numPoints argument +// determines how many "samples" it makes along the line. For instance, a +// call to this with numPoints 2 will have exactly two points: the start and end points +// For any points above 2 it will divide it into numPoints-1 chunks (which means it will generate numPoints-2 vertices other than the beginning and end). +// So for 3 points it will divide it in half, 4 points into thirds, and so on. +// +// This is likely to get rather expensive for anything over perhaps a cubic curve. +func MakeBezierCurve2D(numPoints int, cPoints []Vec2) (line []Vec2) { + line = make([]Vec2, numPoints) + if numPoints == 0 { + return + } else if numPoints == 1 { + line[0] = cPoints[0] + return + } else if numPoints == 2 { + line[0] = cPoints[0] + line[1] = cPoints[len(cPoints)-1] + return + } + + line[0] = cPoints[0] + for i := 1; i < numPoints-1; i++ { + line[i] = BezierCurve2D(Clamp(float32(i)/float32(numPoints-1), 0.0, 1.0), cPoints) + } + line[numPoints-1] = cPoints[len(cPoints)-1] + + return +} + +// Same as the 2D version, except with the line in 3D space +func MakeBezierCurve3D(numPoints int, cPoints []Vec3) (line []Vec3) { + line = make([]Vec3, numPoints) + if numPoints == 0 { + return + } else if numPoints == 1 { + line[0] = cPoints[0] + return + } else if numPoints == 2 { + line[0] = cPoints[0] + line[1] = cPoints[len(cPoints)-1] + return + } + + line[0] = cPoints[0] + for i := 1; i < numPoints-1; i++ { + line[i] = BezierCurve3D(Clamp(float32(i)/float32(numPoints-1), 0.0, 1.0), cPoints) + } + line[numPoints-1] = cPoints[len(cPoints)-1] + + return +} + +// Creates a 2-dimensional Bezier surface of arbitrary degree in 3D Space +// Like the curve functions, if u or v are not in the range [0.0,1.0] the function will panic, use Clamp[f|d] +// to ensure it is correct. +// +// The control point matrix must not be jagged, or this will end up panicking from an index out of bounds exception +func BezierSurface(u, v float32, cPoints [][]Vec3) Vec3 { + if u < 0.0 || u > 1.0 || v < 1.0 || v > 1.0 { + panic("u or v not in range [0.0,1.0] in BezierSurface") + } + + n := len(cPoints) - 1 + m := len(cPoints[0]) - 1 + + point := cPoints[0][0].Mul(float32(math.Pow(float64(1.0-u), float64(n)) * math.Pow(float64(1.0-v), float64(m)))) + + for i := 0; i <= n; i++ { + for j := 0; j <= m; j++ { + if i == 0 && j == 0 { + continue + } + + point = point.Add(cPoints[i][j].Mul(float32(float64(choose(n, i)) * math.Pow(float64(u), float64(i)) * math.Pow(float64(1.0-u), float64(n-i)) * float64(choose(m, j)) * math.Pow(float64(v), float64(j)) * math.Pow(float64(1.0-v), float64(m-j))))) + } + } + + return point +} + +// Does interpolation over a spline of several bezier curves. Each bezier curve must have a finite range, +// though the spline may be disjoint. The bezier curves are not required to be in any particular order. +// +// If t is out of the range of all given curves, this function will panic +func BezierSplineInterpolate2D(t float32, ranges [][2]float32, cPoints [][]Vec2) Vec2 { + if len(ranges) != len(cPoints) { + panic("Each bezier curve needs a range") + } + + for i, curveRange := range ranges { + if t >= curveRange[0] && t <= curveRange[1] { + return BezierCurve2D((t-curveRange[0])/(curveRange[1]-curveRange[0]), cPoints[i]) + } + } + + panic("t is out of the range of all bezier curves in this spline") +} + +// Does interpolation over a spline of several bezier curves. Each bezier curve must have a finite range, +// though the spline may be disjoint. The bezier curves are not required to be in any particular order. +// +// If t is out of the range of all given curves, this function will panic +func BezierSplineInterpolate3D(t float32, ranges [][2]float32, cPoints [][]Vec3) Vec3 { + if len(ranges) != len(cPoints) { + panic("Each bezier curve needs a range") + } + + for i, curveRange := range ranges { + if t >= curveRange[0] && t <= curveRange[1] { + return BezierCurve3D((t-curveRange[0])/(curveRange[1]-curveRange[0]), cPoints[i]) + } + } + + panic("t is out of the range of all bezier curves in this spline") +} + +// Reticulates ALL the Splines +// +// For the overly serious: the function is just for fun. It does nothing except prints a Maxis reference. Technically you could "reticulate splines" +// by joining a bunch of splines together, but that ruins the joke. +func ReticulateSplines(ranges [][][2]float32, cPoints [][][]Vec2, withLlamas bool) { + if !withLlamas { + fmt.Println("You can't reticulate splines without llamas, silly.") + } else { + fmt.Println("Actually, you can't even reticulate splines WITH llamas") + } +} + +// Transform from pixel coordinates to GL coordinates. +// +// This assumes that your pixel coordinate system considers its origin to be in the top left corner (GL's is in the bottom left). +// The coordinates x and y may be out of the range [0,screenWidth-1] and [0,screeneHeight-1]. +// +// GL's coordinate system maps [screenWidth-1,0] to [1.0,1.0] and [0,screenHeight-1] to [-1.0,-1.0]. If x and y are out of the range, they'll still +// be mapped correctly, just off the screen. (e.g. if y = 2*(screenHeight-1) you'll get -3.0 for yOut) +// +// This is similar to Unproject, except for 2D cases and much simpler (especially since an inverse may always be found) +func ScreenToGLCoords(x, y int, screenWidth, screenHeight int) (xOut, yOut float32) { + xOut = 2.0*float32(x)/float32(screenWidth-1) - 1.0 + yOut = -2.0*float32(y)/float32(screenHeight-1) + 1.0 + + return +} + +// Transform from GL's proportional system to pixel coordinates. +// +// Assumes the pixel coordinate system has its origin in the top left corner. (GL's is in the bottom left) +// +// GL's coordinate system maps [screenWidth-1,0] to [1.0,1.0] and [0,screenHeight-1] to [-1.0,-1.0]. If x and y are out of the range, they'll still +// be mapped correctly, just off the screen. (e.g. if y=-3.0, you'll get 2*(screenHeight-1) for yOut) +// +// This is similar to Project, except for 2D cases and much simpler +func GLToScreenCoords(x, y float32, screenWidth, screenHeight int) (xOut, yOut int) { + xOut = int((x + 1.0) * float32(screenWidth-1) / 2.0) + yOut = int((1.0 - y) * float32(screenHeight-1) / 2.0) + + return +} + +func choose(n, k int) (result int) { + if k == 0 { + return 1 + } else if n == 0 { + return 0 + } + result = (n - (k - 1)) + for i := 2; i <= k; i++ { + result *= (n - (k - i)) / i + } + + return result +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/transform.go b/vendor/github.com/go-gl/mathgl/mgl32/transform.go new file mode 100644 index 0000000..b11fa07 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/transform.go @@ -0,0 +1,223 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import "math" + +// Rotate2D returns a rotation Matrix about a angle in 2-D space. Specifically about the origin. +// It is a 2x2 matrix, if you need a 3x3 for Homogeneous math (e.g. composition with a Translation matrix) +// see HomogRotate2D +func Rotate2D(angle float32) Mat2 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + return Mat2{cos, sin, -sin, cos} +} + +// Rotate3DX returns a 3x3 (non-homogeneous) Matrix that rotates by angle about the X-axis +// +// Where c is cos(angle) and s is sin(angle) +// [1 0 0] +// [0 c -s] +// [0 s c ] +func Rotate3DX(angle float32) Mat3 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + + return Mat3{1, 0, 0, 0, cos, sin, 0, -sin, cos} +} + +// Rotate3DY returns a 3x3 (non-homogeneous) Matrix that rotates by angle about the Y-axis +// +// Where c is cos(angle) and s is sin(angle) +// [c 0 s] +// [0 1 0] +// [s 0 c ] +func Rotate3DY(angle float32) Mat3 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + + return Mat3{cos, 0, -sin, 0, 1, 0, sin, 0, cos} +} + +// Rotate3DZ returns a 3x3 (non-homogeneous) Matrix that rotates by angle about the Z-axis +// +// Where c is cos(angle) and s is sin(angle) +// [c -s 0] +// [s c 0] +// [0 0 1 ] +func Rotate3DZ(angle float32) Mat3 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + + return Mat3{cos, sin, 0, -sin, cos, 0, 0, 0, 1} +} + +// Translate2D returns a homogeneous (3x3 for 2D-space) Translation matrix that moves a point by Tx units in the x-direction and Ty units in the y-direction +// +// [[1, 0, Tx]] +// [[0, 1, Ty]] +// [[0, 0, 1 ]] +func Translate2D(Tx, Ty float32) Mat3 { + return Mat3{1, 0, 0, 0, 1, 0, float32(Tx), float32(Ty), 1} +} + +// Translate3D returns a homogeneous (4x4 for 3D-space) Translation matrix that moves a point by Tx units in the x-direction, Ty units in the y-direction, +// and Tz units in the z-direction +// +// [[1, 0, 0, Tx]] +// [[0, 1, 0, Ty]] +// [[0, 0, 1, Tz]] +// [[0, 0, 0, 1 ]] +func Translate3D(Tx, Ty, Tz float32) Mat4 { + return Mat4{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, float32(Tx), float32(Ty), float32(Tz), 1} +} + +// Same as Rotate2D, except homogeneous (3x3 with the extra row/col being all zeroes with a one in the bottom right) +func HomogRotate2D(angle float32) Mat3 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + return Mat3{cos, sin, 0, -sin, cos, 0, 0, 0, 1} +} + +// Same as Rotate3DX, except homogeneous (4x4 with the extra row/col being all zeroes with a one in the bottom right) +func HomogRotate3DX(angle float32) Mat4 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + + return Mat4{1, 0, 0, 0, 0, cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1} +} + +// Same as Rotate3DY, except homogeneous (4x4 with the extra row/col being all zeroes with a one in the bottom right) +func HomogRotate3DY(angle float32) Mat4 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + return Mat4{cos, 0, -sin, 0, 0, 1, 0, 0, sin, 0, cos, 0, 0, 0, 0, 1} +} + +// Same as Rotate3DZ, except homogeneous (4x4 with the extra row/col being all zeroes with a one in the bottom right) +func HomogRotate3DZ(angle float32) Mat4 { + //angle = (angle * math.Pi) / 180.0 + sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + return Mat4{cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1} +} + +// Scale3D creates a homogeneous 3D scaling matrix +// [[ scaleX, 0 , 0 , 0 ]] +// [[ 0 , scaleY, 0 , 0 ]] +// [[ 0 , 0 , scaleZ, 0 ]] +// [[ 0 , 0 , 0 , 1 ]] +func Scale3D(scaleX, scaleY, scaleZ float32) Mat4 { + + return Mat4{float32(scaleX), 0, 0, 0, 0, float32(scaleY), 0, 0, 0, 0, float32(scaleZ), 0, 0, 0, 0, 1} +} + +// Scale2D creates a homogeneous 2D scaling matrix +// [[ scaleX, 0 , 0 ]] +// [[ 0 , scaleY, 0 ]] +// [[ 0 , 0 , 1 ]] +func Scale2D(scaleX, scaleY float32) Mat3 { + return Mat3{float32(scaleX), 0, 0, 0, float32(scaleY), 0, 0, 0, 1} +} + +// ShearX2D creates a homogeneous 2D shear matrix along the X-axis +func ShearX2D(shear float32) Mat3 { + return Mat3{1, 0, 0, float32(shear), 1, 0, 0, 0, 1} +} + +// ShearY2D creates a homogeneous 2D shear matrix along the Y-axis +func ShearY2D(shear float32) Mat3 { + return Mat3{1, float32(shear), 0, 0, 1, 0, 0, 0, 1} +} + +// ShearX3D creates a homogeneous 3D shear matrix along the X-axis +func ShearX3D(shearY, shearZ float32) Mat4 { + + return Mat4{1, float32(shearY), float32(shearZ), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1} +} + +// ShearY3D creates a homogeneous 3D shear matrix along the Y-axis +func ShearY3D(shearX, shearZ float32) Mat4 { + return Mat4{1, 0, 0, 0, float32(shearX), 1, float32(shearZ), 0, 0, 0, 1, 0, 0, 0, 0, 1} +} + +// ShearZ3D creates a homogeneous 3D shear matrix along the Z-axis +func ShearZ3D(shearX, shearY float32) Mat4 { + return Mat4{1, 0, 0, 0, 0, 1, 0, 0, float32(shearX), float32(shearY), 1, 0, 0, 0, 0, 1} +} + +// HomogRotate3D creates a 3D rotation Matrix that rotates by (radian) angle about some arbitrary axis given by a Vector. +// It produces a homogeneous matrix (4x4) +// +// Where c is cos(angle) and s is sin(angle), and x, y, and z are the first, second, and third elements of the axis vector (respectively): +// +// [[ x^2(1-c)+c, xy(1-c)-zs, xz(1-c)+ys, 0 ]] +// [[ xy(1-c)+zs, y^2(1-c)+c, yz(1-c)-xs, 0 ]] +// [[ xz(1-c)-ys, yz(1-c)+xs, z^2(1-c)+c, 0 ]] +// [[ 0 , 0 , 0 , 1 ]] +func HomogRotate3D(angle float32, axis Vec3) Mat4 { + x, y, z := axis[0], axis[1], axis[2] + s, c := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle))) + k := 1 - c + + return Mat4{x*x*k + c, x*y*k + z*s, x*z*k - y*s, 0, x*y*k - z*s, y*y*k + c, y*z*k + x*s, 0, x*z*k + y*s, y*z*k - x*s, z*z*k + c, 0, 0, 0, 0, 1} +} + +// Extracts the 3d scaling from a homogeneous matrix +func Extract3DScale(m Mat4) (x, y, z float32) { + return float32(math.Sqrt(float64(m[0]*m[0] + m[1]*m[1] + m[2]*m[2]))), + float32(math.Sqrt(float64(m[4]*m[4] + m[5]*m[5] + m[6]*m[6]))), + float32(math.Sqrt(float64(m[8]*m[8] + m[9]*m[9] + m[10]*m[10]))) +} + +// Extracts the maximum scaling from a homogeneous matrix +func ExtractMaxScale(m Mat4) float32 { + scaleX := float64(m[0]*m[0] + m[1]*m[1] + m[2]*m[2]) + scaleY := float64(m[4]*m[4] + m[5]*m[5] + m[6]*m[6]) + scaleZ := float64(m[8]*m[8] + m[9]*m[9] + m[10]*m[10]) + + return float32(math.Sqrt(math.Max(scaleX, math.Max(scaleY, scaleZ)))) +} + +// Calculates the Normal of the Matrix (aka the inverse transpose) +func Mat4Normal(m Mat4) Mat3 { + n := m.Inv().Transpose() + return Mat3{n[0], n[1], n[2], n[4], n[5], n[6], n[8], n[9], n[10]} +} + +// Multiplies a 3D vector by a transformation given by +// the homogeneous 4D matrix m, applying any translation. +// If this transformation is non-affine, it will project this +// vector onto the plane w=1 before returning the result. +// +// This is similar to saying you're transforming and projecting a point. +// +// This is effectively equivalent to the GLSL code +// vec4 r = (m * vec4(v,1.)); +// r = r/r.w; +// vec3 newV = r.xyz; +func TransformCoordinate(v Vec3, m Mat4) Vec3 { + t := v.Vec4(1) + t = m.Mul4x1(t) + t = t.Mul(1 / t[3]) + + return t.Vec3() +} + +// Multiplies a 3D vector by a transformation given by +// the homogeneous 4D matrix m, NOT applying any translations. +// +// This is similar to saying you're applying a transformation +// to a direction or normal. Rotation still applies (as does scaling), +// but translating a direction or normal is meaningless. +// +// This is effectively equivalent to the GLSL code +// vec4 r = (m * vec4(v,0.)); +// vec3 newV = r.xyz +func TransformNormal(v Vec3, m Mat4) Vec3 { + t := v.Vec4(0) + t = m.Mul4x1(t) + + return t.Vec3() +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/util.go b/vendor/github.com/go-gl/mathgl/mgl32/util.go new file mode 100644 index 0000000..9757a05 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/util.go @@ -0,0 +1,142 @@ +// Copyright 2014 The go-gl Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run codegen.go -template vector.tmpl -output vector.go +//go:generate go run codegen.go -template matrix.tmpl -output matrix.go +//go:generate go run codegen.go -mgl64 + +package mgl32 + +import ( + "math" +) + +// Epsilon is some tiny value that determines how precisely equal we want our floats to be +// This is exported and left as a variable in case you want to change the default threshold for the +// purposes of certain methods (e.g. Unproject uses the default epsilon when determining +// if the determinant is "close enough" to zero to mean there's no inverse). +// +// This is, obviously, not mutex protected so be **absolutely sure** that no functions using Epsilon +// are being executed when you change this. +var Epsilon float32 = 1e-10 + +// A direct copy of the math package's Abs. This is here for the mgl32 +// package, to prevent rampant type conversions during equality tests. +func Abs(a float32) float32 { + if a < 0 { + return -a + } else if a == 0 { + return 0 + } + + return a +} + +// FloatEqual is a safe utility function to compare floats. +// It's Taken from http://floating-point-gui.de/errors/comparison/ +// +// It is slightly altered to not call Abs when not needed. +func FloatEqual(a, b float32) bool { + return FloatEqualThreshold(a, b, Epsilon) +} + +// FloatEqualFunc is a utility closure that will generate a function that +// always approximately compares floats like FloatEqualThreshold with a different +// threshold. +func FloatEqualFunc(epsilon float32) func(float32, float32) bool { + return func(a, b float32) bool { + return FloatEqualThreshold(a, b, epsilon) + } +} + +var ( + MinNormal = float32(1.1754943508222875e-38) // 1 / 2**(127 - 1) + MinValue = float32(math.SmallestNonzeroFloat32) + MaxValue = float32(math.MaxFloat32) + + InfPos = float32(math.Inf(1)) + InfNeg = float32(math.Inf(-1)) + NaN = float32(math.NaN()) +) + +// FloatEqualThreshold is a utility function to compare floats. +// It's Taken from http://floating-point-gui.de/errors/comparison/ +// +// It is slightly altered to not call Abs when not needed. +// +// This differs from FloatEqual in that it lets you pass in your comparison threshold, so that you can adjust the comparison value to your specific needs +func FloatEqualThreshold(a, b, epsilon float32) bool { + if a == b { // Handles the case of inf or shortcuts the loop when no significant error has accumulated + return true + } + + diff := Abs(a - b) + if a*b == 0 || diff < MinNormal { // If a or b are 0 or both are extremely close to it + return diff < epsilon*epsilon + } + + // Else compare difference + return diff/(Abs(a)+Abs(b)) < epsilon +} + +// Clamp takes in a value and two thresholds. If the value is smaller than the low +// threshold, it returns the low threshold. If it's bigger than the high threshold +// it returns the high threshold. Otherwise it returns the value. +// +// Useful to prevent some functions from freaking out because a value was +// teeeeechnically out of range. +func Clamp(a, low, high float32) float32 { + if a < low { + return low + } else if a > high { + return high + } + + return a +} + +// ClampFunc generates a closure that returns its parameter +// clamped to the range [low,high]. +func ClampFunc(low, high float32) func(float32) float32 { + return func(a float32) float32 { + return Clamp(a, low, high) + } +} + +/* The IsClamped functions use strict equality (meaning: not the FloatEqual function) +there shouldn't be any major issues with this since clamp is often used to fix minor errors*/ + +// Checks if a is clamped between low and high as if +// Clamp(a, low, high) had been called. +// +// In most cases it's probably better to just call Clamp +// without checking this since it's relatively cheap. +func IsClamped(a, low, high float32) bool { + return a >= low && a <= high +} + +// If a > b, then a will be set to the value of b. +func SetMin(a, b *float32) { + if *b < *a { + *a = *b + } +} + +// If a < b, then a will be set to the value of b. +func SetMax(a, b *float32) { + if *a < *b { + *a = *b + } +} + +// Round shortens a float32 value to a specified precision (number of digits after the decimal point) +// with "round half up" tie-braking rule. Half-way values (23.5) are always rounded up (24). +func Round(v float32, precision int) float32 { + p := float64(precision) + t := float64(v) * math.Pow(10, p) + if t > 0 { + return float32(math.Floor(t+0.5) / math.Pow(10, p)) + } + return float32(math.Ceil(t-0.5) / math.Pow(10, p)) +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/vecn.go b/vendor/github.com/go-gl/mathgl/mgl32/vecn.go new file mode 100644 index 0000000..a09be05 --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/vecn.go @@ -0,0 +1,350 @@ +// Copyright 2014 The go-gl 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 mgl32 + +import ( + "math" +) + +// A vector of N elements backed by a slice +// +// As with MatMxN, this is not for hardcore linear algebra with large dimensions. Use github.com/gonum/matrix +// or something like BLAS/LAPACK for that. This is for corner cases in 3D math where you require +// something a little bigger that 4D, but still relatively small. +// +// This VecN uses several sync.Pool objects as a memory pool. The rule is that for any sized vector, the backing slice +// has CAPACITY (not length) of 2^p where p is Ceil(log_2(N)) -- or in other words, rounding up the base-2 +// log of the size of the vector. E.G. a VecN of size 17 will have a backing slice of Cap 32. +type VecN struct { + vec []float32 +} + +// Creates a new vector with a backing slice filled with the contents +// of initial. It is NOT backed by initial, but rather a slice with cap +// 2^p where p is Ceil(log_2(len(initial))), with the data from initial copied into +// it. +func NewVecNFromData(initial []float32) *VecN { + if initial == nil { + return &VecN{} + } + var internal []float32 + if shouldPool { + internal = grabFromPool(len(initial)) + } else { + internal = make([]float32, len(initial)) + } + copy(internal, initial) + return &VecN{vec: internal} +} + +// Creates a new vector with a backing slice of +// 2^p where p = Ceil(log_2(n)) +func NewVecN(n int) *VecN { + if shouldPool { + return &VecN{vec: grabFromPool(n)} + } else { + return &VecN{vec: make([]float32, n)} + } +} + +// Returns the raw slice backing the VecN +// +// This may be sent back to the memory pool at any time +// and you aren't advised to rely on this value +func (vn VecN) Raw() []float32 { + return vn.vec +} + +// Gets the element at index i from the vector. +// This does not bounds check, and will panic if i is +// out of range. +func (vn VecN) Get(i int) float32 { + return vn.vec[i] +} + +func (vn *VecN) Set(i int, val float32) { + vn.vec[i] = val +} + +// Sends the allocated memory through the callback if it exists +func (vn *VecN) destroy() { + if vn == nil || vn.vec == nil { + return + } + + if shouldPool { + returnToPool(vn.vec) + } + vn.vec = nil +} + +// Resizes the underlying slice to the desired amount, reallocating or retrieving from the pool +// if necessary. The values after a Resize cannot be expected to be related to the values before a Resize. +// +// If the caller is a nil pointer, this returns a value as if NewVecN(n) had been called, +// otherwise it simply returns the caller. +func (vn *VecN) Resize(n int) *VecN { + if vn == nil { + return NewVecN(n) + } + + if n <= cap(vn.vec) { + if vn.vec != nil { + vn.vec = vn.vec[:n] + } else { + vn.vec = []float32{} + } + return vn + } + + if shouldPool && vn.vec != nil { + returnToPool(vn.vec) + } + *vn = (*NewVecN(n)) + + return vn +} + +// Sets the vector's backing slice to the given +// new one. +func (vn *VecN) SetBackingSlice(newSlice []float32) { + vn.vec = newSlice +} + +// Return the len of the vector's underlying slice. +// This is not titled Len because it conflicts the package's +// convention of calling the Norm the Len. +func (vn *VecN) Size() int { + return len(vn.vec) +} + +// Returns the cap of the vector's underlying slice. +func (vn *VecN) Cap() int { + return cap(vn.vec) +} + +// Sets the vector's size to n and zeroes out the vector. +// If n is bigger than the vector's size, it will realloc. +func (vn *VecN) Zero(n int) { + vn.Resize(n) + for i := range vn.vec { + vn.vec[i] = 0 + } +} + +// Adds vn and addend, storing the result in dst. +// If dst does not have sufficient size it will be resized +// Dst may be one of the other arguments. If dst is nil, it will be allocated. +// The value returned is dst, for easier method chaining +// +// If vn and addend are not the same size, this function will add min(vn.Size(), addend.Size()) +// elements. +func (vn *VecN) Add(dst *VecN, subtrahend *VecN) *VecN { + if vn == nil || subtrahend == nil { + return nil + } + size := intMin(len(vn.vec), len(subtrahend.vec)) + dst = dst.Resize(size) + + for i := 0; i < size; i++ { + dst.vec[i] = vn.vec[i] + subtrahend.vec[i] + } + + return dst +} + +// Subtracts addend from vn, storing the result in dst. +// If dst does not have sufficient size it will be resized +// Dst may be one of the other arguments. If dst is nil, it will be allocated. +// The value returned is dst, for easier method chaining +// +// If vn and addend are not the same size, this function will add min(vn.Size(), addend.Size()) +// elements. +func (vn *VecN) Sub(dst *VecN, addend *VecN) *VecN { + if vn == nil || addend == nil { + return nil + } + size := intMin(len(vn.vec), len(addend.vec)) + dst = dst.Resize(size) + + for i := 0; i < size; i++ { + dst.vec[i] = vn.vec[i] - addend.vec[i] + } + + return dst +} + +// Takes the binary cross product of vn and other, and stores it in dst. +// If either vn or other are not of size 3 this function will panic +// +// If dst is not of sufficient size, or is nil, a new slice is allocated. +// Dst is permitted to be one of the other arguments +func (vn *VecN) Cross(dst *VecN, other *VecN) *VecN { + if vn == nil || other == nil { + return nil + } + if len(vn.vec) != 3 || len(other.vec) != 3 { + panic("Cannot take binary cross product of non-3D elements (7D cross product not implemented)") + } + + dst = dst.Resize(3) + dst.vec[0], dst.vec[1], dst.vec[2] = vn.vec[1]*other.vec[2]-vn.vec[2]*other.vec[1], vn.vec[2]*other.vec[0]-vn.vec[0]*other.vec[2], vn.vec[0]*other.vec[1]-vn.vec[1]*other.vec[0] + + return dst +} + +func intMin(a, b int) int { + if a < b { + return a + } + + return b +} + +// Computes the dot product of two VecNs, if +// the two vectors are not of the same length -- this +// will return NaN. +func (vn *VecN) Dot(other *VecN) float32 { + if vn == nil || other == nil || len(vn.vec) != len(other.vec) { + return float32(math.NaN()) + } + + var result float32 = 0.0 + for i, el := range vn.vec { + result += el * other.vec[i] + } + + return result +} + +// Computes the vector length (also called the Norm) of the +// vector. Equivalent to math.Sqrt(vn.Dot(vn)) with the appropriate +// type conversions. +// +// If vn is nil, this returns NaN +func (vn *VecN) Len() float32 { + if vn == nil { + return float32(math.NaN()) + } + if len(vn.vec) == 0 { + return 0 + } + + return float32(math.Sqrt(float64(vn.Dot(vn)))) +} + +// Normalizes the vector and stores the result in dst, which +// will be returned. Dst will be appropraitely resized to the +// size of vn. +// +// The destination can be vn itself and nothing will go wrong. +// +// This is equivalent to vn.Mul(dst, 1/vn.Len()) +func (vn *VecN) Normalize(dst *VecN) *VecN { + if vn == nil { + return nil + } + + return vn.Mul(dst, 1/vn.Len()) +} + +// Multiplied the vector by some scalar value and stores the result in dst, which +// will be returned. Dst will be appropraitely resized to the +// size of vn. +// +// The destination can be vn itself and nothing will go wrong. +func (vn *VecN) Mul(dst *VecN, c float32) *VecN { + if vn == nil { + return nil + } + dst = dst.Resize(len(vn.vec)) + + for i, el := range vn.vec { + dst.vec[i] = el * c + } + + return dst +} + +// Performs the vector outer product between vn and v2. +// The outer product is like a "reverse" dot product. Where the dot product +// aligns both vectors with the "sized" part facing "inward" (Vec3*Vec3=Mat1x3*Mat3x1=Mat1x1=Scalar). +// The outer product multiplied them with it facing "outward" +// (Vec3*Vec3=Mat3x1*Mat1x3=Mat3x3). +// +// The matrix dst will be Reshaped to the correct size, if vn or v2 are nil, +// this returns nil. +func (vn *VecN) OuterProd(dst *MatMxN, v2 *VecN) *MatMxN { + if vn == nil || v2 == nil { + return nil + } + + dst = dst.Reshape(len(vn.vec), len(v2.vec)) + + for c, el1 := range v2.vec { + for r, el2 := range vn.vec { + dst.Set(r, c, el1*el2) + } + } + + return dst +} + +func (vn *VecN) ApproxEqual(vn2 *VecN) bool { + if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) { + return false + } + + for i, el := range vn.vec { + if !FloatEqual(el, vn2.vec[i]) { + return false + } + } + + return true +} + +func (vn *VecN) ApproxEqualThreshold(vn2 *VecN, epsilon float32) bool { + if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) { + return false + } + + for i, el := range vn.vec { + if !FloatEqualThreshold(el, vn2.vec[i], epsilon) { + return false + } + } + + return true +} + +func (vn *VecN) ApproxEqualFunc(vn2 *VecN, comp func(float32, float32) bool) bool { + if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) { + return false + } + + for i, el := range vn.vec { + if !comp(el, vn2.vec[i]) { + return false + } + } + + return true +} + +func (vn *VecN) Vec2() Vec2 { + raw := vn.Raw() + return Vec2{raw[0], raw[1]} +} + +func (vn *VecN) Vec3() Vec3 { + raw := vn.Raw() + return Vec3{raw[0], raw[1], raw[2]} +} + +func (vn *VecN) Vec4() Vec4 { + raw := vn.Raw() + return Vec4{raw[0], raw[1], raw[2], raw[3]} +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/vector.go b/vendor/github.com/go-gl/mathgl/mgl32/vector.go new file mode 100644 index 0000000..aacfb3e --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/vector.go @@ -0,0 +1,562 @@ +// Copyright 2014 The go-gl/mathgl Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is generated by codegen.go; DO NOT EDIT +// Edit vector.tmpl and run "go generate" to make changes. + +package mgl32 + +import ( + "golang.org/x/image/math/f32" + "math" +) + +type Vec2 f32.Vec2 +type Vec3 f32.Vec3 +type Vec4 f32.Vec4 + +func (v Vec2) Vec3(z float32) Vec3 { + return Vec3{v[0], v[1], z} +} + +func (v Vec2) Vec4(z, w float32) Vec4 { + return Vec4{v[0], v[1], z, w} +} + +func (v Vec3) Vec2() Vec2 { + return Vec2{v[0], v[1]} +} + +func (v Vec3) Vec4(w float32) Vec4 { + return Vec4{v[0], v[1], v[2], w} +} + +func (v Vec4) Vec2() Vec2 { + return Vec2{v[0], v[1]} +} + +func (v Vec4) Vec3() Vec3 { + return Vec3{v[0], v[1], v[2]} +} + +// Elem extracts the elements of the vector for direct value assignment. +func (v Vec2) Elem() (x, y float32) { + return v[0], v[1] +} + +// Elem extracts the elements of the vector for direct value assignment. +func (v Vec3) Elem() (x, y, z float32) { + return v[0], v[1], v[2] +} + +// Elem extracts the elements of the vector for direct value assignment. +func (v Vec4) Elem() (x, y, z, w float32) { + return v[0], v[1], v[2], v[3] +} + +// The vector cross product is an operation only defined on 3D vectors. It is equivalent to +// Vec3{v1[1]*v2[2]-v1[2]*v2[1], v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]}. +// Another interpretation is that it's the vector whose magnitude is |v1||v2|sin(theta) +// where theta is the angle between v1 and v2. +// +// The cross product is most often used for finding surface normals. The cross product of vectors +// will generate a vector that is perpendicular to the plane they form. +// +// Technically, a generalized cross product exists as an "(N-1)ary" operation +// (that is, the 4D cross product requires 3 4D vectors). But the binary +// 3D (and 7D) cross product is the most important. It can be considered +// the area of a parallelogram with sides v1 and v2. +// +// Like the dot product, the cross product is roughly a measure of directionality. +// Two normalized perpendicular vectors will return a vector with a magnitude of +// 1.0 or -1.0 and two parallel vectors will return a vector with magnitude 0.0. +// The cross product is "anticommutative" meaning v1.Cross(v2) = -v2.Cross(v1), +// this property can be useful to know when finding normals, +// as taking the wrong cross product can lead to the opposite normal of the one you want. +func (v1 Vec3) Cross(v2 Vec3) Vec3 { + return Vec3{v1[1]*v2[2] - v1[2]*v2[1], v1[2]*v2[0] - v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]} +} + +// Add performs element-wise addition between two vectors. It is equivalent to iterating +// over every element of v1 and adding the corresponding element of v2 to it. +func (v1 Vec2) Add(v2 Vec2) Vec2 { + return Vec2{v1[0] + v2[0], v1[1] + v2[1]} +} + +// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating +// over every element of v1 and subtracting the corresponding element of v2 from it. +func (v1 Vec2) Sub(v2 Vec2) Vec2 { + return Vec2{v1[0] - v2[0], v1[1] - v2[1]} +} + +// Mul performs a scalar multiplication between the vector and some constant value +// c. This is equivalent to iterating over every vector element and multiplying by c. +func (v1 Vec2) Mul(c float32) Vec2 { + return Vec2{v1[0] * c, v1[1] * c} +} + +// Dot returns the dot product of this vector with another. There are multiple ways +// to describe this value. One is the multiplication of their lengths and cos(theta) where +// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta). +// +// The other (and what is actually done) is the sum of the element-wise multiplication of all +// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z. +// +// This means that the dot product of a vector and itself is the square of its Len (within +// the bounds of floating points error). +// +// The dot product is roughly a measure of how closely two vectors are to pointing in the same +// direction. If both vectors are normalized, the value will be -1 for opposite pointing, +// one for same pointing, and 0 for perpendicular vectors. +func (v1 Vec2) Dot(v2 Vec2) float32 { + return v1[0]*v2[0] + v1[1]*v2[1] +} + +// Len returns the vector's length. Note that this is NOT the dimension of +// the vector (len(v)), but the mathematical length. This is equivalent to the square +// root of the sum of the squares of all elements. E.G. for a Vec2 it's +// math.Hypot(v[0], v[1]). +func (v1 Vec2) Len() float32 { + + return float32(math.Hypot(float64(v1[0]), float64(v1[1]))) + +} + +// Normalize normalizes the vector. Normalization is (1/|v|)*v, +// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0, +// this function will return an infinite value for all elements due +// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))). +// +// Normalization makes a vector's Len become 1.0 (within the margin of floating point error), +// while maintaining its directionality. +// +// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp ) +func (v1 Vec2) Normalize() Vec2 { + l := 1.0 / v1.Len() + return Vec2{v1[0] * l, v1[1] * l} +} + +// ApproxEqual takes in a vector and does an element-wise +// approximate float comparison as if FloatEqual had been used +func (v1 Vec2) ApproxEqual(v2 Vec2) bool { + for i := range v1 { + if !FloatEqual(v1[i], v2[i]) { + return false + } + } + return true +} + +// ApproxThresholdEq takes in a threshold for comparing two floats, and uses it to do an +// element-wise comparison of the vector to another. +func (v1 Vec2) ApproxEqualThreshold(v2 Vec2, threshold float32) bool { + for i := range v1 { + if !FloatEqualThreshold(v1[i], v2[i], threshold) { + return false + } + } + return true +} + +// ApproxFuncEq takes in a func that compares two floats, and uses it to do an element-wise +// comparison of the vector to another. This is intended to be used with FloatEqualFunc +func (v1 Vec2) ApproxFuncEqual(v2 Vec2, eq func(float32, float32) bool) bool { + for i := range v1 { + if !eq(v1[i], v2[i]) { + return false + } + } + return true +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec2) X() float32 { + return v[0] +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec2) Y() float32 { + return v[1] +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 2x2 matrix. E.G. a Vec2 * Vec2 = Mat2. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec2) OuterProd2(v2 Vec2) Mat2 { + return Mat2{v1[0] * v2[0], v1[1] * v2[0], v1[0] * v2[1], v1[1] * v2[1]} +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 2x3 matrix. E.G. a Vec2 * Vec3 = Mat2x3. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec2) OuterProd3(v2 Vec3) Mat2x3 { + return Mat2x3{v1[0] * v2[0], v1[1] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[0] * v2[2], v1[1] * v2[2]} +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 2x4 matrix. E.G. a Vec2 * Vec4 = Mat2x4. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec2) OuterProd4(v2 Vec4) Mat2x4 { + return Mat2x4{v1[0] * v2[0], v1[1] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[0] * v2[3], v1[1] * v2[3]} +} + +// Add performs element-wise addition between two vectors. It is equivalent to iterating +// over every element of v1 and adding the corresponding element of v2 to it. +func (v1 Vec3) Add(v2 Vec3) Vec3 { + return Vec3{v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]} +} + +// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating +// over every element of v1 and subtracting the corresponding element of v2 from it. +func (v1 Vec3) Sub(v2 Vec3) Vec3 { + return Vec3{v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]} +} + +// Mul performs a scalar multiplication between the vector and some constant value +// c. This is equivalent to iterating over every vector element and multiplying by c. +func (v1 Vec3) Mul(c float32) Vec3 { + return Vec3{v1[0] * c, v1[1] * c, v1[2] * c} +} + +// Dot returns the dot product of this vector with another. There are multiple ways +// to describe this value. One is the multiplication of their lengths and cos(theta) where +// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta). +// +// The other (and what is actually done) is the sum of the element-wise multiplication of all +// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z. +// +// This means that the dot product of a vector and itself is the square of its Len (within +// the bounds of floating points error). +// +// The dot product is roughly a measure of how closely two vectors are to pointing in the same +// direction. If both vectors are normalized, the value will be -1 for opposite pointing, +// one for same pointing, and 0 for perpendicular vectors. +func (v1 Vec3) Dot(v2 Vec3) float32 { + return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] +} + +// Len returns the vector's length. Note that this is NOT the dimension of +// the vector (len(v)), but the mathematical length. This is equivalent to the square +// root of the sum of the squares of all elements. E.G. for a Vec2 it's +// math.Hypot(v[0], v[1]). +func (v1 Vec3) Len() float32 { + + return float32(math.Sqrt(float64(v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2]))) + +} + +// Normalize normalizes the vector. Normalization is (1/|v|)*v, +// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0, +// this function will return an infinite value for all elements due +// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))). +// +// Normalization makes a vector's Len become 1.0 (within the margin of floating point error), +// while maintaining its directionality. +// +// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp ) +func (v1 Vec3) Normalize() Vec3 { + l := 1.0 / v1.Len() + return Vec3{v1[0] * l, v1[1] * l, v1[2] * l} +} + +// ApproxEqual takes in a vector and does an element-wise +// approximate float comparison as if FloatEqual had been used +func (v1 Vec3) ApproxEqual(v2 Vec3) bool { + for i := range v1 { + if !FloatEqual(v1[i], v2[i]) { + return false + } + } + return true +} + +// ApproxThresholdEq takes in a threshold for comparing two floats, and uses it to do an +// element-wise comparison of the vector to another. +func (v1 Vec3) ApproxEqualThreshold(v2 Vec3, threshold float32) bool { + for i := range v1 { + if !FloatEqualThreshold(v1[i], v2[i], threshold) { + return false + } + } + return true +} + +// ApproxFuncEq takes in a func that compares two floats, and uses it to do an element-wise +// comparison of the vector to another. This is intended to be used with FloatEqualFunc +func (v1 Vec3) ApproxFuncEqual(v2 Vec3, eq func(float32, float32) bool) bool { + for i := range v1 { + if !eq(v1[i], v2[i]) { + return false + } + } + return true +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec3) X() float32 { + return v[0] +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec3) Y() float32 { + return v[1] +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec3) Z() float32 { + return v[2] +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 3x2 matrix. E.G. a Vec3 * Vec2 = Mat3x2. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec3) OuterProd2(v2 Vec2) Mat3x2 { + return Mat3x2{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1]} +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 3x3 matrix. E.G. a Vec3 * Vec3 = Mat3. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec3) OuterProd3(v2 Vec3) Mat3 { + return Mat3{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2]} +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 3x4 matrix. E.G. a Vec3 * Vec4 = Mat3x4. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec3) OuterProd4(v2 Vec4) Mat3x4 { + return Mat3x4{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2], v1[0] * v2[3], v1[1] * v2[3], v1[2] * v2[3]} +} + +// Add performs element-wise addition between two vectors. It is equivalent to iterating +// over every element of v1 and adding the corresponding element of v2 to it. +func (v1 Vec4) Add(v2 Vec4) Vec4 { + return Vec4{v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2], v1[3] + v2[3]} +} + +// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating +// over every element of v1 and subtracting the corresponding element of v2 from it. +func (v1 Vec4) Sub(v2 Vec4) Vec4 { + return Vec4{v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2], v1[3] - v2[3]} +} + +// Mul performs a scalar multiplication between the vector and some constant value +// c. This is equivalent to iterating over every vector element and multiplying by c. +func (v1 Vec4) Mul(c float32) Vec4 { + return Vec4{v1[0] * c, v1[1] * c, v1[2] * c, v1[3] * c} +} + +// Dot returns the dot product of this vector with another. There are multiple ways +// to describe this value. One is the multiplication of their lengths and cos(theta) where +// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta). +// +// The other (and what is actually done) is the sum of the element-wise multiplication of all +// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z. +// +// This means that the dot product of a vector and itself is the square of its Len (within +// the bounds of floating points error). +// +// The dot product is roughly a measure of how closely two vectors are to pointing in the same +// direction. If both vectors are normalized, the value will be -1 for opposite pointing, +// one for same pointing, and 0 for perpendicular vectors. +func (v1 Vec4) Dot(v2 Vec4) float32 { + return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] + v1[3]*v2[3] +} + +// Len returns the vector's length. Note that this is NOT the dimension of +// the vector (len(v)), but the mathematical length. This is equivalent to the square +// root of the sum of the squares of all elements. E.G. for a Vec2 it's +// math.Hypot(v[0], v[1]). +func (v1 Vec4) Len() float32 { + + return float32(math.Sqrt(float64(v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2] + v1[3]*v1[3]))) + +} + +// Normalize normalizes the vector. Normalization is (1/|v|)*v, +// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0, +// this function will return an infinite value for all elements due +// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))). +// +// Normalization makes a vector's Len become 1.0 (within the margin of floating point error), +// while maintaining its directionality. +// +// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp ) +func (v1 Vec4) Normalize() Vec4 { + l := 1.0 / v1.Len() + return Vec4{v1[0] * l, v1[1] * l, v1[2] * l, v1[3] * l} +} + +// ApproxEqual takes in a vector and does an element-wise +// approximate float comparison as if FloatEqual had been used +func (v1 Vec4) ApproxEqual(v2 Vec4) bool { + for i := range v1 { + if !FloatEqual(v1[i], v2[i]) { + return false + } + } + return true +} + +// ApproxThresholdEq takes in a threshold for comparing two floats, and uses it to do an +// element-wise comparison of the vector to another. +func (v1 Vec4) ApproxEqualThreshold(v2 Vec4, threshold float32) bool { + for i := range v1 { + if !FloatEqualThreshold(v1[i], v2[i], threshold) { + return false + } + } + return true +} + +// ApproxFuncEq takes in a func that compares two floats, and uses it to do an element-wise +// comparison of the vector to another. This is intended to be used with FloatEqualFunc +func (v1 Vec4) ApproxFuncEqual(v2 Vec4, eq func(float32, float32) bool) bool { + for i := range v1 { + if !eq(v1[i], v2[i]) { + return false + } + } + return true +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec4) X() float32 { + return v[0] +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec4) Y() float32 { + return v[1] +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec4) Z() float32 { + return v[2] +} + +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v Vec4) W() float32 { + return v[3] +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 4x2 matrix. E.G. a Vec4 * Vec2 = Mat4x2. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec4) OuterProd2(v2 Vec2) Mat4x2 { + return Mat4x2{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[3] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[3] * v2[1]} +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 4x3 matrix. E.G. a Vec4 * Vec3 = Mat4x3. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec4) OuterProd3(v2 Vec3) Mat4x3 { + return Mat4x3{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[3] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[3] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2], v1[3] * v2[2]} +} + +// Does the vector outer product +// of two vectors. The outer product produces an +// 4x4 matrix. E.G. a Vec4 * Vec4 = Mat4. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 Vec4) OuterProd4(v2 Vec4) Mat4 { + return Mat4{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[3] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[3] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2], v1[3] * v2[2], v1[0] * v2[3], v1[1] * v2[3], v1[2] * v2[3], v1[3] * v2[3]} +} diff --git a/vendor/github.com/go-gl/mathgl/mgl32/vector.tmpl b/vendor/github.com/go-gl/mathgl/mgl32/vector.tmpl new file mode 100644 index 0000000..40b497b --- /dev/null +++ b/vendor/github.com/go-gl/mathgl/mgl32/vector.tmpl @@ -0,0 +1,207 @@ +// Copyright 2014 The go-gl/mathgl Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// <<.Comment>> +// Edit <<.TemplateName>> and run "go generate" to make changes. + +package mgl32 + +import ( + "golang.org/x/image/math/f32" + "math" +) + +type Vec2 f32.Vec2 +type Vec3 f32.Vec3 +type Vec4 f32.Vec4 + +func (v Vec2) Vec3(z float32) Vec3 { + return Vec3{v[0], v[1], z} +} + +func (v Vec2) Vec4(z, w float32) Vec4 { + return Vec4{v[0], v[1], z, w} +} + +func (v Vec3) Vec2() Vec2 { + return Vec2{v[0], v[1]} +} + +func (v Vec3) Vec4(w float32) Vec4 { + return Vec4{v[0], v[1], v[2], w} +} + +func (v Vec4) Vec2() Vec2 { + return Vec2{v[0], v[1]} +} + +func (v Vec4) Vec3() Vec3 { + return Vec3{v[0], v[1], v[2]} +} + +// Elem extracts the elements of the vector for direct value assignment. +func (v Vec2) Elem() (x, y float32) { + return v[0], v[1] +} + +// Elem extracts the elements of the vector for direct value assignment. +func (v Vec3) Elem() (x, y, z float32) { + return v[0], v[1], v[2] +} + +// Elem extracts the elements of the vector for direct value assignment. +func (v Vec4) Elem() (x, y, z, w float32) { + return v[0], v[1], v[2], v[3] +} + +// The vector cross product is an operation only defined on 3D vectors. It is equivalent to +// Vec3{v1[1]*v2[2]-v1[2]*v2[1], v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]}. +// Another interpretation is that it's the vector whose magnitude is |v1||v2|sin(theta) +// where theta is the angle between v1 and v2. +// +// The cross product is most often used for finding surface normals. The cross product of vectors +// will generate a vector that is perpendicular to the plane they form. +// +// Technically, a generalized cross product exists as an "(N-1)ary" operation +// (that is, the 4D cross product requires 3 4D vectors). But the binary +// 3D (and 7D) cross product is the most important. It can be considered +// the area of a parallelogram with sides v1 and v2. +// +// Like the dot product, the cross product is roughly a measure of directionality. +// Two normalized perpendicular vectors will return a vector with a magnitude of +// 1.0 or -1.0 and two parallel vectors will return a vector with magnitude 0.0. +// The cross product is "anticommutative" meaning v1.Cross(v2) = -v2.Cross(v1), +// this property can be useful to know when finding normals, +// as taking the wrong cross product can lead to the opposite normal of the one you want. +func (v1 Vec3) Cross(v2 Vec3) Vec3 { + return Vec3{v1[1]*v2[2] - v1[2]*v2[1], v1[2]*v2[0] - v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]} +} + + +<> +<> +<<$type := typename $m 1>> + +// Add performs element-wise addition between two vectors. It is equivalent to iterating +// over every element of v1 and adding the corresponding element of v2 to it. +func (v1 <<$type>>) Add(v2 <<$type>>) <<$type>> { + return <<$type>>{<> v1[<<$i>>] + v2[<<$i>>], <>} +} + +// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating +// over every element of v1 and subtracting the corresponding element of v2 from it. +func (v1 <<$type>>) Sub(v2 <<$type>>) <<$type>> { + return <<$type>>{<> v1[<<$i>>] - v2[<<$i>>], <>} +} + +// Mul performs a scalar multiplication between the vector and some constant value +// c. This is equivalent to iterating over every vector element and multiplying by c. +func (v1 <<$type>>) Mul(c float32) <<$type>> { + return <<$type>>{<> v1[<<$i>>] * c, <>} +} + +// Dot returns the dot product of this vector with another. There are multiple ways +// to describe this value. One is the multiplication of their lengths and cos(theta) where +// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta). +// +// The other (and what is actually done) is the sum of the element-wise multiplication of all +// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z. +// +// This means that the dot product of a vector and itself is the square of its Len (within +// the bounds of floating points error). +// +// The dot product is roughly a measure of how closely two vectors are to pointing in the same +// direction. If both vectors are normalized, the value will be -1 for opposite pointing, +// one for same pointing, and 0 for perpendicular vectors. +func (v1 <<$type>>) Dot(v2 <<$type>>) float32 { + return <><> v1[<<$i>>]*v2[<<$i>>] <> +} + +// Len returns the vector's length. Note that this is NOT the dimension of +// the vector (len(v)), but the mathematical length. This is equivalent to the square +// root of the sum of the squares of all elements. E.G. for a Vec2 it's +// math.Hypot(v[0], v[1]). +func (v1 <<$type>>) Len() float32 { + <> + return float32(math.Hypot(float64(v1[0]), float64(v1[1]))) + <> + return float32(math.Sqrt(float64(<>))) + <> +} + +// Normalize normalizes the vector. Normalization is (1/|v|)*v, +// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0, +// this function will return an infinite value for all elements due +// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))). +// +// Normalization makes a vector's Len become 1.0 (within the margin of floating point error), +// while maintaining its directionality. +// +// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp ) +func (v1 <<$type>>) Normalize() <<$type>> { + l := 1.0 / v1.Len() + return <<$type>>{<>v1[<<$i>>] * l,<>} +} + +// ApproxEqual takes in a vector and does an element-wise +// approximate float comparison as if FloatEqual had been used +func (v1 <<$type>>) ApproxEqual(v2 <<$type>>) bool { + for i := range v1 { + if !FloatEqual(v1[i], v2[i]) { + return false + } + } + return true +} + +// ApproxThresholdEq takes in a threshold for comparing two floats, and uses it to do an +// element-wise comparison of the vector to another. +func (v1 <<$type>>) ApproxEqualThreshold(v2 <<$type>>, threshold float32) bool { + for i := range v1 { + if !FloatEqualThreshold(v1[i], v2[i], threshold) { + return false + } + } + return true +} + +// ApproxFuncEq takes in a func that compares two floats, and uses it to do an element-wise +// comparison of the vector to another. This is intended to be used with FloatEqualFunc +func (v1 <<$type>>) ApproxFuncEqual(v2 <<$type>>, eq func(float32, float32) bool) bool { + for i := range v1 { + if !eq(v1[i], v2[i]) { + return false + } + } + return true +} + +<> +// This is an element access func, it is equivalent to v[n] where +// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks +// show that this is more or less as fast as direct acces, probably due to +// inlining, so use v[0] or v.X() depending on personal preference. +func (v <<$type>>) <>() float32 { + return v[<<$i>>] +} +<> + +<> +// Does the vector outer product +// of two vectors. The outer product produces an +// <<$m>>x<<$n>> matrix. E.G. a Vec<<$m>> * Vec<<$n>> = <>. +// +// The outer product can be thought of as the "opposite" +// of the Dot product. The Dot product treats both vectors like matrices +// oriented such that the left one has N columns and the right has N rows. +// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar. +// +// The outer product orients it so they're facing "outward": Vec2*Vec3 +// = Mat2x1*Mat1x3 = Mat2x3. +func (v1 <<$type>>) OuterProd<<$n>>(v2 <>) <> { + return <>{<>v1[<<$i.M>>] * v2[<<$i.N>>], <>} +} +<> + +<> <> diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/vendor/github.com/pkg/errors/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml new file mode 100644 index 0000000..588ceca --- /dev/null +++ b/vendor/github.com/pkg/errors/.travis.yml @@ -0,0 +1,11 @@ +language: go +go_import_path: github.com/pkg/errors +go: + - 1.4.3 + - 1.5.4 + - 1.6.2 + - 1.7.1 + - tip + +script: + - go test -v ./... diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE new file mode 100644 index 0000000..835ba3e --- /dev/null +++ b/vendor/github.com/pkg/errors/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md new file mode 100644 index 0000000..273db3c --- /dev/null +++ b/vendor/github.com/pkg/errors/README.md @@ -0,0 +1,52 @@ +# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) + +Package errors provides simple error handling primitives. + +`go get github.com/pkg/errors` + +The traditional error handling idiom in Go is roughly akin to +```go +if err != nil { + return err +} +``` +which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. + +## Adding context to an error + +The errors.Wrap function returns a new error that adds context to the original error. For example +```go +_, err := ioutil.ReadAll(r) +if err != nil { + return errors.Wrap(err, "read failed") +} +``` +## Retrieving the cause of an error + +Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. +```go +type causer interface { + Cause() error +} +``` +`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: +```go +switch err := errors.Cause(err).(type) { +case *MyError: + // handle specifically +default: + // unknown error +} +``` + +[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). + +## Contributing + +We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. + +Before proposing a change, please discuss your change by raising an issue. + +## Licence + +BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/vendor/github.com/pkg/errors/appveyor.yml new file mode 100644 index 0000000..a932ead --- /dev/null +++ b/vendor/github.com/pkg/errors/appveyor.yml @@ -0,0 +1,32 @@ +version: build-{build}.{branch} + +clone_folder: C:\gopath\src\github.com\pkg\errors +shallow_clone: true # for startup speed + +environment: + GOPATH: C:\gopath + +platform: + - x64 + +# http://www.appveyor.com/docs/installed-software +install: + # some helpful output for debugging builds + - go version + - go env + # pre-installed MinGW at C:\MinGW is 32bit only + # but MSYS2 at C:\msys64 has mingw64 + - set PATH=C:\msys64\mingw64\bin;%PATH% + - gcc --version + - g++ --version + +build_script: + - go install -v ./... + +test_script: + - set PATH=C:\gopath\bin;%PATH% + - go test -v ./... + +#artifacts: +# - path: '%GOPATH%\bin\*.exe' +deploy: off diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go new file mode 100644 index 0000000..842ee80 --- /dev/null +++ b/vendor/github.com/pkg/errors/errors.go @@ -0,0 +1,269 @@ +// Package errors provides simple error handling primitives. +// +// The traditional error handling idiom in Go is roughly akin to +// +// if err != nil { +// return err +// } +// +// which applied recursively up the call stack results in error reports +// without context or debugging information. The errors package allows +// programmers to add context to the failure path in their code in a way +// that does not destroy the original value of the error. +// +// Adding context to an error +// +// The errors.Wrap function returns a new error that adds context to the +// original error by recording a stack trace at the point Wrap is called, +// and the supplied message. For example +// +// _, err := ioutil.ReadAll(r) +// if err != nil { +// return errors.Wrap(err, "read failed") +// } +// +// If additional control is required the errors.WithStack and errors.WithMessage +// functions destructure errors.Wrap into its component operations of annotating +// an error with a stack trace and an a message, respectively. +// +// Retrieving the cause of an error +// +// Using errors.Wrap constructs a stack of errors, adding context to the +// preceding error. Depending on the nature of the error it may be necessary +// to reverse the operation of errors.Wrap to retrieve the original error +// for inspection. Any error value which implements this interface +// +// type causer interface { +// Cause() error +// } +// +// can be inspected by errors.Cause. errors.Cause will recursively retrieve +// the topmost error which does not implement causer, which is assumed to be +// the original cause. For example: +// +// switch err := errors.Cause(err).(type) { +// case *MyError: +// // handle specifically +// default: +// // unknown error +// } +// +// causer interface is not exported by this package, but is considered a part +// of stable public API. +// +// Formatted printing of errors +// +// All error values returned from this package implement fmt.Formatter and can +// be formatted by the fmt package. The following verbs are supported +// +// %s print the error. If the error has a Cause it will be +// printed recursively +// %v see %s +// %+v extended format. Each Frame of the error's StackTrace will +// be printed in detail. +// +// Retrieving the stack trace of an error or wrapper +// +// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are +// invoked. This information can be retrieved with the following interface. +// +// type stackTracer interface { +// StackTrace() errors.StackTrace +// } +// +// Where errors.StackTrace is defined as +// +// type StackTrace []Frame +// +// The Frame type represents a call site in the stack trace. Frame supports +// the fmt.Formatter interface that can be used for printing information about +// the stack trace of this error. For example: +// +// if err, ok := err.(stackTracer); ok { +// for _, f := range err.StackTrace() { +// fmt.Printf("%+s:%d", f) +// } +// } +// +// stackTracer interface is not exported by this package, but is considered a part +// of stable public API. +// +// See the documentation for Frame.Format for more details. +package errors + +import ( + "fmt" + "io" +) + +// New returns an error with the supplied message. +// New also records the stack trace at the point it was called. +func New(message string) error { + return &fundamental{ + msg: message, + stack: callers(), + } +} + +// Errorf formats according to a format specifier and returns the string +// as a value that satisfies error. +// Errorf also records the stack trace at the point it was called. +func Errorf(format string, args ...interface{}) error { + return &fundamental{ + msg: fmt.Sprintf(format, args...), + stack: callers(), + } +} + +// fundamental is an error that has a message and a stack, but no caller. +type fundamental struct { + msg string + *stack +} + +func (f *fundamental) Error() string { return f.msg } + +func (f *fundamental) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + io.WriteString(s, f.msg) + f.stack.Format(s, verb) + return + } + fallthrough + case 's': + io.WriteString(s, f.msg) + case 'q': + fmt.Fprintf(s, "%q", f.msg) + } +} + +// WithStack annotates err with a stack trace at the point WithStack was called. +// If err is nil, WithStack returns nil. +func WithStack(err error) error { + if err == nil { + return nil + } + return &withStack{ + err, + callers(), + } +} + +type withStack struct { + error + *stack +} + +func (w *withStack) Cause() error { return w.error } + +func (w *withStack) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v", w.Cause()) + w.stack.Format(s, verb) + return + } + fallthrough + case 's': + io.WriteString(s, w.Error()) + case 'q': + fmt.Fprintf(s, "%q", w.Error()) + } +} + +// Wrap returns an error annotating err with a stack trace +// at the point Wrap is called, and the supplied message. +// If err is nil, Wrap returns nil. +func Wrap(err error, message string) error { + if err == nil { + return nil + } + err = &withMessage{ + cause: err, + msg: message, + } + return &withStack{ + err, + callers(), + } +} + +// Wrapf returns an error annotating err with a stack trace +// at the point Wrapf is call, and the format specifier. +// If err is nil, Wrapf returns nil. +func Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return nil + } + err = &withMessage{ + cause: err, + msg: fmt.Sprintf(format, args...), + } + return &withStack{ + err, + callers(), + } +} + +// WithMessage annotates err with a new message. +// If err is nil, WithMessage returns nil. +func WithMessage(err error, message string) error { + if err == nil { + return nil + } + return &withMessage{ + cause: err, + msg: message, + } +} + +type withMessage struct { + cause error + msg string +} + +func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } +func (w *withMessage) Cause() error { return w.cause } + +func (w *withMessage) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v\n", w.Cause()) + io.WriteString(s, w.msg) + return + } + fallthrough + case 's', 'q': + io.WriteString(s, w.Error()) + } +} + +// Cause returns the underlying cause of the error, if possible. +// An error value has a cause if it implements the following +// interface: +// +// type causer interface { +// Cause() error +// } +// +// If the error does not implement Cause, the original error will +// be returned. If the error is nil, nil will be returned without further +// investigation. +func Cause(err error) error { + type causer interface { + Cause() error + } + + for err != nil { + cause, ok := err.(causer) + if !ok { + break + } + err = cause.Cause() + } + return err +} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go new file mode 100644 index 0000000..6b1f289 --- /dev/null +++ b/vendor/github.com/pkg/errors/stack.go @@ -0,0 +1,178 @@ +package errors + +import ( + "fmt" + "io" + "path" + "runtime" + "strings" +) + +// Frame represents a program counter inside a stack frame. +type Frame uintptr + +// pc returns the program counter for this frame; +// multiple frames may have the same PC value. +func (f Frame) pc() uintptr { return uintptr(f) - 1 } + +// file returns the full path to the file that contains the +// function for this Frame's pc. +func (f Frame) file() string { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return "unknown" + } + file, _ := fn.FileLine(f.pc()) + return file +} + +// line returns the line number of source code of the +// function for this Frame's pc. +func (f Frame) line() int { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return 0 + } + _, line := fn.FileLine(f.pc()) + return line +} + +// Format formats the frame according to the fmt.Formatter interface. +// +// %s source file +// %d source line +// %n function name +// %v equivalent to %s:%d +// +// Format accepts flags that alter the printing of some verbs, as follows: +// +// %+s path of source file relative to the compile time GOPATH +// %+v equivalent to %+s:%d +func (f Frame) Format(s fmt.State, verb rune) { + switch verb { + case 's': + switch { + case s.Flag('+'): + pc := f.pc() + fn := runtime.FuncForPC(pc) + if fn == nil { + io.WriteString(s, "unknown") + } else { + file, _ := fn.FileLine(pc) + fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) + } + default: + io.WriteString(s, path.Base(f.file())) + } + case 'd': + fmt.Fprintf(s, "%d", f.line()) + case 'n': + name := runtime.FuncForPC(f.pc()).Name() + io.WriteString(s, funcname(name)) + case 'v': + f.Format(s, 's') + io.WriteString(s, ":") + f.Format(s, 'd') + } +} + +// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). +type StackTrace []Frame + +func (st StackTrace) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case s.Flag('+'): + for _, f := range st { + fmt.Fprintf(s, "\n%+v", f) + } + case s.Flag('#'): + fmt.Fprintf(s, "%#v", []Frame(st)) + default: + fmt.Fprintf(s, "%v", []Frame(st)) + } + case 's': + fmt.Fprintf(s, "%s", []Frame(st)) + } +} + +// stack represents a stack of program counters. +type stack []uintptr + +func (s *stack) Format(st fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case st.Flag('+'): + for _, pc := range *s { + f := Frame(pc) + fmt.Fprintf(st, "\n%+v", f) + } + } + } +} + +func (s *stack) StackTrace() StackTrace { + f := make([]Frame, len(*s)) + for i := 0; i < len(f); i++ { + f[i] = Frame((*s)[i]) + } + return f +} + +func callers() *stack { + const depth = 32 + var pcs [depth]uintptr + n := runtime.Callers(3, pcs[:]) + var st stack = pcs[0:n] + return &st +} + +// funcname removes the path prefix component of a function's name reported by func.Name(). +func funcname(name string) string { + i := strings.LastIndex(name, "/") + name = name[i+1:] + i = strings.Index(name, ".") + return name[i+1:] +} + +func trimGOPATH(name, file string) string { + // Here we want to get the source file path relative to the compile time + // GOPATH. As of Go 1.6.x there is no direct way to know the compiled + // GOPATH at runtime, but we can infer the number of path segments in the + // GOPATH. We note that fn.Name() returns the function name qualified by + // the import path, which does not include the GOPATH. Thus we can trim + // segments from the beginning of the file path until the number of path + // separators remaining is one more than the number of path separators in + // the function name. For example, given: + // + // GOPATH /home/user + // file /home/user/src/pkg/sub/file.go + // fn.Name() pkg/sub.Type.Method + // + // We want to produce: + // + // pkg/sub/file.go + // + // From this we can easily see that fn.Name() has one less path separator + // than our desired output. We count separators from the end of the file + // path until it finds two more than in the function name and then move + // one character forward to preserve the initial path segment without a + // leading separator. + const sep = "/" + goal := strings.Count(name, sep) + 2 + i := len(file) + for n := 0; n < goal; n++ { + i = strings.LastIndex(file[:i], sep) + if i == -1 { + // not enough separators found, set i so that the slice expression + // below leaves file unmodified + i = -len(sep) + break + } + } + // get back to 0 or trim the leading separator + file = file[i+len(sep):] + return file +} diff --git a/vendor/golang.org/x/image/AUTHORS b/vendor/golang.org/x/image/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/image/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/image/CONTRIBUTORS b/vendor/golang.org/x/image/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/image/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/image/LICENSE b/vendor/golang.org/x/image/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/vendor/golang.org/x/image/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/image/PATENTS b/vendor/golang.org/x/image/PATENTS new file mode 100644 index 0000000..7330990 --- /dev/null +++ b/vendor/golang.org/x/image/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/image/colornames/colornames.go b/vendor/golang.org/x/image/colornames/colornames.go new file mode 100644 index 0000000..fa94d42 --- /dev/null +++ b/vendor/golang.org/x/image/colornames/colornames.go @@ -0,0 +1,10 @@ +// Copyright 2015 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. + +//go:generate go run gen.go + +// Package colornames provides named colors as defined in the SVG 1.1 spec. +// +// See http://www.w3.org/TR/SVG/types.html#ColorKeywords +package colornames diff --git a/vendor/golang.org/x/image/colornames/gen.go b/vendor/golang.org/x/image/colornames/gen.go new file mode 100644 index 0000000..d46e968 --- /dev/null +++ b/vendor/golang.org/x/image/colornames/gen.go @@ -0,0 +1,197 @@ +// Copyright 2015 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 ignore + +// This program generates table.go from +// http://www.w3.org/TR/SVG/types.html#ColorKeywords +package main + +import ( + "bytes" + "fmt" + "go/format" + "image/color" + "io" + "io/ioutil" + "log" + "net/http" + "regexp" + "sort" + "strconv" + "strings" + + "golang.org/x/net/html" + "golang.org/x/net/html/atom" +) + +// matchFunc matches HTML nodes. +type matchFunc func(*html.Node) bool + +// appendAll recursively traverses the parse tree rooted under the provided +// node and appends all nodes matched by the matchFunc to dst. +func appendAll(dst []*html.Node, n *html.Node, mf matchFunc) []*html.Node { + if mf(n) { + dst = append(dst, n) + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + dst = appendAll(dst, c, mf) + } + return dst +} + +// matchAtom returns a matchFunc that matches a Node with the specified Atom. +func matchAtom(a atom.Atom) matchFunc { + return func(n *html.Node) bool { + return n.DataAtom == a + } +} + +// matchAtomAttr returns a matchFunc that matches a Node with the specified +// Atom and a html.Attribute's namespace, key and value. +func matchAtomAttr(a atom.Atom, namespace, key, value string) matchFunc { + return func(n *html.Node) bool { + return n.DataAtom == a && getAttr(n, namespace, key) == value + } +} + +// getAttr fetches the value of a html.Attribute for a given namespace and key. +func getAttr(n *html.Node, namespace, key string) string { + for _, attr := range n.Attr { + if attr.Namespace == namespace && attr.Key == key { + return attr.Val + } + } + return "" +} + +// re extracts RGB values from strings like "rgb( 0, 223, 128)". +var re = regexp.MustCompile(`rgb\(\s*([0-9]+),\s*([0-9]+),\s*([0-9]+)\)`) + +// parseRGB parses a color from a string like "rgb( 0, 233, 128)". It sets +// the alpha value of the color to full opacity. +func parseRGB(s string) (color.RGBA, error) { + m := re.FindStringSubmatch(s) + if m == nil { + return color.RGBA{}, fmt.Errorf("malformed color: %q", s) + } + var rgb [3]uint8 + for i, t := range m[1:] { + num, err := strconv.ParseUint(t, 10, 8) + if err != nil { + return color.RGBA{}, fmt.Errorf("malformed value %q in %q: %s", t, s, err) + } + rgb[i] = uint8(num) + } + return color.RGBA{rgb[0], rgb[1], rgb[2], 0xFF}, nil +} + +// extractSVGColors extracts named colors from the parse tree of the SVG 1.1 +// spec HTML document "Chapter 4: Basic data types and interfaces". +func extractSVGColors(tree *html.Node) (map[string]color.RGBA, error) { + ret := make(map[string]color.RGBA) + + // Find the tables which store the color keywords in the parse tree. + colorTables := appendAll(nil, tree, func(n *html.Node) bool { + return n.DataAtom == atom.Table && strings.Contains(getAttr(n, "", "summary"), "color keywords part") + }) + + for _, table := range colorTables { + // Color names and values are stored in TextNodes within spans in each row. + for _, tr := range appendAll(nil, table, matchAtom(atom.Tr)) { + nameSpan := appendAll(nil, tr, matchAtomAttr(atom.Span, "", "class", "prop-value")) + valueSpan := appendAll(nil, tr, matchAtomAttr(atom.Span, "", "class", "color-keyword-value")) + + // Since SVG 1.1 defines an odd number of colors, the last row + // in the second table does not have contents. We skip it. + if len(nameSpan) != 1 || len(valueSpan) != 1 { + continue + } + n, v := nameSpan[0].FirstChild, valueSpan[0].FirstChild + // This sanity checks for the existence of TextNodes under spans. + if n == nil || n.Type != html.TextNode || v == nil || v.Type != html.TextNode { + return nil, fmt.Errorf("extractSVGColors: couldn't find name/value text nodes") + } + val, err := parseRGB(v.Data) + if err != nil { + return nil, fmt.Errorf("extractSVGColors: couldn't parse name/value %q/%q: %s", n.Data, v.Data, err) + } + ret[n.Data] = val + } + } + return ret, nil +} + +const preamble = `// generated by go generate; DO NOT EDIT. + +package colornames + +import "image/color" + +` + +// WriteColorNames writes table.go. +func writeColorNames(w io.Writer, m map[string]color.RGBA) { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + sort.Strings(keys) + + fmt.Fprintln(w, preamble) + fmt.Fprintln(w, "// Map contains named colors defined in the SVG 1.1 spec.") + fmt.Fprintln(w, "var Map = map[string]color.RGBA{") + for _, k := range keys { + c := m[k] + fmt.Fprintf(w, "%q:color.RGBA{%#02x, %#02x, %#02x, %#02x}, // rgb(%d, %d, %d)\n", + k, c.R, c.G, c.B, c.A, c.R, c.G, c.B) + } + fmt.Fprintln(w, "}\n") + fmt.Fprintln(w, "// Names contains the color names defined in the SVG 1.1 spec.") + fmt.Fprintln(w, "var Names = []string{") + for _, k := range keys { + fmt.Fprintf(w, "%q,\n", k) + } + fmt.Fprintln(w, "}\n") + fmt.Fprintln(w, "var (") + for _, k := range keys { + c := m[k] + // Make the upper case version of k: "Darkred" instead of "darkred". + k = string(k[0]-0x20) + k[1:] + fmt.Fprintf(w, "%s=color.RGBA{%#02x, %#02x, %#02x, %#02x} // rgb(%d, %d, %d)\n", + k, c.R, c.G, c.B, c.A, c.R, c.G, c.B) + } + fmt.Fprintln(w, ")") +} + +const url = "http://www.w3.org/TR/SVG/types.html" + +func main() { + res, err := http.Get(url) + if err != nil { + log.Fatalf("Couldn't read from %s: %s\n", url, err) + } + defer res.Body.Close() + + tree, err := html.Parse(res.Body) + if err != nil { + log.Fatalf("Couldn't parse %s: %s\n", url, err) + } + + colors, err := extractSVGColors(tree) + if err != nil { + log.Fatalf("Couldn't extract colors: %s\n", err) + } + + buf := &bytes.Buffer{} + writeColorNames(buf, colors) + fmted, err := format.Source(buf.Bytes()) + if err != nil { + log.Fatalf("Error while formatting code: %s\n", err) + } + + if err := ioutil.WriteFile("table.go", fmted, 0644); err != nil { + log.Fatalf("Error writing table.go: %s\n", err) + } +} diff --git a/vendor/golang.org/x/image/colornames/table.go b/vendor/golang.org/x/image/colornames/table.go new file mode 100644 index 0000000..7b6f1f4 --- /dev/null +++ b/vendor/golang.org/x/image/colornames/table.go @@ -0,0 +1,457 @@ +// generated by go generate; DO NOT EDIT. + +package colornames + +import "image/color" + +// Map contains named colors defined in the SVG 1.1 spec. +var Map = map[string]color.RGBA{ + "aliceblue": color.RGBA{0xf0, 0xf8, 0xff, 0xff}, // rgb(240, 248, 255) + "antiquewhite": color.RGBA{0xfa, 0xeb, 0xd7, 0xff}, // rgb(250, 235, 215) + "aqua": color.RGBA{0x00, 0xff, 0xff, 0xff}, // rgb(0, 255, 255) + "aquamarine": color.RGBA{0x7f, 0xff, 0xd4, 0xff}, // rgb(127, 255, 212) + "azure": color.RGBA{0xf0, 0xff, 0xff, 0xff}, // rgb(240, 255, 255) + "beige": color.RGBA{0xf5, 0xf5, 0xdc, 0xff}, // rgb(245, 245, 220) + "bisque": color.RGBA{0xff, 0xe4, 0xc4, 0xff}, // rgb(255, 228, 196) + "black": color.RGBA{0x00, 0x00, 0x00, 0xff}, // rgb(0, 0, 0) + "blanchedalmond": color.RGBA{0xff, 0xeb, 0xcd, 0xff}, // rgb(255, 235, 205) + "blue": color.RGBA{0x00, 0x00, 0xff, 0xff}, // rgb(0, 0, 255) + "blueviolet": color.RGBA{0x8a, 0x2b, 0xe2, 0xff}, // rgb(138, 43, 226) + "brown": color.RGBA{0xa5, 0x2a, 0x2a, 0xff}, // rgb(165, 42, 42) + "burlywood": color.RGBA{0xde, 0xb8, 0x87, 0xff}, // rgb(222, 184, 135) + "cadetblue": color.RGBA{0x5f, 0x9e, 0xa0, 0xff}, // rgb(95, 158, 160) + "chartreuse": color.RGBA{0x7f, 0xff, 0x00, 0xff}, // rgb(127, 255, 0) + "chocolate": color.RGBA{0xd2, 0x69, 0x1e, 0xff}, // rgb(210, 105, 30) + "coral": color.RGBA{0xff, 0x7f, 0x50, 0xff}, // rgb(255, 127, 80) + "cornflowerblue": color.RGBA{0x64, 0x95, 0xed, 0xff}, // rgb(100, 149, 237) + "cornsilk": color.RGBA{0xff, 0xf8, 0xdc, 0xff}, // rgb(255, 248, 220) + "crimson": color.RGBA{0xdc, 0x14, 0x3c, 0xff}, // rgb(220, 20, 60) + "cyan": color.RGBA{0x00, 0xff, 0xff, 0xff}, // rgb(0, 255, 255) + "darkblue": color.RGBA{0x00, 0x00, 0x8b, 0xff}, // rgb(0, 0, 139) + "darkcyan": color.RGBA{0x00, 0x8b, 0x8b, 0xff}, // rgb(0, 139, 139) + "darkgoldenrod": color.RGBA{0xb8, 0x86, 0x0b, 0xff}, // rgb(184, 134, 11) + "darkgray": color.RGBA{0xa9, 0xa9, 0xa9, 0xff}, // rgb(169, 169, 169) + "darkgreen": color.RGBA{0x00, 0x64, 0x00, 0xff}, // rgb(0, 100, 0) + "darkgrey": color.RGBA{0xa9, 0xa9, 0xa9, 0xff}, // rgb(169, 169, 169) + "darkkhaki": color.RGBA{0xbd, 0xb7, 0x6b, 0xff}, // rgb(189, 183, 107) + "darkmagenta": color.RGBA{0x8b, 0x00, 0x8b, 0xff}, // rgb(139, 0, 139) + "darkolivegreen": color.RGBA{0x55, 0x6b, 0x2f, 0xff}, // rgb(85, 107, 47) + "darkorange": color.RGBA{0xff, 0x8c, 0x00, 0xff}, // rgb(255, 140, 0) + "darkorchid": color.RGBA{0x99, 0x32, 0xcc, 0xff}, // rgb(153, 50, 204) + "darkred": color.RGBA{0x8b, 0x00, 0x00, 0xff}, // rgb(139, 0, 0) + "darksalmon": color.RGBA{0xe9, 0x96, 0x7a, 0xff}, // rgb(233, 150, 122) + "darkseagreen": color.RGBA{0x8f, 0xbc, 0x8f, 0xff}, // rgb(143, 188, 143) + "darkslateblue": color.RGBA{0x48, 0x3d, 0x8b, 0xff}, // rgb(72, 61, 139) + "darkslategray": color.RGBA{0x2f, 0x4f, 0x4f, 0xff}, // rgb(47, 79, 79) + "darkslategrey": color.RGBA{0x2f, 0x4f, 0x4f, 0xff}, // rgb(47, 79, 79) + "darkturquoise": color.RGBA{0x00, 0xce, 0xd1, 0xff}, // rgb(0, 206, 209) + "darkviolet": color.RGBA{0x94, 0x00, 0xd3, 0xff}, // rgb(148, 0, 211) + "deeppink": color.RGBA{0xff, 0x14, 0x93, 0xff}, // rgb(255, 20, 147) + "deepskyblue": color.RGBA{0x00, 0xbf, 0xff, 0xff}, // rgb(0, 191, 255) + "dimgray": color.RGBA{0x69, 0x69, 0x69, 0xff}, // rgb(105, 105, 105) + "dimgrey": color.RGBA{0x69, 0x69, 0x69, 0xff}, // rgb(105, 105, 105) + "dodgerblue": color.RGBA{0x1e, 0x90, 0xff, 0xff}, // rgb(30, 144, 255) + "firebrick": color.RGBA{0xb2, 0x22, 0x22, 0xff}, // rgb(178, 34, 34) + "floralwhite": color.RGBA{0xff, 0xfa, 0xf0, 0xff}, // rgb(255, 250, 240) + "forestgreen": color.RGBA{0x22, 0x8b, 0x22, 0xff}, // rgb(34, 139, 34) + "fuchsia": color.RGBA{0xff, 0x00, 0xff, 0xff}, // rgb(255, 0, 255) + "gainsboro": color.RGBA{0xdc, 0xdc, 0xdc, 0xff}, // rgb(220, 220, 220) + "ghostwhite": color.RGBA{0xf8, 0xf8, 0xff, 0xff}, // rgb(248, 248, 255) + "gold": color.RGBA{0xff, 0xd7, 0x00, 0xff}, // rgb(255, 215, 0) + "goldenrod": color.RGBA{0xda, 0xa5, 0x20, 0xff}, // rgb(218, 165, 32) + "gray": color.RGBA{0x80, 0x80, 0x80, 0xff}, // rgb(128, 128, 128) + "green": color.RGBA{0x00, 0x80, 0x00, 0xff}, // rgb(0, 128, 0) + "greenyellow": color.RGBA{0xad, 0xff, 0x2f, 0xff}, // rgb(173, 255, 47) + "grey": color.RGBA{0x80, 0x80, 0x80, 0xff}, // rgb(128, 128, 128) + "honeydew": color.RGBA{0xf0, 0xff, 0xf0, 0xff}, // rgb(240, 255, 240) + "hotpink": color.RGBA{0xff, 0x69, 0xb4, 0xff}, // rgb(255, 105, 180) + "indianred": color.RGBA{0xcd, 0x5c, 0x5c, 0xff}, // rgb(205, 92, 92) + "indigo": color.RGBA{0x4b, 0x00, 0x82, 0xff}, // rgb(75, 0, 130) + "ivory": color.RGBA{0xff, 0xff, 0xf0, 0xff}, // rgb(255, 255, 240) + "khaki": color.RGBA{0xf0, 0xe6, 0x8c, 0xff}, // rgb(240, 230, 140) + "lavender": color.RGBA{0xe6, 0xe6, 0xfa, 0xff}, // rgb(230, 230, 250) + "lavenderblush": color.RGBA{0xff, 0xf0, 0xf5, 0xff}, // rgb(255, 240, 245) + "lawngreen": color.RGBA{0x7c, 0xfc, 0x00, 0xff}, // rgb(124, 252, 0) + "lemonchiffon": color.RGBA{0xff, 0xfa, 0xcd, 0xff}, // rgb(255, 250, 205) + "lightblue": color.RGBA{0xad, 0xd8, 0xe6, 0xff}, // rgb(173, 216, 230) + "lightcoral": color.RGBA{0xf0, 0x80, 0x80, 0xff}, // rgb(240, 128, 128) + "lightcyan": color.RGBA{0xe0, 0xff, 0xff, 0xff}, // rgb(224, 255, 255) + "lightgoldenrodyellow": color.RGBA{0xfa, 0xfa, 0xd2, 0xff}, // rgb(250, 250, 210) + "lightgray": color.RGBA{0xd3, 0xd3, 0xd3, 0xff}, // rgb(211, 211, 211) + "lightgreen": color.RGBA{0x90, 0xee, 0x90, 0xff}, // rgb(144, 238, 144) + "lightgrey": color.RGBA{0xd3, 0xd3, 0xd3, 0xff}, // rgb(211, 211, 211) + "lightpink": color.RGBA{0xff, 0xb6, 0xc1, 0xff}, // rgb(255, 182, 193) + "lightsalmon": color.RGBA{0xff, 0xa0, 0x7a, 0xff}, // rgb(255, 160, 122) + "lightseagreen": color.RGBA{0x20, 0xb2, 0xaa, 0xff}, // rgb(32, 178, 170) + "lightskyblue": color.RGBA{0x87, 0xce, 0xfa, 0xff}, // rgb(135, 206, 250) + "lightslategray": color.RGBA{0x77, 0x88, 0x99, 0xff}, // rgb(119, 136, 153) + "lightslategrey": color.RGBA{0x77, 0x88, 0x99, 0xff}, // rgb(119, 136, 153) + "lightsteelblue": color.RGBA{0xb0, 0xc4, 0xde, 0xff}, // rgb(176, 196, 222) + "lightyellow": color.RGBA{0xff, 0xff, 0xe0, 0xff}, // rgb(255, 255, 224) + "lime": color.RGBA{0x00, 0xff, 0x00, 0xff}, // rgb(0, 255, 0) + "limegreen": color.RGBA{0x32, 0xcd, 0x32, 0xff}, // rgb(50, 205, 50) + "linen": color.RGBA{0xfa, 0xf0, 0xe6, 0xff}, // rgb(250, 240, 230) + "magenta": color.RGBA{0xff, 0x00, 0xff, 0xff}, // rgb(255, 0, 255) + "maroon": color.RGBA{0x80, 0x00, 0x00, 0xff}, // rgb(128, 0, 0) + "mediumaquamarine": color.RGBA{0x66, 0xcd, 0xaa, 0xff}, // rgb(102, 205, 170) + "mediumblue": color.RGBA{0x00, 0x00, 0xcd, 0xff}, // rgb(0, 0, 205) + "mediumorchid": color.RGBA{0xba, 0x55, 0xd3, 0xff}, // rgb(186, 85, 211) + "mediumpurple": color.RGBA{0x93, 0x70, 0xdb, 0xff}, // rgb(147, 112, 219) + "mediumseagreen": color.RGBA{0x3c, 0xb3, 0x71, 0xff}, // rgb(60, 179, 113) + "mediumslateblue": color.RGBA{0x7b, 0x68, 0xee, 0xff}, // rgb(123, 104, 238) + "mediumspringgreen": color.RGBA{0x00, 0xfa, 0x9a, 0xff}, // rgb(0, 250, 154) + "mediumturquoise": color.RGBA{0x48, 0xd1, 0xcc, 0xff}, // rgb(72, 209, 204) + "mediumvioletred": color.RGBA{0xc7, 0x15, 0x85, 0xff}, // rgb(199, 21, 133) + "midnightblue": color.RGBA{0x19, 0x19, 0x70, 0xff}, // rgb(25, 25, 112) + "mintcream": color.RGBA{0xf5, 0xff, 0xfa, 0xff}, // rgb(245, 255, 250) + "mistyrose": color.RGBA{0xff, 0xe4, 0xe1, 0xff}, // rgb(255, 228, 225) + "moccasin": color.RGBA{0xff, 0xe4, 0xb5, 0xff}, // rgb(255, 228, 181) + "navajowhite": color.RGBA{0xff, 0xde, 0xad, 0xff}, // rgb(255, 222, 173) + "navy": color.RGBA{0x00, 0x00, 0x80, 0xff}, // rgb(0, 0, 128) + "oldlace": color.RGBA{0xfd, 0xf5, 0xe6, 0xff}, // rgb(253, 245, 230) + "olive": color.RGBA{0x80, 0x80, 0x00, 0xff}, // rgb(128, 128, 0) + "olivedrab": color.RGBA{0x6b, 0x8e, 0x23, 0xff}, // rgb(107, 142, 35) + "orange": color.RGBA{0xff, 0xa5, 0x00, 0xff}, // rgb(255, 165, 0) + "orangered": color.RGBA{0xff, 0x45, 0x00, 0xff}, // rgb(255, 69, 0) + "orchid": color.RGBA{0xda, 0x70, 0xd6, 0xff}, // rgb(218, 112, 214) + "palegoldenrod": color.RGBA{0xee, 0xe8, 0xaa, 0xff}, // rgb(238, 232, 170) + "palegreen": color.RGBA{0x98, 0xfb, 0x98, 0xff}, // rgb(152, 251, 152) + "paleturquoise": color.RGBA{0xaf, 0xee, 0xee, 0xff}, // rgb(175, 238, 238) + "palevioletred": color.RGBA{0xdb, 0x70, 0x93, 0xff}, // rgb(219, 112, 147) + "papayawhip": color.RGBA{0xff, 0xef, 0xd5, 0xff}, // rgb(255, 239, 213) + "peachpuff": color.RGBA{0xff, 0xda, 0xb9, 0xff}, // rgb(255, 218, 185) + "peru": color.RGBA{0xcd, 0x85, 0x3f, 0xff}, // rgb(205, 133, 63) + "pink": color.RGBA{0xff, 0xc0, 0xcb, 0xff}, // rgb(255, 192, 203) + "plum": color.RGBA{0xdd, 0xa0, 0xdd, 0xff}, // rgb(221, 160, 221) + "powderblue": color.RGBA{0xb0, 0xe0, 0xe6, 0xff}, // rgb(176, 224, 230) + "purple": color.RGBA{0x80, 0x00, 0x80, 0xff}, // rgb(128, 0, 128) + "red": color.RGBA{0xff, 0x00, 0x00, 0xff}, // rgb(255, 0, 0) + "rosybrown": color.RGBA{0xbc, 0x8f, 0x8f, 0xff}, // rgb(188, 143, 143) + "royalblue": color.RGBA{0x41, 0x69, 0xe1, 0xff}, // rgb(65, 105, 225) + "saddlebrown": color.RGBA{0x8b, 0x45, 0x13, 0xff}, // rgb(139, 69, 19) + "salmon": color.RGBA{0xfa, 0x80, 0x72, 0xff}, // rgb(250, 128, 114) + "sandybrown": color.RGBA{0xf4, 0xa4, 0x60, 0xff}, // rgb(244, 164, 96) + "seagreen": color.RGBA{0x2e, 0x8b, 0x57, 0xff}, // rgb(46, 139, 87) + "seashell": color.RGBA{0xff, 0xf5, 0xee, 0xff}, // rgb(255, 245, 238) + "sienna": color.RGBA{0xa0, 0x52, 0x2d, 0xff}, // rgb(160, 82, 45) + "silver": color.RGBA{0xc0, 0xc0, 0xc0, 0xff}, // rgb(192, 192, 192) + "skyblue": color.RGBA{0x87, 0xce, 0xeb, 0xff}, // rgb(135, 206, 235) + "slateblue": color.RGBA{0x6a, 0x5a, 0xcd, 0xff}, // rgb(106, 90, 205) + "slategray": color.RGBA{0x70, 0x80, 0x90, 0xff}, // rgb(112, 128, 144) + "slategrey": color.RGBA{0x70, 0x80, 0x90, 0xff}, // rgb(112, 128, 144) + "snow": color.RGBA{0xff, 0xfa, 0xfa, 0xff}, // rgb(255, 250, 250) + "springgreen": color.RGBA{0x00, 0xff, 0x7f, 0xff}, // rgb(0, 255, 127) + "steelblue": color.RGBA{0x46, 0x82, 0xb4, 0xff}, // rgb(70, 130, 180) + "tan": color.RGBA{0xd2, 0xb4, 0x8c, 0xff}, // rgb(210, 180, 140) + "teal": color.RGBA{0x00, 0x80, 0x80, 0xff}, // rgb(0, 128, 128) + "thistle": color.RGBA{0xd8, 0xbf, 0xd8, 0xff}, // rgb(216, 191, 216) + "tomato": color.RGBA{0xff, 0x63, 0x47, 0xff}, // rgb(255, 99, 71) + "turquoise": color.RGBA{0x40, 0xe0, 0xd0, 0xff}, // rgb(64, 224, 208) + "violet": color.RGBA{0xee, 0x82, 0xee, 0xff}, // rgb(238, 130, 238) + "wheat": color.RGBA{0xf5, 0xde, 0xb3, 0xff}, // rgb(245, 222, 179) + "white": color.RGBA{0xff, 0xff, 0xff, 0xff}, // rgb(255, 255, 255) + "whitesmoke": color.RGBA{0xf5, 0xf5, 0xf5, 0xff}, // rgb(245, 245, 245) + "yellow": color.RGBA{0xff, 0xff, 0x00, 0xff}, // rgb(255, 255, 0) + "yellowgreen": color.RGBA{0x9a, 0xcd, 0x32, 0xff}, // rgb(154, 205, 50) +} + +// Names contains the color names defined in the SVG 1.1 spec. +var Names = []string{ + "aliceblue", + "antiquewhite", + "aqua", + "aquamarine", + "azure", + "beige", + "bisque", + "black", + "blanchedalmond", + "blue", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "fuchsia", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "gray", + "green", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "lime", + "limegreen", + "linen", + "magenta", + "maroon", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "navy", + "oldlace", + "olive", + "olivedrab", + "orange", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "purple", + "red", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "silver", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "teal", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "white", + "whitesmoke", + "yellow", + "yellowgreen", +} + +var ( + Aliceblue = color.RGBA{0xf0, 0xf8, 0xff, 0xff} // rgb(240, 248, 255) + Antiquewhite = color.RGBA{0xfa, 0xeb, 0xd7, 0xff} // rgb(250, 235, 215) + Aqua = color.RGBA{0x00, 0xff, 0xff, 0xff} // rgb(0, 255, 255) + Aquamarine = color.RGBA{0x7f, 0xff, 0xd4, 0xff} // rgb(127, 255, 212) + Azure = color.RGBA{0xf0, 0xff, 0xff, 0xff} // rgb(240, 255, 255) + Beige = color.RGBA{0xf5, 0xf5, 0xdc, 0xff} // rgb(245, 245, 220) + Bisque = color.RGBA{0xff, 0xe4, 0xc4, 0xff} // rgb(255, 228, 196) + Black = color.RGBA{0x00, 0x00, 0x00, 0xff} // rgb(0, 0, 0) + Blanchedalmond = color.RGBA{0xff, 0xeb, 0xcd, 0xff} // rgb(255, 235, 205) + Blue = color.RGBA{0x00, 0x00, 0xff, 0xff} // rgb(0, 0, 255) + Blueviolet = color.RGBA{0x8a, 0x2b, 0xe2, 0xff} // rgb(138, 43, 226) + Brown = color.RGBA{0xa5, 0x2a, 0x2a, 0xff} // rgb(165, 42, 42) + Burlywood = color.RGBA{0xde, 0xb8, 0x87, 0xff} // rgb(222, 184, 135) + Cadetblue = color.RGBA{0x5f, 0x9e, 0xa0, 0xff} // rgb(95, 158, 160) + Chartreuse = color.RGBA{0x7f, 0xff, 0x00, 0xff} // rgb(127, 255, 0) + Chocolate = color.RGBA{0xd2, 0x69, 0x1e, 0xff} // rgb(210, 105, 30) + Coral = color.RGBA{0xff, 0x7f, 0x50, 0xff} // rgb(255, 127, 80) + Cornflowerblue = color.RGBA{0x64, 0x95, 0xed, 0xff} // rgb(100, 149, 237) + Cornsilk = color.RGBA{0xff, 0xf8, 0xdc, 0xff} // rgb(255, 248, 220) + Crimson = color.RGBA{0xdc, 0x14, 0x3c, 0xff} // rgb(220, 20, 60) + Cyan = color.RGBA{0x00, 0xff, 0xff, 0xff} // rgb(0, 255, 255) + Darkblue = color.RGBA{0x00, 0x00, 0x8b, 0xff} // rgb(0, 0, 139) + Darkcyan = color.RGBA{0x00, 0x8b, 0x8b, 0xff} // rgb(0, 139, 139) + Darkgoldenrod = color.RGBA{0xb8, 0x86, 0x0b, 0xff} // rgb(184, 134, 11) + Darkgray = color.RGBA{0xa9, 0xa9, 0xa9, 0xff} // rgb(169, 169, 169) + Darkgreen = color.RGBA{0x00, 0x64, 0x00, 0xff} // rgb(0, 100, 0) + Darkgrey = color.RGBA{0xa9, 0xa9, 0xa9, 0xff} // rgb(169, 169, 169) + Darkkhaki = color.RGBA{0xbd, 0xb7, 0x6b, 0xff} // rgb(189, 183, 107) + Darkmagenta = color.RGBA{0x8b, 0x00, 0x8b, 0xff} // rgb(139, 0, 139) + Darkolivegreen = color.RGBA{0x55, 0x6b, 0x2f, 0xff} // rgb(85, 107, 47) + Darkorange = color.RGBA{0xff, 0x8c, 0x00, 0xff} // rgb(255, 140, 0) + Darkorchid = color.RGBA{0x99, 0x32, 0xcc, 0xff} // rgb(153, 50, 204) + Darkred = color.RGBA{0x8b, 0x00, 0x00, 0xff} // rgb(139, 0, 0) + Darksalmon = color.RGBA{0xe9, 0x96, 0x7a, 0xff} // rgb(233, 150, 122) + Darkseagreen = color.RGBA{0x8f, 0xbc, 0x8f, 0xff} // rgb(143, 188, 143) + Darkslateblue = color.RGBA{0x48, 0x3d, 0x8b, 0xff} // rgb(72, 61, 139) + Darkslategray = color.RGBA{0x2f, 0x4f, 0x4f, 0xff} // rgb(47, 79, 79) + Darkslategrey = color.RGBA{0x2f, 0x4f, 0x4f, 0xff} // rgb(47, 79, 79) + Darkturquoise = color.RGBA{0x00, 0xce, 0xd1, 0xff} // rgb(0, 206, 209) + Darkviolet = color.RGBA{0x94, 0x00, 0xd3, 0xff} // rgb(148, 0, 211) + Deeppink = color.RGBA{0xff, 0x14, 0x93, 0xff} // rgb(255, 20, 147) + Deepskyblue = color.RGBA{0x00, 0xbf, 0xff, 0xff} // rgb(0, 191, 255) + Dimgray = color.RGBA{0x69, 0x69, 0x69, 0xff} // rgb(105, 105, 105) + Dimgrey = color.RGBA{0x69, 0x69, 0x69, 0xff} // rgb(105, 105, 105) + Dodgerblue = color.RGBA{0x1e, 0x90, 0xff, 0xff} // rgb(30, 144, 255) + Firebrick = color.RGBA{0xb2, 0x22, 0x22, 0xff} // rgb(178, 34, 34) + Floralwhite = color.RGBA{0xff, 0xfa, 0xf0, 0xff} // rgb(255, 250, 240) + Forestgreen = color.RGBA{0x22, 0x8b, 0x22, 0xff} // rgb(34, 139, 34) + Fuchsia = color.RGBA{0xff, 0x00, 0xff, 0xff} // rgb(255, 0, 255) + Gainsboro = color.RGBA{0xdc, 0xdc, 0xdc, 0xff} // rgb(220, 220, 220) + Ghostwhite = color.RGBA{0xf8, 0xf8, 0xff, 0xff} // rgb(248, 248, 255) + Gold = color.RGBA{0xff, 0xd7, 0x00, 0xff} // rgb(255, 215, 0) + Goldenrod = color.RGBA{0xda, 0xa5, 0x20, 0xff} // rgb(218, 165, 32) + Gray = color.RGBA{0x80, 0x80, 0x80, 0xff} // rgb(128, 128, 128) + Green = color.RGBA{0x00, 0x80, 0x00, 0xff} // rgb(0, 128, 0) + Greenyellow = color.RGBA{0xad, 0xff, 0x2f, 0xff} // rgb(173, 255, 47) + Grey = color.RGBA{0x80, 0x80, 0x80, 0xff} // rgb(128, 128, 128) + Honeydew = color.RGBA{0xf0, 0xff, 0xf0, 0xff} // rgb(240, 255, 240) + Hotpink = color.RGBA{0xff, 0x69, 0xb4, 0xff} // rgb(255, 105, 180) + Indianred = color.RGBA{0xcd, 0x5c, 0x5c, 0xff} // rgb(205, 92, 92) + Indigo = color.RGBA{0x4b, 0x00, 0x82, 0xff} // rgb(75, 0, 130) + Ivory = color.RGBA{0xff, 0xff, 0xf0, 0xff} // rgb(255, 255, 240) + Khaki = color.RGBA{0xf0, 0xe6, 0x8c, 0xff} // rgb(240, 230, 140) + Lavender = color.RGBA{0xe6, 0xe6, 0xfa, 0xff} // rgb(230, 230, 250) + Lavenderblush = color.RGBA{0xff, 0xf0, 0xf5, 0xff} // rgb(255, 240, 245) + Lawngreen = color.RGBA{0x7c, 0xfc, 0x00, 0xff} // rgb(124, 252, 0) + Lemonchiffon = color.RGBA{0xff, 0xfa, 0xcd, 0xff} // rgb(255, 250, 205) + Lightblue = color.RGBA{0xad, 0xd8, 0xe6, 0xff} // rgb(173, 216, 230) + Lightcoral = color.RGBA{0xf0, 0x80, 0x80, 0xff} // rgb(240, 128, 128) + Lightcyan = color.RGBA{0xe0, 0xff, 0xff, 0xff} // rgb(224, 255, 255) + Lightgoldenrodyellow = color.RGBA{0xfa, 0xfa, 0xd2, 0xff} // rgb(250, 250, 210) + Lightgray = color.RGBA{0xd3, 0xd3, 0xd3, 0xff} // rgb(211, 211, 211) + Lightgreen = color.RGBA{0x90, 0xee, 0x90, 0xff} // rgb(144, 238, 144) + Lightgrey = color.RGBA{0xd3, 0xd3, 0xd3, 0xff} // rgb(211, 211, 211) + Lightpink = color.RGBA{0xff, 0xb6, 0xc1, 0xff} // rgb(255, 182, 193) + Lightsalmon = color.RGBA{0xff, 0xa0, 0x7a, 0xff} // rgb(255, 160, 122) + Lightseagreen = color.RGBA{0x20, 0xb2, 0xaa, 0xff} // rgb(32, 178, 170) + Lightskyblue = color.RGBA{0x87, 0xce, 0xfa, 0xff} // rgb(135, 206, 250) + Lightslategray = color.RGBA{0x77, 0x88, 0x99, 0xff} // rgb(119, 136, 153) + Lightslategrey = color.RGBA{0x77, 0x88, 0x99, 0xff} // rgb(119, 136, 153) + Lightsteelblue = color.RGBA{0xb0, 0xc4, 0xde, 0xff} // rgb(176, 196, 222) + Lightyellow = color.RGBA{0xff, 0xff, 0xe0, 0xff} // rgb(255, 255, 224) + Lime = color.RGBA{0x00, 0xff, 0x00, 0xff} // rgb(0, 255, 0) + Limegreen = color.RGBA{0x32, 0xcd, 0x32, 0xff} // rgb(50, 205, 50) + Linen = color.RGBA{0xfa, 0xf0, 0xe6, 0xff} // rgb(250, 240, 230) + Magenta = color.RGBA{0xff, 0x00, 0xff, 0xff} // rgb(255, 0, 255) + Maroon = color.RGBA{0x80, 0x00, 0x00, 0xff} // rgb(128, 0, 0) + Mediumaquamarine = color.RGBA{0x66, 0xcd, 0xaa, 0xff} // rgb(102, 205, 170) + Mediumblue = color.RGBA{0x00, 0x00, 0xcd, 0xff} // rgb(0, 0, 205) + Mediumorchid = color.RGBA{0xba, 0x55, 0xd3, 0xff} // rgb(186, 85, 211) + Mediumpurple = color.RGBA{0x93, 0x70, 0xdb, 0xff} // rgb(147, 112, 219) + Mediumseagreen = color.RGBA{0x3c, 0xb3, 0x71, 0xff} // rgb(60, 179, 113) + Mediumslateblue = color.RGBA{0x7b, 0x68, 0xee, 0xff} // rgb(123, 104, 238) + Mediumspringgreen = color.RGBA{0x00, 0xfa, 0x9a, 0xff} // rgb(0, 250, 154) + Mediumturquoise = color.RGBA{0x48, 0xd1, 0xcc, 0xff} // rgb(72, 209, 204) + Mediumvioletred = color.RGBA{0xc7, 0x15, 0x85, 0xff} // rgb(199, 21, 133) + Midnightblue = color.RGBA{0x19, 0x19, 0x70, 0xff} // rgb(25, 25, 112) + Mintcream = color.RGBA{0xf5, 0xff, 0xfa, 0xff} // rgb(245, 255, 250) + Mistyrose = color.RGBA{0xff, 0xe4, 0xe1, 0xff} // rgb(255, 228, 225) + Moccasin = color.RGBA{0xff, 0xe4, 0xb5, 0xff} // rgb(255, 228, 181) + Navajowhite = color.RGBA{0xff, 0xde, 0xad, 0xff} // rgb(255, 222, 173) + Navy = color.RGBA{0x00, 0x00, 0x80, 0xff} // rgb(0, 0, 128) + Oldlace = color.RGBA{0xfd, 0xf5, 0xe6, 0xff} // rgb(253, 245, 230) + Olive = color.RGBA{0x80, 0x80, 0x00, 0xff} // rgb(128, 128, 0) + Olivedrab = color.RGBA{0x6b, 0x8e, 0x23, 0xff} // rgb(107, 142, 35) + Orange = color.RGBA{0xff, 0xa5, 0x00, 0xff} // rgb(255, 165, 0) + Orangered = color.RGBA{0xff, 0x45, 0x00, 0xff} // rgb(255, 69, 0) + Orchid = color.RGBA{0xda, 0x70, 0xd6, 0xff} // rgb(218, 112, 214) + Palegoldenrod = color.RGBA{0xee, 0xe8, 0xaa, 0xff} // rgb(238, 232, 170) + Palegreen = color.RGBA{0x98, 0xfb, 0x98, 0xff} // rgb(152, 251, 152) + Paleturquoise = color.RGBA{0xaf, 0xee, 0xee, 0xff} // rgb(175, 238, 238) + Palevioletred = color.RGBA{0xdb, 0x70, 0x93, 0xff} // rgb(219, 112, 147) + Papayawhip = color.RGBA{0xff, 0xef, 0xd5, 0xff} // rgb(255, 239, 213) + Peachpuff = color.RGBA{0xff, 0xda, 0xb9, 0xff} // rgb(255, 218, 185) + Peru = color.RGBA{0xcd, 0x85, 0x3f, 0xff} // rgb(205, 133, 63) + Pink = color.RGBA{0xff, 0xc0, 0xcb, 0xff} // rgb(255, 192, 203) + Plum = color.RGBA{0xdd, 0xa0, 0xdd, 0xff} // rgb(221, 160, 221) + Powderblue = color.RGBA{0xb0, 0xe0, 0xe6, 0xff} // rgb(176, 224, 230) + Purple = color.RGBA{0x80, 0x00, 0x80, 0xff} // rgb(128, 0, 128) + Red = color.RGBA{0xff, 0x00, 0x00, 0xff} // rgb(255, 0, 0) + Rosybrown = color.RGBA{0xbc, 0x8f, 0x8f, 0xff} // rgb(188, 143, 143) + Royalblue = color.RGBA{0x41, 0x69, 0xe1, 0xff} // rgb(65, 105, 225) + Saddlebrown = color.RGBA{0x8b, 0x45, 0x13, 0xff} // rgb(139, 69, 19) + Salmon = color.RGBA{0xfa, 0x80, 0x72, 0xff} // rgb(250, 128, 114) + Sandybrown = color.RGBA{0xf4, 0xa4, 0x60, 0xff} // rgb(244, 164, 96) + Seagreen = color.RGBA{0x2e, 0x8b, 0x57, 0xff} // rgb(46, 139, 87) + Seashell = color.RGBA{0xff, 0xf5, 0xee, 0xff} // rgb(255, 245, 238) + Sienna = color.RGBA{0xa0, 0x52, 0x2d, 0xff} // rgb(160, 82, 45) + Silver = color.RGBA{0xc0, 0xc0, 0xc0, 0xff} // rgb(192, 192, 192) + Skyblue = color.RGBA{0x87, 0xce, 0xeb, 0xff} // rgb(135, 206, 235) + Slateblue = color.RGBA{0x6a, 0x5a, 0xcd, 0xff} // rgb(106, 90, 205) + Slategray = color.RGBA{0x70, 0x80, 0x90, 0xff} // rgb(112, 128, 144) + Slategrey = color.RGBA{0x70, 0x80, 0x90, 0xff} // rgb(112, 128, 144) + Snow = color.RGBA{0xff, 0xfa, 0xfa, 0xff} // rgb(255, 250, 250) + Springgreen = color.RGBA{0x00, 0xff, 0x7f, 0xff} // rgb(0, 255, 127) + Steelblue = color.RGBA{0x46, 0x82, 0xb4, 0xff} // rgb(70, 130, 180) + Tan = color.RGBA{0xd2, 0xb4, 0x8c, 0xff} // rgb(210, 180, 140) + Teal = color.RGBA{0x00, 0x80, 0x80, 0xff} // rgb(0, 128, 128) + Thistle = color.RGBA{0xd8, 0xbf, 0xd8, 0xff} // rgb(216, 191, 216) + Tomato = color.RGBA{0xff, 0x63, 0x47, 0xff} // rgb(255, 99, 71) + Turquoise = color.RGBA{0x40, 0xe0, 0xd0, 0xff} // rgb(64, 224, 208) + Violet = color.RGBA{0xee, 0x82, 0xee, 0xff} // rgb(238, 130, 238) + Wheat = color.RGBA{0xf5, 0xde, 0xb3, 0xff} // rgb(245, 222, 179) + White = color.RGBA{0xff, 0xff, 0xff, 0xff} // rgb(255, 255, 255) + Whitesmoke = color.RGBA{0xf5, 0xf5, 0xf5, 0xff} // rgb(245, 245, 245) + Yellow = color.RGBA{0xff, 0xff, 0x00, 0xff} // rgb(255, 255, 0) + Yellowgreen = color.RGBA{0x9a, 0xcd, 0x32, 0xff} // rgb(154, 205, 50) +) diff --git a/vendor/golang.org/x/image/math/f32/f32.go b/vendor/golang.org/x/image/math/f32/f32.go new file mode 100644 index 0000000..4ca1eb4 --- /dev/null +++ b/vendor/golang.org/x/image/math/f32/f32.go @@ -0,0 +1,37 @@ +// Copyright 2015 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 f32 implements float32 vector and matrix types. +package f32 // import "golang.org/x/image/math/f32" + +// Vec2 is a 2-element vector. +type Vec2 [2]float32 + +// Vec3 is a 3-element vector. +type Vec3 [3]float32 + +// Vec4 is a 4-element vector. +type Vec4 [4]float32 + +// Mat3 is a 3x3 matrix in row major order. +// +// m[3*r + c] is the element in the r'th row and c'th column. +type Mat3 [9]float32 + +// Mat4 is a 4x4 matrix in row major order. +// +// m[4*r + c] is the element in the r'th row and c'th column. +type Mat4 [16]float32 + +// Aff3 is a 3x3 affine transformation matrix in row major order, where the +// bottom row is implicitly [0 0 1]. +// +// m[3*r + c] is the element in the r'th row and c'th column. +type Aff3 [6]float32 + +// Aff4 is a 4x4 affine transformation matrix in row major order, where the +// bottom row is implicitly [0 0 0 1]. +// +// m[4*r + c] is the element in the r'th row and c'th column. +type Aff4 [12]float32 diff --git a/vendor/golang.org/x/net/AUTHORS b/vendor/golang.org/x/net/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/net/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/net/CONTRIBUTORS b/vendor/golang.org/x/net/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/net/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/vendor/golang.org/x/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/net/PATENTS b/vendor/golang.org/x/net/PATENTS new file mode 100644 index 0000000..7330990 --- /dev/null +++ b/vendor/golang.org/x/net/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/net/html/atom/atom.go b/vendor/golang.org/x/net/html/atom/atom.go new file mode 100644 index 0000000..cd0a8ac --- /dev/null +++ b/vendor/golang.org/x/net/html/atom/atom.go @@ -0,0 +1,78 @@ +// Copyright 2012 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 atom provides integer codes (also known as atoms) for a fixed set of +// frequently occurring HTML strings: tag names and attribute keys such as "p" +// and "id". +// +// Sharing an atom's name between all elements with the same tag can result in +// fewer string allocations when tokenizing and parsing HTML. Integer +// comparisons are also generally faster than string comparisons. +// +// The value of an atom's particular code is not guaranteed to stay the same +// between versions of this package. Neither is any ordering guaranteed: +// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to +// be dense. The only guarantees are that e.g. looking up "div" will yield +// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0. +package atom // import "golang.org/x/net/html/atom" + +// Atom is an integer code for a string. The zero value maps to "". +type Atom uint32 + +// String returns the atom's name. +func (a Atom) String() string { + start := uint32(a >> 8) + n := uint32(a & 0xff) + if start+n > uint32(len(atomText)) { + return "" + } + return atomText[start : start+n] +} + +func (a Atom) string() string { + return atomText[a>>8 : a>>8+a&0xff] +} + +// fnv computes the FNV hash with an arbitrary starting value h. +func fnv(h uint32, s []byte) uint32 { + for i := range s { + h ^= uint32(s[i]) + h *= 16777619 + } + return h +} + +func match(s string, t []byte) bool { + for i, c := range t { + if s[i] != c { + return false + } + } + return true +} + +// Lookup returns the atom whose name is s. It returns zero if there is no +// such atom. The lookup is case sensitive. +func Lookup(s []byte) Atom { + if len(s) == 0 || len(s) > maxAtomLen { + return 0 + } + h := fnv(hash0, s) + if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { + return a + } + if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { + return a + } + return 0 +} + +// String returns a string whose contents are equal to s. In that sense, it is +// equivalent to string(s) but may be more efficient. +func String(s []byte) string { + if a := Lookup(s); a != 0 { + return a.String() + } + return string(s) +} diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go new file mode 100644 index 0000000..56cd842 --- /dev/null +++ b/vendor/golang.org/x/net/html/atom/gen.go @@ -0,0 +1,710 @@ +// Copyright 2012 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 ignore + +//go:generate go run gen.go +//go:generate go run gen.go -test + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "io/ioutil" + "math/rand" + "os" + "sort" + "strings" +) + +// identifier converts s to a Go exported identifier. +// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". +func identifier(s string) string { + b := make([]byte, 0, len(s)) + cap := true + for _, c := range s { + if c == '-' { + cap = true + continue + } + if cap && 'a' <= c && c <= 'z' { + c -= 'a' - 'A' + } + cap = false + b = append(b, byte(c)) + } + return string(b) +} + +var test = flag.Bool("test", false, "generate table_test.go") + +func genFile(name string, buf *bytes.Buffer) { + b, err := format.Source(buf.Bytes()) + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + if err := ioutil.WriteFile(name, b, 0644); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func main() { + flag.Parse() + + var all []string + all = append(all, elements...) + all = append(all, attributes...) + all = append(all, eventHandlers...) + all = append(all, extra...) + sort.Strings(all) + + // uniq - lists have dups + w := 0 + for _, s := range all { + if w == 0 || all[w-1] != s { + all[w] = s + w++ + } + } + all = all[:w] + + if *test { + var buf bytes.Buffer + fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") + fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") + fmt.Fprintln(&buf, "package atom\n") + fmt.Fprintln(&buf, "var testAtomList = []string{") + for _, s := range all { + fmt.Fprintf(&buf, "\t%q,\n", s) + } + fmt.Fprintln(&buf, "}") + + genFile("table_test.go", &buf) + return + } + + // Find hash that minimizes table size. + var best *table + for i := 0; i < 1000000; i++ { + if best != nil && 1<<(best.k-1) < len(all) { + break + } + h := rand.Uint32() + for k := uint(0); k <= 16; k++ { + if best != nil && k >= best.k { + break + } + var t table + if t.init(h, k, all) { + best = &t + break + } + } + } + if best == nil { + fmt.Fprintf(os.Stderr, "failed to construct string table\n") + os.Exit(1) + } + + // Lay out strings, using overlaps when possible. + layout := append([]string{}, all...) + + // Remove strings that are substrings of other strings + for changed := true; changed; { + changed = false + for i, s := range layout { + if s == "" { + continue + } + for j, t := range layout { + if i != j && t != "" && strings.Contains(s, t) { + changed = true + layout[j] = "" + } + } + } + } + + // Join strings where one suffix matches another prefix. + for { + // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], + // maximizing overlap length k. + besti := -1 + bestj := -1 + bestk := 0 + for i, s := range layout { + if s == "" { + continue + } + for j, t := range layout { + if i == j { + continue + } + for k := bestk + 1; k <= len(s) && k <= len(t); k++ { + if s[len(s)-k:] == t[:k] { + besti = i + bestj = j + bestk = k + } + } + } + } + if bestk > 0 { + layout[besti] += layout[bestj][bestk:] + layout[bestj] = "" + continue + } + break + } + + text := strings.Join(layout, "") + + atom := map[string]uint32{} + for _, s := range all { + off := strings.Index(text, s) + if off < 0 { + panic("lost string " + s) + } + atom[s] = uint32(off<<8 | len(s)) + } + + var buf bytes.Buffer + // Generate the Go code. + fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") + fmt.Fprintln(&buf, "//go:generate go run gen.go\n") + fmt.Fprintln(&buf, "package atom\n\nconst (") + + // compute max len + maxLen := 0 + for _, s := range all { + if maxLen < len(s) { + maxLen = len(s) + } + fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) + } + fmt.Fprintln(&buf, ")\n") + + fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) + fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) + + fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) + for i, s := range best.tab { + if s == "" { + continue + } + fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) + } + fmt.Fprintf(&buf, "}\n") + datasize := (1 << best.k) * 4 + + fmt.Fprintln(&buf, "const atomText =") + textsize := len(text) + for len(text) > 60 { + fmt.Fprintf(&buf, "\t%q +\n", text[:60]) + text = text[60:] + } + fmt.Fprintf(&buf, "\t%q\n\n", text) + + genFile("table.go", &buf) + + fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) +} + +type byLen []string + +func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } +func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x byLen) Len() int { return len(x) } + +// fnv computes the FNV hash with an arbitrary starting value h. +func fnv(h uint32, s string) uint32 { + for i := 0; i < len(s); i++ { + h ^= uint32(s[i]) + h *= 16777619 + } + return h +} + +// A table represents an attempt at constructing the lookup table. +// The lookup table uses cuckoo hashing, meaning that each string +// can be found in one of two positions. +type table struct { + h0 uint32 + k uint + mask uint32 + tab []string +} + +// hash returns the two hashes for s. +func (t *table) hash(s string) (h1, h2 uint32) { + h := fnv(t.h0, s) + h1 = h & t.mask + h2 = (h >> 16) & t.mask + return +} + +// init initializes the table with the given parameters. +// h0 is the initial hash value, +// k is the number of bits of hash value to use, and +// x is the list of strings to store in the table. +// init returns false if the table cannot be constructed. +func (t *table) init(h0 uint32, k uint, x []string) bool { + t.h0 = h0 + t.k = k + t.tab = make([]string, 1< len(t.tab) { + return false + } + s := t.tab[i] + h1, h2 := t.hash(s) + j := h1 + h2 - i + if t.tab[j] != "" && !t.push(j, depth+1) { + return false + } + t.tab[j] = s + return true +} + +// The lists of element names and attribute keys were taken from +// https://html.spec.whatwg.org/multipage/indices.html#index +// as of the "HTML Living Standard - Last Updated 18 September 2017" version. + +// "command", "keygen" and "menuitem" have been removed from the spec, +// but are kept here for backwards compatibility. +var elements = []string{ + "a", + "abbr", + "address", + "area", + "article", + "aside", + "audio", + "b", + "base", + "bdi", + "bdo", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "cite", + "code", + "col", + "colgroup", + "command", + "data", + "datalist", + "dd", + "del", + "details", + "dfn", + "dialog", + "div", + "dl", + "dt", + "em", + "embed", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "keygen", + "label", + "legend", + "li", + "link", + "main", + "map", + "mark", + "menu", + "menuitem", + "meta", + "meter", + "nav", + "noscript", + "object", + "ol", + "optgroup", + "option", + "output", + "p", + "param", + "picture", + "pre", + "progress", + "q", + "rp", + "rt", + "ruby", + "s", + "samp", + "script", + "section", + "select", + "slot", + "small", + "source", + "span", + "strong", + "style", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "title", + "tr", + "track", + "u", + "ul", + "var", + "video", + "wbr", +} + +// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 +// +// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", +// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, +// but are kept here for backwards compatibility. +var attributes = []string{ + "abbr", + "accept", + "accept-charset", + "accesskey", + "action", + "allowfullscreen", + "allowpaymentrequest", + "allowusermedia", + "alt", + "as", + "async", + "autocomplete", + "autofocus", + "autoplay", + "challenge", + "charset", + "checked", + "cite", + "class", + "color", + "cols", + "colspan", + "command", + "content", + "contenteditable", + "contextmenu", + "controls", + "coords", + "crossorigin", + "data", + "datetime", + "default", + "defer", + "dir", + "dirname", + "disabled", + "download", + "draggable", + "dropzone", + "enctype", + "for", + "form", + "formaction", + "formenctype", + "formmethod", + "formnovalidate", + "formtarget", + "headers", + "height", + "hidden", + "high", + "href", + "hreflang", + "http-equiv", + "icon", + "id", + "inputmode", + "integrity", + "is", + "ismap", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "keytype", + "kind", + "label", + "lang", + "list", + "loop", + "low", + "manifest", + "max", + "maxlength", + "media", + "mediagroup", + "method", + "min", + "minlength", + "multiple", + "muted", + "name", + "nomodule", + "nonce", + "novalidate", + "open", + "optimum", + "pattern", + "ping", + "placeholder", + "playsinline", + "poster", + "preload", + "radiogroup", + "readonly", + "referrerpolicy", + "rel", + "required", + "reversed", + "rows", + "rowspan", + "sandbox", + "spellcheck", + "scope", + "scoped", + "seamless", + "selected", + "shape", + "size", + "sizes", + "sortable", + "sorted", + "slot", + "span", + "spellcheck", + "src", + "srcdoc", + "srclang", + "srcset", + "start", + "step", + "style", + "tabindex", + "target", + "title", + "translate", + "type", + "typemustmatch", + "updateviacache", + "usemap", + "value", + "width", + "workertype", + "wrap", +} + +// "onautocomplete", "onautocompleteerror", "onmousewheel", +// "onshow" and "onsort" have been removed from the spec, +// but are kept here for backwards compatibility. +var eventHandlers = []string{ + "onabort", + "onautocomplete", + "onautocompleteerror", + "onauxclick", + "onafterprint", + "onbeforeprint", + "onbeforeunload", + "onblur", + "oncancel", + "oncanplay", + "oncanplaythrough", + "onchange", + "onclick", + "onclose", + "oncontextmenu", + "oncopy", + "oncuechange", + "oncut", + "ondblclick", + "ondrag", + "ondragend", + "ondragenter", + "ondragexit", + "ondragleave", + "ondragover", + "ondragstart", + "ondrop", + "ondurationchange", + "onemptied", + "onended", + "onerror", + "onfocus", + "onhashchange", + "oninput", + "oninvalid", + "onkeydown", + "onkeypress", + "onkeyup", + "onlanguagechange", + "onload", + "onloadeddata", + "onloadedmetadata", + "onloadend", + "onloadstart", + "onmessage", + "onmessageerror", + "onmousedown", + "onmouseenter", + "onmouseleave", + "onmousemove", + "onmouseout", + "onmouseover", + "onmouseup", + "onmousewheel", + "onwheel", + "onoffline", + "ononline", + "onpagehide", + "onpageshow", + "onpaste", + "onpause", + "onplay", + "onplaying", + "onpopstate", + "onprogress", + "onratechange", + "onreset", + "onresize", + "onrejectionhandled", + "onscroll", + "onsecuritypolicyviolation", + "onseeked", + "onseeking", + "onselect", + "onshow", + "onsort", + "onstalled", + "onstorage", + "onsubmit", + "onsuspend", + "ontimeupdate", + "ontoggle", + "onunhandledrejection", + "onunload", + "onvolumechange", + "onwaiting", +} + +// extra are ad-hoc values not covered by any of the lists above. +var extra = []string{ + "acronym", + "align", + "annotation", + "annotation-xml", + "applet", + "basefont", + "bgsound", + "big", + "blink", + "center", + "color", + "desc", + "face", + "font", + "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. + "foreignobject", + "frame", + "frameset", + "image", + "isindex", + "listing", + "malignmark", + "marquee", + "math", + "mglyph", + "mi", + "mn", + "mo", + "ms", + "mtext", + "nobr", + "noembed", + "noframes", + "plaintext", + "prompt", + "public", + "spacer", + "strike", + "svg", + "system", + "tt", + "xmp", +} diff --git a/vendor/golang.org/x/net/html/atom/table.go b/vendor/golang.org/x/net/html/atom/table.go new file mode 100644 index 0000000..a91bd64 --- /dev/null +++ b/vendor/golang.org/x/net/html/atom/table.go @@ -0,0 +1,779 @@ +// Code generated by go generate gen.go; DO NOT EDIT. + +//go:generate go run gen.go + +package atom + +const ( + A Atom = 0x1 + Abbr Atom = 0x4 + Accept Atom = 0x1a06 + AcceptCharset Atom = 0x1a0e + Accesskey Atom = 0x2c09 + Acronym Atom = 0x6907 + Action Atom = 0x26a06 + Address Atom = 0x6f307 + Align Atom = 0x7005 + Allowfullscreen Atom = 0x2000f + Allowpaymentrequest Atom = 0x8013 + Allowusermedia Atom = 0x9c0e + Alt Atom = 0xc703 + Annotation Atom = 0x1c90a + AnnotationXml Atom = 0x1c90e + Applet Atom = 0x31106 + Area Atom = 0x34e04 + Article Atom = 0x3f407 + As Atom = 0xd002 + Aside Atom = 0xd805 + Async Atom = 0xd005 + Audio Atom = 0xe605 + Autocomplete Atom = 0x2700c + Autofocus Atom = 0x10209 + Autoplay Atom = 0x11d08 + B Atom = 0x101 + Base Atom = 0x12c04 + Basefont Atom = 0x12c08 + Bdi Atom = 0x7903 + Bdo Atom = 0x14b03 + Bgsound Atom = 0x15e07 + Big Atom = 0x17003 + Blink Atom = 0x17305 + Blockquote Atom = 0x1870a + Body Atom = 0x2804 + Br Atom = 0x202 + Button Atom = 0x19106 + Canvas Atom = 0xd406 + Caption Atom = 0x22907 + Center Atom = 0x21806 + Challenge Atom = 0x29309 + Charset Atom = 0x2107 + Checked Atom = 0x47107 + Cite Atom = 0x55c04 + Class Atom = 0x5bd05 + Code Atom = 0x1a004 + Col Atom = 0x1a703 + Colgroup Atom = 0x1a708 + Color Atom = 0x1bf05 + Cols Atom = 0x1c404 + Colspan Atom = 0x1c407 + Command Atom = 0x1d707 + Content Atom = 0x58307 + Contenteditable Atom = 0x5830f + Contextmenu Atom = 0x3780b + Controls Atom = 0x1de08 + Coords Atom = 0x1ea06 + Crossorigin Atom = 0x1f30b + Data Atom = 0x49d04 + Datalist Atom = 0x49d08 + Datetime Atom = 0x2b008 + Dd Atom = 0x2cf02 + Default Atom = 0xdb07 + Defer Atom = 0x1a205 + Del Atom = 0x44a03 + Desc Atom = 0x55904 + Details Atom = 0x4607 + Dfn Atom = 0x5f03 + Dialog Atom = 0x7a06 + Dir Atom = 0xba03 + Dirname Atom = 0xba07 + Disabled Atom = 0x16408 + Div Atom = 0x16b03 + Dl Atom = 0x5e602 + Download Atom = 0x45b08 + Draggable Atom = 0x17a09 + Dropzone Atom = 0x3fd08 + Dt Atom = 0x64b02 + Em Atom = 0x4202 + Embed Atom = 0x4205 + Enctype Atom = 0x28507 + Face Atom = 0x21604 + Fieldset Atom = 0x21e08 + Figcaption Atom = 0x2260a + Figure Atom = 0x24006 + Font Atom = 0x13004 + Footer Atom = 0xca06 + For Atom = 0x24c03 + ForeignObject Atom = 0x24c0d + Foreignobject Atom = 0x2590d + Form Atom = 0x26604 + Formaction Atom = 0x2660a + Formenctype Atom = 0x2810b + Formmethod Atom = 0x29c0a + Formnovalidate Atom = 0x2a60e + Formtarget Atom = 0x2b80a + Frame Atom = 0x5705 + Frameset Atom = 0x5708 + H1 Atom = 0x15c02 + H2 Atom = 0x2d602 + H3 Atom = 0x30502 + H4 Atom = 0x33d02 + H5 Atom = 0x34702 + H6 Atom = 0x64d02 + Head Atom = 0x32904 + Header Atom = 0x32906 + Headers Atom = 0x32907 + Height Atom = 0x14306 + Hgroup Atom = 0x2c206 + Hidden Atom = 0x2cd06 + High Atom = 0x2d304 + Hr Atom = 0x15702 + Href Atom = 0x2d804 + Hreflang Atom = 0x2d808 + Html Atom = 0x14704 + HttpEquiv Atom = 0x2e00a + I Atom = 0x601 + Icon Atom = 0x58204 + Id Atom = 0xda02 + Iframe Atom = 0x2f406 + Image Atom = 0x2fa05 + Img Atom = 0x2ff03 + Input Atom = 0x44305 + Inputmode Atom = 0x44309 + Ins Atom = 0x1fc03 + Integrity Atom = 0x23709 + Is Atom = 0x16502 + Isindex Atom = 0x30707 + Ismap Atom = 0x30e05 + Itemid Atom = 0x38306 + Itemprop Atom = 0x55d08 + Itemref Atom = 0x3c507 + Itemscope Atom = 0x67109 + Itemtype Atom = 0x31708 + Kbd Atom = 0x7803 + Keygen Atom = 0x3206 + Keytype Atom = 0x9507 + Kind Atom = 0x17704 + Label Atom = 0xf105 + Lang Atom = 0x2dc04 + Legend Atom = 0x18106 + Li Atom = 0x7102 + Link Atom = 0x17404 + List Atom = 0x4a104 + Listing Atom = 0x4a107 + Loop Atom = 0xf504 + Low Atom = 0x8203 + Main Atom = 0x1004 + Malignmark Atom = 0x6f0a + Manifest Atom = 0x6d708 + Map Atom = 0x31003 + Mark Atom = 0x7504 + Marquee Atom = 0x31f07 + Math Atom = 0x32604 + Max Atom = 0x33503 + Maxlength Atom = 0x33509 + Media Atom = 0xa505 + Mediagroup Atom = 0xa50a + Menu Atom = 0x37f04 + Menuitem Atom = 0x37f08 + Meta Atom = 0x4b004 + Meter Atom = 0xbf05 + Method Atom = 0x2a006 + Mglyph Atom = 0x30006 + Mi Atom = 0x33f02 + Min Atom = 0x33f03 + Minlength Atom = 0x33f09 + Mn Atom = 0x2a902 + Mo Atom = 0x6302 + Ms Atom = 0x67402 + Mtext Atom = 0x34905 + Multiple Atom = 0x35708 + Muted Atom = 0x35f05 + Name Atom = 0xbd04 + Nav Atom = 0x1303 + Nobr Atom = 0x3704 + Noembed Atom = 0x4007 + Noframes Atom = 0x5508 + Nomodule Atom = 0x6108 + Nonce Atom = 0x56605 + Noscript Atom = 0x20e08 + Novalidate Atom = 0x2aa0a + Object Atom = 0x26006 + Ol Atom = 0x11802 + Onabort Atom = 0x19507 + Onafterprint Atom = 0x22e0c + Onautocomplete Atom = 0x26e0e + Onautocompleteerror Atom = 0x26e13 + Onauxclick Atom = 0x61f0a + Onbeforeprint Atom = 0x69e0d + Onbeforeunload Atom = 0x6e70e + Onblur Atom = 0x5c606 + Oncancel Atom = 0xea08 + Oncanplay Atom = 0x14d09 + Oncanplaythrough Atom = 0x14d10 + Onchange Atom = 0x41308 + Onclick Atom = 0x2ed07 + Onclose Atom = 0x36407 + Oncontextmenu Atom = 0x3760d + Oncopy Atom = 0x38906 + Oncuechange Atom = 0x38f0b + Oncut Atom = 0x39a05 + Ondblclick Atom = 0x39f0a + Ondrag Atom = 0x3a906 + Ondragend Atom = 0x3a909 + Ondragenter Atom = 0x3b20b + Ondragexit Atom = 0x3bd0a + Ondragleave Atom = 0x3d70b + Ondragover Atom = 0x3e20a + Ondragstart Atom = 0x3ec0b + Ondrop Atom = 0x3fb06 + Ondurationchange Atom = 0x40b10 + Onemptied Atom = 0x40209 + Onended Atom = 0x41b07 + Onerror Atom = 0x42207 + Onfocus Atom = 0x42907 + Onhashchange Atom = 0x4350c + Oninput Atom = 0x44107 + Oninvalid Atom = 0x44d09 + Onkeydown Atom = 0x45609 + Onkeypress Atom = 0x4630a + Onkeyup Atom = 0x47807 + Onlanguagechange Atom = 0x48510 + Onload Atom = 0x49506 + Onloadeddata Atom = 0x4950c + Onloadedmetadata Atom = 0x4a810 + Onloadend Atom = 0x4be09 + Onloadstart Atom = 0x4c70b + Onmessage Atom = 0x4d209 + Onmessageerror Atom = 0x4d20e + Onmousedown Atom = 0x4e00b + Onmouseenter Atom = 0x4eb0c + Onmouseleave Atom = 0x4f70c + Onmousemove Atom = 0x5030b + Onmouseout Atom = 0x50e0a + Onmouseover Atom = 0x51b0b + Onmouseup Atom = 0x52609 + Onmousewheel Atom = 0x5340c + Onoffline Atom = 0x54009 + Ononline Atom = 0x54908 + Onpagehide Atom = 0x5510a + Onpageshow Atom = 0x56b0a + Onpaste Atom = 0x57707 + Onpause Atom = 0x59207 + Onplay Atom = 0x59c06 + Onplaying Atom = 0x59c09 + Onpopstate Atom = 0x5a50a + Onprogress Atom = 0x5af0a + Onratechange Atom = 0x5cc0c + Onrejectionhandled Atom = 0x5d812 + Onreset Atom = 0x5ea07 + Onresize Atom = 0x5f108 + Onscroll Atom = 0x60008 + Onsecuritypolicyviolation Atom = 0x60819 + Onseeked Atom = 0x62908 + Onseeking Atom = 0x63109 + Onselect Atom = 0x63a08 + Onshow Atom = 0x64406 + Onsort Atom = 0x64f06 + Onstalled Atom = 0x65909 + Onstorage Atom = 0x66209 + Onsubmit Atom = 0x66b08 + Onsuspend Atom = 0x67b09 + Ontimeupdate Atom = 0x1310c + Ontoggle Atom = 0x68408 + Onunhandledrejection Atom = 0x68c14 + Onunload Atom = 0x6ab08 + Onvolumechange Atom = 0x6b30e + Onwaiting Atom = 0x6c109 + Onwheel Atom = 0x6ca07 + Open Atom = 0x56304 + Optgroup Atom = 0xf708 + Optimum Atom = 0x6d107 + Option Atom = 0x6e306 + Output Atom = 0x51506 + P Atom = 0xc01 + Param Atom = 0xc05 + Pattern Atom = 0x4f07 + Picture Atom = 0xae07 + Ping Atom = 0xfe04 + Placeholder Atom = 0x1120b + Plaintext Atom = 0x1ae09 + Playsinline Atom = 0x1210b + Poster Atom = 0x2c706 + Pre Atom = 0x46803 + Preload Atom = 0x47e07 + Progress Atom = 0x5b108 + Prompt Atom = 0x52e06 + Public Atom = 0x57e06 + Q Atom = 0x8e01 + Radiogroup Atom = 0x30a + Readonly Atom = 0x34f08 + Referrerpolicy Atom = 0x3c90e + Rel Atom = 0x47f03 + Required Atom = 0x24408 + Reversed Atom = 0xb308 + Rows Atom = 0x3a04 + Rowspan Atom = 0x3a07 + Rp Atom = 0x23402 + Rt Atom = 0x19a02 + Ruby Atom = 0xc304 + S Atom = 0x2501 + Samp Atom = 0x4c04 + Sandbox Atom = 0x10a07 + Scope Atom = 0x67505 + Scoped Atom = 0x67506 + Script Atom = 0x21006 + Seamless Atom = 0x36908 + Section Atom = 0x5c107 + Select Atom = 0x63c06 + Selected Atom = 0x63c08 + Shape Atom = 0x1e505 + Size Atom = 0x5f504 + Sizes Atom = 0x5f505 + Slot Atom = 0x1ef04 + Small Atom = 0x1fe05 + Sortable Atom = 0x65108 + Sorted Atom = 0x32f06 + Source Atom = 0x37006 + Spacer Atom = 0x42f06 + Span Atom = 0x3d04 + Spellcheck Atom = 0x46c0a + Src Atom = 0x5b803 + Srcdoc Atom = 0x5b806 + Srclang Atom = 0x5f907 + Srcset Atom = 0x6f906 + Start Atom = 0x3f205 + Step Atom = 0x57b04 + Strike Atom = 0x9106 + Strong Atom = 0x6dd06 + Style Atom = 0x6ff05 + Sub Atom = 0x66d03 + Summary Atom = 0x70407 + Sup Atom = 0x70b03 + Svg Atom = 0x70e03 + System Atom = 0x71106 + Tabindex Atom = 0x4b608 + Table Atom = 0x58d05 + Target Atom = 0x2bc06 + Tbody Atom = 0x2705 + Td Atom = 0x5e02 + Template Atom = 0x71408 + Textarea Atom = 0x34a08 + Tfoot Atom = 0xc905 + Th Atom = 0x15602 + Thead Atom = 0x32805 + Time Atom = 0x13304 + Title Atom = 0xe105 + Tr Atom = 0x8b02 + Track Atom = 0x19b05 + Translate Atom = 0x1b609 + Tt Atom = 0x5102 + Type Atom = 0x9804 + Typemustmatch Atom = 0x2880d + U Atom = 0xb01 + Ul Atom = 0x6602 + Updateviacache Atom = 0x1370e + Usemap Atom = 0x59606 + Value Atom = 0x1505 + Var Atom = 0x16d03 + Video Atom = 0x2e905 + Wbr Atom = 0x57403 + Width Atom = 0x64905 + Workertype Atom = 0x71c0a + Wrap Atom = 0x72604 + Xmp Atom = 0x11003 +) + +const hash0 = 0x81cdf10e + +const maxAtomLen = 25 + +var table = [1 << 9]Atom{ + 0x1: 0xa50a, // mediagroup + 0x2: 0x2dc04, // lang + 0x4: 0x2c09, // accesskey + 0x5: 0x5708, // frameset + 0x7: 0x63a08, // onselect + 0x8: 0x71106, // system + 0xa: 0x64905, // width + 0xc: 0x2810b, // formenctype + 0xd: 0x11802, // ol + 0xe: 0x38f0b, // oncuechange + 0x10: 0x14b03, // bdo + 0x11: 0xe605, // audio + 0x12: 0x17a09, // draggable + 0x14: 0x2e905, // video + 0x15: 0x2a902, // mn + 0x16: 0x37f04, // menu + 0x17: 0x2c706, // poster + 0x19: 0xca06, // footer + 0x1a: 0x2a006, // method + 0x1b: 0x2b008, // datetime + 0x1c: 0x19507, // onabort + 0x1d: 0x1370e, // updateviacache + 0x1e: 0xd005, // async + 0x1f: 0x49506, // onload + 0x21: 0xea08, // oncancel + 0x22: 0x62908, // onseeked + 0x23: 0x2fa05, // image + 0x24: 0x5d812, // onrejectionhandled + 0x26: 0x17404, // link + 0x27: 0x51506, // output + 0x28: 0x32904, // head + 0x29: 0x4f70c, // onmouseleave + 0x2a: 0x57707, // onpaste + 0x2b: 0x59c09, // onplaying + 0x2c: 0x1c407, // colspan + 0x2f: 0x1bf05, // color + 0x30: 0x5f504, // size + 0x31: 0x2e00a, // http-equiv + 0x33: 0x601, // i + 0x34: 0x5510a, // onpagehide + 0x35: 0x68c14, // onunhandledrejection + 0x37: 0x42207, // onerror + 0x3a: 0x12c08, // basefont + 0x3f: 0x1303, // nav + 0x40: 0x17704, // kind + 0x41: 0x34f08, // readonly + 0x42: 0x30006, // mglyph + 0x44: 0x7102, // li + 0x46: 0x2cd06, // hidden + 0x47: 0x70e03, // svg + 0x48: 0x57b04, // step + 0x49: 0x23709, // integrity + 0x4a: 0x57e06, // public + 0x4c: 0x1a703, // col + 0x4d: 0x1870a, // blockquote + 0x4e: 0x34702, // h5 + 0x50: 0x5b108, // progress + 0x51: 0x5f505, // sizes + 0x52: 0x33d02, // h4 + 0x56: 0x32805, // thead + 0x57: 0x9507, // keytype + 0x58: 0x5af0a, // onprogress + 0x59: 0x44309, // inputmode + 0x5a: 0x3a909, // ondragend + 0x5d: 0x39a05, // oncut + 0x5e: 0x42f06, // spacer + 0x5f: 0x1a708, // colgroup + 0x62: 0x16502, // is + 0x65: 0xd002, // as + 0x66: 0x54009, // onoffline + 0x67: 0x32f06, // sorted + 0x69: 0x48510, // onlanguagechange + 0x6c: 0x4350c, // onhashchange + 0x6d: 0xbd04, // name + 0x6e: 0xc905, // tfoot + 0x6f: 0x55904, // desc + 0x70: 0x33503, // max + 0x72: 0x1ea06, // coords + 0x73: 0x30502, // h3 + 0x74: 0x6e70e, // onbeforeunload + 0x75: 0x3a04, // rows + 0x76: 0x63c06, // select + 0x77: 0xbf05, // meter + 0x78: 0x38306, // itemid + 0x79: 0x5340c, // onmousewheel + 0x7a: 0x5b806, // srcdoc + 0x7d: 0x19b05, // track + 0x7f: 0x31708, // itemtype + 0x82: 0x6302, // mo + 0x83: 0x41308, // onchange + 0x84: 0x32907, // headers + 0x85: 0x5cc0c, // onratechange + 0x86: 0x60819, // onsecuritypolicyviolation + 0x88: 0x49d08, // datalist + 0x89: 0x4e00b, // onmousedown + 0x8a: 0x1ef04, // slot + 0x8b: 0x4a810, // onloadedmetadata + 0x8c: 0x1a06, // accept + 0x8d: 0x26006, // object + 0x91: 0x6b30e, // onvolumechange + 0x92: 0x2107, // charset + 0x93: 0x26e13, // onautocompleteerror + 0x94: 0x8013, // allowpaymentrequest + 0x95: 0x2804, // body + 0x96: 0xdb07, // default + 0x97: 0x63c08, // selected + 0x98: 0x21604, // face + 0x99: 0x1e505, // shape + 0x9b: 0x68408, // ontoggle + 0x9e: 0x64b02, // dt + 0x9f: 0x7504, // mark + 0xa1: 0xb01, // u + 0xa4: 0x6ab08, // onunload + 0xa5: 0xf504, // loop + 0xa6: 0x16408, // disabled + 0xaa: 0x41b07, // onended + 0xab: 0x6f0a, // malignmark + 0xad: 0x67b09, // onsuspend + 0xae: 0x34905, // mtext + 0xaf: 0x64f06, // onsort + 0xb0: 0x55d08, // itemprop + 0xb3: 0x67109, // itemscope + 0xb4: 0x17305, // blink + 0xb6: 0x3a906, // ondrag + 0xb7: 0x6602, // ul + 0xb8: 0x26604, // form + 0xb9: 0x10a07, // sandbox + 0xba: 0x5705, // frame + 0xbb: 0x1505, // value + 0xbc: 0x66209, // onstorage + 0xbf: 0x6907, // acronym + 0xc0: 0x19a02, // rt + 0xc2: 0x202, // br + 0xc3: 0x21e08, // fieldset + 0xc4: 0x2880d, // typemustmatch + 0xc5: 0x6108, // nomodule + 0xc6: 0x4007, // noembed + 0xc7: 0x69e0d, // onbeforeprint + 0xc8: 0x19106, // button + 0xc9: 0x2ed07, // onclick + 0xca: 0x70407, // summary + 0xcd: 0xc304, // ruby + 0xce: 0x5bd05, // class + 0xcf: 0x3ec0b, // ondragstart + 0xd0: 0x22907, // caption + 0xd4: 0x9c0e, // allowusermedia + 0xd5: 0x4c70b, // onloadstart + 0xd9: 0x16b03, // div + 0xda: 0x4a104, // list + 0xdb: 0x32604, // math + 0xdc: 0x44305, // input + 0xdf: 0x3e20a, // ondragover + 0xe0: 0x2d602, // h2 + 0xe2: 0x1ae09, // plaintext + 0xe4: 0x4eb0c, // onmouseenter + 0xe7: 0x47107, // checked + 0xe8: 0x46803, // pre + 0xea: 0x35708, // multiple + 0xeb: 0x7903, // bdi + 0xec: 0x33509, // maxlength + 0xed: 0x8e01, // q + 0xee: 0x61f0a, // onauxclick + 0xf0: 0x57403, // wbr + 0xf2: 0x12c04, // base + 0xf3: 0x6e306, // option + 0xf5: 0x40b10, // ondurationchange + 0xf7: 0x5508, // noframes + 0xf9: 0x3fd08, // dropzone + 0xfb: 0x67505, // scope + 0xfc: 0xb308, // reversed + 0xfd: 0x3b20b, // ondragenter + 0xfe: 0x3f205, // start + 0xff: 0x11003, // xmp + 0x100: 0x5f907, // srclang + 0x101: 0x2ff03, // img + 0x104: 0x101, // b + 0x105: 0x24c03, // for + 0x106: 0xd805, // aside + 0x107: 0x44107, // oninput + 0x108: 0x34e04, // area + 0x109: 0x29c0a, // formmethod + 0x10a: 0x72604, // wrap + 0x10c: 0x23402, // rp + 0x10d: 0x4630a, // onkeypress + 0x10e: 0x5102, // tt + 0x110: 0x33f02, // mi + 0x111: 0x35f05, // muted + 0x112: 0xc703, // alt + 0x113: 0x1a004, // code + 0x114: 0x4202, // em + 0x115: 0x3bd0a, // ondragexit + 0x117: 0x3d04, // span + 0x119: 0x6d708, // manifest + 0x11a: 0x37f08, // menuitem + 0x11b: 0x58307, // content + 0x11d: 0x6c109, // onwaiting + 0x11f: 0x4be09, // onloadend + 0x121: 0x3760d, // oncontextmenu + 0x123: 0x5c606, // onblur + 0x124: 0x3f407, // article + 0x125: 0xba03, // dir + 0x126: 0xfe04, // ping + 0x127: 0x24408, // required + 0x128: 0x44d09, // oninvalid + 0x129: 0x7005, // align + 0x12b: 0x58204, // icon + 0x12c: 0x64d02, // h6 + 0x12d: 0x1c404, // cols + 0x12e: 0x2260a, // figcaption + 0x12f: 0x45609, // onkeydown + 0x130: 0x66b08, // onsubmit + 0x131: 0x14d09, // oncanplay + 0x132: 0x70b03, // sup + 0x133: 0xc01, // p + 0x135: 0x40209, // onemptied + 0x136: 0x38906, // oncopy + 0x137: 0x55c04, // cite + 0x138: 0x39f0a, // ondblclick + 0x13a: 0x5030b, // onmousemove + 0x13c: 0x66d03, // sub + 0x13d: 0x47f03, // rel + 0x13e: 0xf708, // optgroup + 0x142: 0x3a07, // rowspan + 0x143: 0x37006, // source + 0x144: 0x20e08, // noscript + 0x145: 0x56304, // open + 0x146: 0x1fc03, // ins + 0x147: 0x24c0d, // foreignObject + 0x148: 0x5a50a, // onpopstate + 0x14a: 0x28507, // enctype + 0x14b: 0x26e0e, // onautocomplete + 0x14c: 0x34a08, // textarea + 0x14e: 0x2700c, // autocomplete + 0x14f: 0x15702, // hr + 0x150: 0x1de08, // controls + 0x151: 0xda02, // id + 0x153: 0x22e0c, // onafterprint + 0x155: 0x2590d, // foreignobject + 0x156: 0x31f07, // marquee + 0x157: 0x59207, // onpause + 0x158: 0x5e602, // dl + 0x159: 0x14306, // height + 0x15a: 0x33f03, // min + 0x15b: 0xba07, // dirname + 0x15c: 0x1b609, // translate + 0x15d: 0x14704, // html + 0x15e: 0x33f09, // minlength + 0x15f: 0x47e07, // preload + 0x160: 0x71408, // template + 0x161: 0x3d70b, // ondragleave + 0x164: 0x5b803, // src + 0x165: 0x6dd06, // strong + 0x167: 0x4c04, // samp + 0x168: 0x6f307, // address + 0x169: 0x54908, // ononline + 0x16b: 0x1120b, // placeholder + 0x16c: 0x2bc06, // target + 0x16d: 0x1fe05, // small + 0x16e: 0x6ca07, // onwheel + 0x16f: 0x1c90a, // annotation + 0x170: 0x46c0a, // spellcheck + 0x171: 0x4607, // details + 0x172: 0xd406, // canvas + 0x173: 0x10209, // autofocus + 0x174: 0xc05, // param + 0x176: 0x45b08, // download + 0x177: 0x44a03, // del + 0x178: 0x36407, // onclose + 0x179: 0x7803, // kbd + 0x17a: 0x31106, // applet + 0x17b: 0x2d804, // href + 0x17c: 0x5f108, // onresize + 0x17e: 0x4950c, // onloadeddata + 0x180: 0x8b02, // tr + 0x181: 0x2b80a, // formtarget + 0x182: 0xe105, // title + 0x183: 0x6ff05, // style + 0x184: 0x9106, // strike + 0x185: 0x59606, // usemap + 0x186: 0x2f406, // iframe + 0x187: 0x1004, // main + 0x189: 0xae07, // picture + 0x18c: 0x30e05, // ismap + 0x18e: 0x49d04, // data + 0x18f: 0xf105, // label + 0x191: 0x3c90e, // referrerpolicy + 0x192: 0x15602, // th + 0x194: 0x52e06, // prompt + 0x195: 0x5c107, // section + 0x197: 0x6d107, // optimum + 0x198: 0x2d304, // high + 0x199: 0x15c02, // h1 + 0x19a: 0x65909, // onstalled + 0x19b: 0x16d03, // var + 0x19c: 0x13304, // time + 0x19e: 0x67402, // ms + 0x19f: 0x32906, // header + 0x1a0: 0x4d209, // onmessage + 0x1a1: 0x56605, // nonce + 0x1a2: 0x2660a, // formaction + 0x1a3: 0x21806, // center + 0x1a4: 0x3704, // nobr + 0x1a5: 0x58d05, // table + 0x1a6: 0x4a107, // listing + 0x1a7: 0x18106, // legend + 0x1a9: 0x29309, // challenge + 0x1aa: 0x24006, // figure + 0x1ab: 0xa505, // media + 0x1ae: 0x9804, // type + 0x1af: 0x13004, // font + 0x1b0: 0x4d20e, // onmessageerror + 0x1b1: 0x36908, // seamless + 0x1b2: 0x5f03, // dfn + 0x1b3: 0x1a205, // defer + 0x1b4: 0x8203, // low + 0x1b5: 0x63109, // onseeking + 0x1b6: 0x51b0b, // onmouseover + 0x1b7: 0x2aa0a, // novalidate + 0x1b8: 0x71c0a, // workertype + 0x1ba: 0x3c507, // itemref + 0x1bd: 0x1, // a + 0x1be: 0x31003, // map + 0x1bf: 0x1310c, // ontimeupdate + 0x1c0: 0x15e07, // bgsound + 0x1c1: 0x3206, // keygen + 0x1c2: 0x2705, // tbody + 0x1c5: 0x64406, // onshow + 0x1c7: 0x2501, // s + 0x1c8: 0x4f07, // pattern + 0x1cc: 0x14d10, // oncanplaythrough + 0x1ce: 0x2cf02, // dd + 0x1cf: 0x6f906, // srcset + 0x1d0: 0x17003, // big + 0x1d2: 0x65108, // sortable + 0x1d3: 0x47807, // onkeyup + 0x1d5: 0x59c06, // onplay + 0x1d7: 0x4b004, // meta + 0x1d8: 0x3fb06, // ondrop + 0x1da: 0x60008, // onscroll + 0x1db: 0x1f30b, // crossorigin + 0x1dc: 0x56b0a, // onpageshow + 0x1dd: 0x4, // abbr + 0x1de: 0x5e02, // td + 0x1df: 0x5830f, // contenteditable + 0x1e0: 0x26a06, // action + 0x1e1: 0x1210b, // playsinline + 0x1e2: 0x42907, // onfocus + 0x1e3: 0x2d808, // hreflang + 0x1e5: 0x50e0a, // onmouseout + 0x1e6: 0x5ea07, // onreset + 0x1e7: 0x11d08, // autoplay + 0x1ea: 0x67506, // scoped + 0x1ec: 0x30a, // radiogroup + 0x1ee: 0x3780b, // contextmenu + 0x1ef: 0x52609, // onmouseup + 0x1f1: 0x2c206, // hgroup + 0x1f2: 0x2000f, // allowfullscreen + 0x1f3: 0x4b608, // tabindex + 0x1f6: 0x30707, // isindex + 0x1f7: 0x1a0e, // accept-charset + 0x1f8: 0x2a60e, // formnovalidate + 0x1fb: 0x1c90e, // annotation-xml + 0x1fc: 0x4205, // embed + 0x1fd: 0x21006, // script + 0x1fe: 0x7a06, // dialog + 0x1ff: 0x1d707, // command +} + +const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobro" + + "wspanoembedetailsampatternoframesetdfnomoduleacronymalignmar" + + "kbdialogallowpaymentrequestrikeytypeallowusermediagroupictur" + + "eversedirnameterubyaltfooterasyncanvasidefaultitleaudioncanc" + + "elabelooptgroupingautofocusandboxmplaceholderautoplaysinline" + + "basefontimeupdateviacacheightmlbdoncanplaythrough1bgsoundisa" + + "bledivarbigblinkindraggablegendblockquotebuttonabortrackcode" + + "fercolgrouplaintextranslatecolorcolspannotation-xmlcommandco" + + "ntrolshapecoordslotcrossoriginsmallowfullscreenoscriptfacent" + + "erfieldsetfigcaptionafterprintegrityfigurequiredforeignObjec" + + "tforeignobjectformactionautocompleteerrorformenctypemustmatc" + + "hallengeformmethodformnovalidatetimeformtargethgrouposterhid" + + "denhigh2hreflanghttp-equivideonclickiframeimageimglyph3isind" + + "exismappletitemtypemarqueematheadersortedmaxlength4minlength" + + "5mtextareadonlymultiplemutedoncloseamlessourceoncontextmenui" + + "temidoncopyoncuechangeoncutondblclickondragendondragenterond" + + "ragexitemreferrerpolicyondragleaveondragoverondragstarticleo" + + "ndropzonemptiedondurationchangeonendedonerroronfocuspaceronh" + + "ashchangeoninputmodeloninvalidonkeydownloadonkeypresspellche" + + "ckedonkeyupreloadonlanguagechangeonloadeddatalistingonloaded" + + "metadatabindexonloadendonloadstartonmessageerroronmousedowno" + + "nmouseenteronmouseleaveonmousemoveonmouseoutputonmouseoveron" + + "mouseupromptonmousewheelonofflineononlineonpagehidescitempro" + + "penonceonpageshowbronpastepublicontenteditableonpausemaponpl" + + "ayingonpopstateonprogressrcdoclassectionbluronratechangeonre" + + "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" + + "violationauxclickonseekedonseekingonselectedonshowidth6onsor" + + "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" + + "handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" + + "wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" + + "arysupsvgsystemplateworkertypewrap" diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go new file mode 100644 index 0000000..5eb7c5a --- /dev/null +++ b/vendor/golang.org/x/net/html/const.go @@ -0,0 +1,104 @@ +// Copyright 2011 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 html + +// Section 12.2.4.2 of the HTML5 specification says "The following elements +// have varying levels of special parsing rules". +// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements +var isSpecialElementMap = map[string]bool{ + "address": true, + "applet": true, + "area": true, + "article": true, + "aside": true, + "base": true, + "basefont": true, + "bgsound": true, + "blockquote": true, + "body": true, + "br": true, + "button": true, + "caption": true, + "center": true, + "col": true, + "colgroup": true, + "dd": true, + "details": true, + "dir": true, + "div": true, + "dl": true, + "dt": true, + "embed": true, + "fieldset": true, + "figcaption": true, + "figure": true, + "footer": true, + "form": true, + "frame": true, + "frameset": true, + "h1": true, + "h2": true, + "h3": true, + "h4": true, + "h5": true, + "h6": true, + "head": true, + "header": true, + "hgroup": true, + "hr": true, + "html": true, + "iframe": true, + "img": true, + "input": true, + "isindex": true, // The 'isindex' element has been removed, but keep it for backwards compatibility. + "keygen": true, + "li": true, + "link": true, + "listing": true, + "main": true, + "marquee": true, + "menu": true, + "meta": true, + "nav": true, + "noembed": true, + "noframes": true, + "noscript": true, + "object": true, + "ol": true, + "p": true, + "param": true, + "plaintext": true, + "pre": true, + "script": true, + "section": true, + "select": true, + "source": true, + "style": true, + "summary": true, + "table": true, + "tbody": true, + "td": true, + "template": true, + "textarea": true, + "tfoot": true, + "th": true, + "thead": true, + "title": true, + "tr": true, + "track": true, + "ul": true, + "wbr": true, + "xmp": true, +} + +func isSpecialElement(element *Node) bool { + switch element.Namespace { + case "", "html": + return isSpecialElementMap[element.Data] + case "svg": + return element.Data == "foreignObject" + } + return false +} diff --git a/vendor/golang.org/x/net/html/doc.go b/vendor/golang.org/x/net/html/doc.go new file mode 100644 index 0000000..822ed42 --- /dev/null +++ b/vendor/golang.org/x/net/html/doc.go @@ -0,0 +1,106 @@ +// Copyright 2010 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 html implements an HTML5-compliant tokenizer and parser. + +Tokenization is done by creating a Tokenizer for an io.Reader r. It is the +caller's responsibility to ensure that r provides UTF-8 encoded HTML. + + z := html.NewTokenizer(r) + +Given a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(), +which parses the next token and returns its type, or an error: + + for { + tt := z.Next() + if tt == html.ErrorToken { + // ... + return ... + } + // Process the current token. + } + +There are two APIs for retrieving the current token. The high-level API is to +call Token; the low-level API is to call Text or TagName / TagAttr. Both APIs +allow optionally calling Raw after Next but before Token, Text, TagName, or +TagAttr. In EBNF notation, the valid call sequence per token is: + + Next {Raw} [ Token | Text | TagName {TagAttr} ] + +Token returns an independent data structure that completely describes a token. +Entities (such as "<") are unescaped, tag names and attribute keys are +lower-cased, and attributes are collected into a []Attribute. For example: + + for { + if z.Next() == html.ErrorToken { + // Returning io.EOF indicates success. + return z.Err() + } + emitToken(z.Token()) + } + +The low-level API performs fewer allocations and copies, but the contents of +the []byte values returned by Text, TagName and TagAttr may change on the next +call to Next. For example, to extract an HTML page's anchor text: + + depth := 0 + for { + tt := z.Next() + switch tt { + case html.ErrorToken: + return z.Err() + case html.TextToken: + if depth > 0 { + // emitBytes should copy the []byte it receives, + // if it doesn't process it immediately. + emitBytes(z.Text()) + } + case html.StartTagToken, html.EndTagToken: + tn, _ := z.TagName() + if len(tn) == 1 && tn[0] == 'a' { + if tt == html.StartTagToken { + depth++ + } else { + depth-- + } + } + } + } + +Parsing is done by calling Parse with an io.Reader, which returns the root of +the parse tree (the document element) as a *Node. It is the caller's +responsibility to ensure that the Reader provides UTF-8 encoded HTML. For +example, to process each anchor node in depth-first order: + + doc, err := html.Parse(r) + if err != nil { + // ... + } + var f func(*html.Node) + f = func(n *html.Node) { + if n.Type == html.ElementNode && n.Data == "a" { + // Do something with n... + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + f(c) + } + } + f(doc) + +The relevant specifications include: +https://html.spec.whatwg.org/multipage/syntax.html and +https://html.spec.whatwg.org/multipage/syntax.html#tokenization +*/ +package html // import "golang.org/x/net/html" + +// The tokenization algorithm implemented by this package is not a line-by-line +// transliteration of the relatively verbose state-machine in the WHATWG +// specification. A more direct approach is used instead, where the program +// counter implies the state, such as whether it is tokenizing a tag or a text +// node. Specification compliance is verified by checking expected and actual +// outputs over a test suite rather than aiming for algorithmic fidelity. + +// TODO(nigeltao): Does a DOM API belong in this package or a separate one? +// TODO(nigeltao): How does parsing interact with a JavaScript engine? diff --git a/vendor/golang.org/x/net/html/doctype.go b/vendor/golang.org/x/net/html/doctype.go new file mode 100644 index 0000000..c484e5a --- /dev/null +++ b/vendor/golang.org/x/net/html/doctype.go @@ -0,0 +1,156 @@ +// Copyright 2011 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 html + +import ( + "strings" +) + +// parseDoctype parses the data from a DoctypeToken into a name, +// public identifier, and system identifier. It returns a Node whose Type +// is DoctypeNode, whose Data is the name, and which has attributes +// named "system" and "public" for the two identifiers if they were present. +// quirks is whether the document should be parsed in "quirks mode". +func parseDoctype(s string) (n *Node, quirks bool) { + n = &Node{Type: DoctypeNode} + + // Find the name. + space := strings.IndexAny(s, whitespace) + if space == -1 { + space = len(s) + } + n.Data = s[:space] + // The comparison to "html" is case-sensitive. + if n.Data != "html" { + quirks = true + } + n.Data = strings.ToLower(n.Data) + s = strings.TrimLeft(s[space:], whitespace) + + if len(s) < 6 { + // It can't start with "PUBLIC" or "SYSTEM". + // Ignore the rest of the string. + return n, quirks || s != "" + } + + key := strings.ToLower(s[:6]) + s = s[6:] + for key == "public" || key == "system" { + s = strings.TrimLeft(s, whitespace) + if s == "" { + break + } + quote := s[0] + if quote != '"' && quote != '\'' { + break + } + s = s[1:] + q := strings.IndexRune(s, rune(quote)) + var id string + if q == -1 { + id = s + s = "" + } else { + id = s[:q] + s = s[q+1:] + } + n.Attr = append(n.Attr, Attribute{Key: key, Val: id}) + if key == "public" { + key = "system" + } else { + key = "" + } + } + + if key != "" || s != "" { + quirks = true + } else if len(n.Attr) > 0 { + if n.Attr[0].Key == "public" { + public := strings.ToLower(n.Attr[0].Val) + switch public { + case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html": + quirks = true + default: + for _, q := range quirkyIDs { + if strings.HasPrefix(public, q) { + quirks = true + break + } + } + } + // The following two public IDs only cause quirks mode if there is no system ID. + if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") || + strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) { + quirks = true + } + } + if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" && + strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" { + quirks = true + } + } + + return n, quirks +} + +// quirkyIDs is a list of public doctype identifiers that cause a document +// to be interpreted in quirks mode. The identifiers should be in lower case. +var quirkyIDs = []string{ + "+//silmaril//dtd html pro v0r11 19970101//", + "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", + "-//as//dtd html 3.0 aswedit + extensions//", + "-//ietf//dtd html 2.0 level 1//", + "-//ietf//dtd html 2.0 level 2//", + "-//ietf//dtd html 2.0 strict level 1//", + "-//ietf//dtd html 2.0 strict level 2//", + "-//ietf//dtd html 2.0 strict//", + "-//ietf//dtd html 2.0//", + "-//ietf//dtd html 2.1e//", + "-//ietf//dtd html 3.0//", + "-//ietf//dtd html 3.2 final//", + "-//ietf//dtd html 3.2//", + "-//ietf//dtd html 3//", + "-//ietf//dtd html level 0//", + "-//ietf//dtd html level 1//", + "-//ietf//dtd html level 2//", + "-//ietf//dtd html level 3//", + "-//ietf//dtd html strict level 0//", + "-//ietf//dtd html strict level 1//", + "-//ietf//dtd html strict level 2//", + "-//ietf//dtd html strict level 3//", + "-//ietf//dtd html strict//", + "-//ietf//dtd html//", + "-//metrius//dtd metrius presentational//", + "-//microsoft//dtd internet explorer 2.0 html strict//", + "-//microsoft//dtd internet explorer 2.0 html//", + "-//microsoft//dtd internet explorer 2.0 tables//", + "-//microsoft//dtd internet explorer 3.0 html strict//", + "-//microsoft//dtd internet explorer 3.0 html//", + "-//microsoft//dtd internet explorer 3.0 tables//", + "-//netscape comm. corp.//dtd html//", + "-//netscape comm. corp.//dtd strict html//", + "-//o'reilly and associates//dtd html 2.0//", + "-//o'reilly and associates//dtd html extended 1.0//", + "-//o'reilly and associates//dtd html extended relaxed 1.0//", + "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", + "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", + "-//spyglass//dtd html 2.0 extended//", + "-//sq//dtd html 2.0 hotmetal + extensions//", + "-//sun microsystems corp.//dtd hotjava html//", + "-//sun microsystems corp.//dtd hotjava strict html//", + "-//w3c//dtd html 3 1995-03-24//", + "-//w3c//dtd html 3.2 draft//", + "-//w3c//dtd html 3.2 final//", + "-//w3c//dtd html 3.2//", + "-//w3c//dtd html 3.2s draft//", + "-//w3c//dtd html 4.0 frameset//", + "-//w3c//dtd html 4.0 transitional//", + "-//w3c//dtd html experimental 19960712//", + "-//w3c//dtd html experimental 970421//", + "-//w3c//dtd w3 html//", + "-//w3o//dtd w3 html 3.0//", + "-//webtechs//dtd mozilla html 2.0//", + "-//webtechs//dtd mozilla html//", +} diff --git a/vendor/golang.org/x/net/html/entity.go b/vendor/golang.org/x/net/html/entity.go new file mode 100644 index 0000000..a50c04c --- /dev/null +++ b/vendor/golang.org/x/net/html/entity.go @@ -0,0 +1,2253 @@ +// Copyright 2010 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 html + +// All entities that do not end with ';' are 6 or fewer bytes long. +const longestEntityWithoutSemicolon = 6 + +// entity is a map from HTML entity names to their values. The semicolon matters: +// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references +// lists both "amp" and "amp;" as two separate entries. +// +// Note that the HTML5 list is larger than the HTML4 list at +// http://www.w3.org/TR/html4/sgml/entities.html +var entity = map[string]rune{ + "AElig;": '\U000000C6', + "AMP;": '\U00000026', + "Aacute;": '\U000000C1', + "Abreve;": '\U00000102', + "Acirc;": '\U000000C2', + "Acy;": '\U00000410', + "Afr;": '\U0001D504', + "Agrave;": '\U000000C0', + "Alpha;": '\U00000391', + "Amacr;": '\U00000100', + "And;": '\U00002A53', + "Aogon;": '\U00000104', + "Aopf;": '\U0001D538', + "ApplyFunction;": '\U00002061', + "Aring;": '\U000000C5', + "Ascr;": '\U0001D49C', + "Assign;": '\U00002254', + "Atilde;": '\U000000C3', + "Auml;": '\U000000C4', + "Backslash;": '\U00002216', + "Barv;": '\U00002AE7', + "Barwed;": '\U00002306', + "Bcy;": '\U00000411', + "Because;": '\U00002235', + "Bernoullis;": '\U0000212C', + "Beta;": '\U00000392', + "Bfr;": '\U0001D505', + "Bopf;": '\U0001D539', + "Breve;": '\U000002D8', + "Bscr;": '\U0000212C', + "Bumpeq;": '\U0000224E', + "CHcy;": '\U00000427', + "COPY;": '\U000000A9', + "Cacute;": '\U00000106', + "Cap;": '\U000022D2', + "CapitalDifferentialD;": '\U00002145', + "Cayleys;": '\U0000212D', + "Ccaron;": '\U0000010C', + "Ccedil;": '\U000000C7', + "Ccirc;": '\U00000108', + "Cconint;": '\U00002230', + "Cdot;": '\U0000010A', + "Cedilla;": '\U000000B8', + "CenterDot;": '\U000000B7', + "Cfr;": '\U0000212D', + "Chi;": '\U000003A7', + "CircleDot;": '\U00002299', + "CircleMinus;": '\U00002296', + "CirclePlus;": '\U00002295', + "CircleTimes;": '\U00002297', + "ClockwiseContourIntegral;": '\U00002232', + "CloseCurlyDoubleQuote;": '\U0000201D', + "CloseCurlyQuote;": '\U00002019', + "Colon;": '\U00002237', + "Colone;": '\U00002A74', + "Congruent;": '\U00002261', + "Conint;": '\U0000222F', + "ContourIntegral;": '\U0000222E', + "Copf;": '\U00002102', + "Coproduct;": '\U00002210', + "CounterClockwiseContourIntegral;": '\U00002233', + "Cross;": '\U00002A2F', + "Cscr;": '\U0001D49E', + "Cup;": '\U000022D3', + "CupCap;": '\U0000224D', + "DD;": '\U00002145', + "DDotrahd;": '\U00002911', + "DJcy;": '\U00000402', + "DScy;": '\U00000405', + "DZcy;": '\U0000040F', + "Dagger;": '\U00002021', + "Darr;": '\U000021A1', + "Dashv;": '\U00002AE4', + "Dcaron;": '\U0000010E', + "Dcy;": '\U00000414', + "Del;": '\U00002207', + "Delta;": '\U00000394', + "Dfr;": '\U0001D507', + "DiacriticalAcute;": '\U000000B4', + "DiacriticalDot;": '\U000002D9', + "DiacriticalDoubleAcute;": '\U000002DD', + "DiacriticalGrave;": '\U00000060', + "DiacriticalTilde;": '\U000002DC', + "Diamond;": '\U000022C4', + "DifferentialD;": '\U00002146', + "Dopf;": '\U0001D53B', + "Dot;": '\U000000A8', + "DotDot;": '\U000020DC', + "DotEqual;": '\U00002250', + "DoubleContourIntegral;": '\U0000222F', + "DoubleDot;": '\U000000A8', + "DoubleDownArrow;": '\U000021D3', + "DoubleLeftArrow;": '\U000021D0', + "DoubleLeftRightArrow;": '\U000021D4', + "DoubleLeftTee;": '\U00002AE4', + "DoubleLongLeftArrow;": '\U000027F8', + "DoubleLongLeftRightArrow;": '\U000027FA', + "DoubleLongRightArrow;": '\U000027F9', + "DoubleRightArrow;": '\U000021D2', + "DoubleRightTee;": '\U000022A8', + "DoubleUpArrow;": '\U000021D1', + "DoubleUpDownArrow;": '\U000021D5', + "DoubleVerticalBar;": '\U00002225', + "DownArrow;": '\U00002193', + "DownArrowBar;": '\U00002913', + "DownArrowUpArrow;": '\U000021F5', + "DownBreve;": '\U00000311', + "DownLeftRightVector;": '\U00002950', + "DownLeftTeeVector;": '\U0000295E', + "DownLeftVector;": '\U000021BD', + "DownLeftVectorBar;": '\U00002956', + "DownRightTeeVector;": '\U0000295F', + "DownRightVector;": '\U000021C1', + "DownRightVectorBar;": '\U00002957', + "DownTee;": '\U000022A4', + "DownTeeArrow;": '\U000021A7', + "Downarrow;": '\U000021D3', + "Dscr;": '\U0001D49F', + "Dstrok;": '\U00000110', + "ENG;": '\U0000014A', + "ETH;": '\U000000D0', + "Eacute;": '\U000000C9', + "Ecaron;": '\U0000011A', + "Ecirc;": '\U000000CA', + "Ecy;": '\U0000042D', + "Edot;": '\U00000116', + "Efr;": '\U0001D508', + "Egrave;": '\U000000C8', + "Element;": '\U00002208', + "Emacr;": '\U00000112', + "EmptySmallSquare;": '\U000025FB', + "EmptyVerySmallSquare;": '\U000025AB', + "Eogon;": '\U00000118', + "Eopf;": '\U0001D53C', + "Epsilon;": '\U00000395', + "Equal;": '\U00002A75', + "EqualTilde;": '\U00002242', + "Equilibrium;": '\U000021CC', + "Escr;": '\U00002130', + "Esim;": '\U00002A73', + "Eta;": '\U00000397', + "Euml;": '\U000000CB', + "Exists;": '\U00002203', + "ExponentialE;": '\U00002147', + "Fcy;": '\U00000424', + "Ffr;": '\U0001D509', + "FilledSmallSquare;": '\U000025FC', + "FilledVerySmallSquare;": '\U000025AA', + "Fopf;": '\U0001D53D', + "ForAll;": '\U00002200', + "Fouriertrf;": '\U00002131', + "Fscr;": '\U00002131', + "GJcy;": '\U00000403', + "GT;": '\U0000003E', + "Gamma;": '\U00000393', + "Gammad;": '\U000003DC', + "Gbreve;": '\U0000011E', + "Gcedil;": '\U00000122', + "Gcirc;": '\U0000011C', + "Gcy;": '\U00000413', + "Gdot;": '\U00000120', + "Gfr;": '\U0001D50A', + "Gg;": '\U000022D9', + "Gopf;": '\U0001D53E', + "GreaterEqual;": '\U00002265', + "GreaterEqualLess;": '\U000022DB', + "GreaterFullEqual;": '\U00002267', + "GreaterGreater;": '\U00002AA2', + "GreaterLess;": '\U00002277', + "GreaterSlantEqual;": '\U00002A7E', + "GreaterTilde;": '\U00002273', + "Gscr;": '\U0001D4A2', + "Gt;": '\U0000226B', + "HARDcy;": '\U0000042A', + "Hacek;": '\U000002C7', + "Hat;": '\U0000005E', + "Hcirc;": '\U00000124', + "Hfr;": '\U0000210C', + "HilbertSpace;": '\U0000210B', + "Hopf;": '\U0000210D', + "HorizontalLine;": '\U00002500', + "Hscr;": '\U0000210B', + "Hstrok;": '\U00000126', + "HumpDownHump;": '\U0000224E', + "HumpEqual;": '\U0000224F', + "IEcy;": '\U00000415', + "IJlig;": '\U00000132', + "IOcy;": '\U00000401', + "Iacute;": '\U000000CD', + "Icirc;": '\U000000CE', + "Icy;": '\U00000418', + "Idot;": '\U00000130', + "Ifr;": '\U00002111', + "Igrave;": '\U000000CC', + "Im;": '\U00002111', + "Imacr;": '\U0000012A', + "ImaginaryI;": '\U00002148', + "Implies;": '\U000021D2', + "Int;": '\U0000222C', + "Integral;": '\U0000222B', + "Intersection;": '\U000022C2', + "InvisibleComma;": '\U00002063', + "InvisibleTimes;": '\U00002062', + "Iogon;": '\U0000012E', + "Iopf;": '\U0001D540', + "Iota;": '\U00000399', + "Iscr;": '\U00002110', + "Itilde;": '\U00000128', + "Iukcy;": '\U00000406', + "Iuml;": '\U000000CF', + "Jcirc;": '\U00000134', + "Jcy;": '\U00000419', + "Jfr;": '\U0001D50D', + "Jopf;": '\U0001D541', + "Jscr;": '\U0001D4A5', + "Jsercy;": '\U00000408', + "Jukcy;": '\U00000404', + "KHcy;": '\U00000425', + "KJcy;": '\U0000040C', + "Kappa;": '\U0000039A', + "Kcedil;": '\U00000136', + "Kcy;": '\U0000041A', + "Kfr;": '\U0001D50E', + "Kopf;": '\U0001D542', + "Kscr;": '\U0001D4A6', + "LJcy;": '\U00000409', + "LT;": '\U0000003C', + "Lacute;": '\U00000139', + "Lambda;": '\U0000039B', + "Lang;": '\U000027EA', + "Laplacetrf;": '\U00002112', + "Larr;": '\U0000219E', + "Lcaron;": '\U0000013D', + "Lcedil;": '\U0000013B', + "Lcy;": '\U0000041B', + "LeftAngleBracket;": '\U000027E8', + "LeftArrow;": '\U00002190', + "LeftArrowBar;": '\U000021E4', + "LeftArrowRightArrow;": '\U000021C6', + "LeftCeiling;": '\U00002308', + "LeftDoubleBracket;": '\U000027E6', + "LeftDownTeeVector;": '\U00002961', + "LeftDownVector;": '\U000021C3', + "LeftDownVectorBar;": '\U00002959', + "LeftFloor;": '\U0000230A', + "LeftRightArrow;": '\U00002194', + "LeftRightVector;": '\U0000294E', + "LeftTee;": '\U000022A3', + "LeftTeeArrow;": '\U000021A4', + "LeftTeeVector;": '\U0000295A', + "LeftTriangle;": '\U000022B2', + "LeftTriangleBar;": '\U000029CF', + "LeftTriangleEqual;": '\U000022B4', + "LeftUpDownVector;": '\U00002951', + "LeftUpTeeVector;": '\U00002960', + "LeftUpVector;": '\U000021BF', + "LeftUpVectorBar;": '\U00002958', + "LeftVector;": '\U000021BC', + "LeftVectorBar;": '\U00002952', + "Leftarrow;": '\U000021D0', + "Leftrightarrow;": '\U000021D4', + "LessEqualGreater;": '\U000022DA', + "LessFullEqual;": '\U00002266', + "LessGreater;": '\U00002276', + "LessLess;": '\U00002AA1', + "LessSlantEqual;": '\U00002A7D', + "LessTilde;": '\U00002272', + "Lfr;": '\U0001D50F', + "Ll;": '\U000022D8', + "Lleftarrow;": '\U000021DA', + "Lmidot;": '\U0000013F', + "LongLeftArrow;": '\U000027F5', + "LongLeftRightArrow;": '\U000027F7', + "LongRightArrow;": '\U000027F6', + "Longleftarrow;": '\U000027F8', + "Longleftrightarrow;": '\U000027FA', + "Longrightarrow;": '\U000027F9', + "Lopf;": '\U0001D543', + "LowerLeftArrow;": '\U00002199', + "LowerRightArrow;": '\U00002198', + "Lscr;": '\U00002112', + "Lsh;": '\U000021B0', + "Lstrok;": '\U00000141', + "Lt;": '\U0000226A', + "Map;": '\U00002905', + "Mcy;": '\U0000041C', + "MediumSpace;": '\U0000205F', + "Mellintrf;": '\U00002133', + "Mfr;": '\U0001D510', + "MinusPlus;": '\U00002213', + "Mopf;": '\U0001D544', + "Mscr;": '\U00002133', + "Mu;": '\U0000039C', + "NJcy;": '\U0000040A', + "Nacute;": '\U00000143', + "Ncaron;": '\U00000147', + "Ncedil;": '\U00000145', + "Ncy;": '\U0000041D', + "NegativeMediumSpace;": '\U0000200B', + "NegativeThickSpace;": '\U0000200B', + "NegativeThinSpace;": '\U0000200B', + "NegativeVeryThinSpace;": '\U0000200B', + "NestedGreaterGreater;": '\U0000226B', + "NestedLessLess;": '\U0000226A', + "NewLine;": '\U0000000A', + "Nfr;": '\U0001D511', + "NoBreak;": '\U00002060', + "NonBreakingSpace;": '\U000000A0', + "Nopf;": '\U00002115', + "Not;": '\U00002AEC', + "NotCongruent;": '\U00002262', + "NotCupCap;": '\U0000226D', + "NotDoubleVerticalBar;": '\U00002226', + "NotElement;": '\U00002209', + "NotEqual;": '\U00002260', + "NotExists;": '\U00002204', + "NotGreater;": '\U0000226F', + "NotGreaterEqual;": '\U00002271', + "NotGreaterLess;": '\U00002279', + "NotGreaterTilde;": '\U00002275', + "NotLeftTriangle;": '\U000022EA', + "NotLeftTriangleEqual;": '\U000022EC', + "NotLess;": '\U0000226E', + "NotLessEqual;": '\U00002270', + "NotLessGreater;": '\U00002278', + "NotLessTilde;": '\U00002274', + "NotPrecedes;": '\U00002280', + "NotPrecedesSlantEqual;": '\U000022E0', + "NotReverseElement;": '\U0000220C', + "NotRightTriangle;": '\U000022EB', + "NotRightTriangleEqual;": '\U000022ED', + "NotSquareSubsetEqual;": '\U000022E2', + "NotSquareSupersetEqual;": '\U000022E3', + "NotSubsetEqual;": '\U00002288', + "NotSucceeds;": '\U00002281', + "NotSucceedsSlantEqual;": '\U000022E1', + "NotSupersetEqual;": '\U00002289', + "NotTilde;": '\U00002241', + "NotTildeEqual;": '\U00002244', + "NotTildeFullEqual;": '\U00002247', + "NotTildeTilde;": '\U00002249', + "NotVerticalBar;": '\U00002224', + "Nscr;": '\U0001D4A9', + "Ntilde;": '\U000000D1', + "Nu;": '\U0000039D', + "OElig;": '\U00000152', + "Oacute;": '\U000000D3', + "Ocirc;": '\U000000D4', + "Ocy;": '\U0000041E', + "Odblac;": '\U00000150', + "Ofr;": '\U0001D512', + "Ograve;": '\U000000D2', + "Omacr;": '\U0000014C', + "Omega;": '\U000003A9', + "Omicron;": '\U0000039F', + "Oopf;": '\U0001D546', + "OpenCurlyDoubleQuote;": '\U0000201C', + "OpenCurlyQuote;": '\U00002018', + "Or;": '\U00002A54', + "Oscr;": '\U0001D4AA', + "Oslash;": '\U000000D8', + "Otilde;": '\U000000D5', + "Otimes;": '\U00002A37', + "Ouml;": '\U000000D6', + "OverBar;": '\U0000203E', + "OverBrace;": '\U000023DE', + "OverBracket;": '\U000023B4', + "OverParenthesis;": '\U000023DC', + "PartialD;": '\U00002202', + "Pcy;": '\U0000041F', + "Pfr;": '\U0001D513', + "Phi;": '\U000003A6', + "Pi;": '\U000003A0', + "PlusMinus;": '\U000000B1', + "Poincareplane;": '\U0000210C', + "Popf;": '\U00002119', + "Pr;": '\U00002ABB', + "Precedes;": '\U0000227A', + "PrecedesEqual;": '\U00002AAF', + "PrecedesSlantEqual;": '\U0000227C', + "PrecedesTilde;": '\U0000227E', + "Prime;": '\U00002033', + "Product;": '\U0000220F', + "Proportion;": '\U00002237', + "Proportional;": '\U0000221D', + "Pscr;": '\U0001D4AB', + "Psi;": '\U000003A8', + "QUOT;": '\U00000022', + "Qfr;": '\U0001D514', + "Qopf;": '\U0000211A', + "Qscr;": '\U0001D4AC', + "RBarr;": '\U00002910', + "REG;": '\U000000AE', + "Racute;": '\U00000154', + "Rang;": '\U000027EB', + "Rarr;": '\U000021A0', + "Rarrtl;": '\U00002916', + "Rcaron;": '\U00000158', + "Rcedil;": '\U00000156', + "Rcy;": '\U00000420', + "Re;": '\U0000211C', + "ReverseElement;": '\U0000220B', + "ReverseEquilibrium;": '\U000021CB', + "ReverseUpEquilibrium;": '\U0000296F', + "Rfr;": '\U0000211C', + "Rho;": '\U000003A1', + "RightAngleBracket;": '\U000027E9', + "RightArrow;": '\U00002192', + "RightArrowBar;": '\U000021E5', + "RightArrowLeftArrow;": '\U000021C4', + "RightCeiling;": '\U00002309', + "RightDoubleBracket;": '\U000027E7', + "RightDownTeeVector;": '\U0000295D', + "RightDownVector;": '\U000021C2', + "RightDownVectorBar;": '\U00002955', + "RightFloor;": '\U0000230B', + "RightTee;": '\U000022A2', + "RightTeeArrow;": '\U000021A6', + "RightTeeVector;": '\U0000295B', + "RightTriangle;": '\U000022B3', + "RightTriangleBar;": '\U000029D0', + "RightTriangleEqual;": '\U000022B5', + "RightUpDownVector;": '\U0000294F', + "RightUpTeeVector;": '\U0000295C', + "RightUpVector;": '\U000021BE', + "RightUpVectorBar;": '\U00002954', + "RightVector;": '\U000021C0', + "RightVectorBar;": '\U00002953', + "Rightarrow;": '\U000021D2', + "Ropf;": '\U0000211D', + "RoundImplies;": '\U00002970', + "Rrightarrow;": '\U000021DB', + "Rscr;": '\U0000211B', + "Rsh;": '\U000021B1', + "RuleDelayed;": '\U000029F4', + "SHCHcy;": '\U00000429', + "SHcy;": '\U00000428', + "SOFTcy;": '\U0000042C', + "Sacute;": '\U0000015A', + "Sc;": '\U00002ABC', + "Scaron;": '\U00000160', + "Scedil;": '\U0000015E', + "Scirc;": '\U0000015C', + "Scy;": '\U00000421', + "Sfr;": '\U0001D516', + "ShortDownArrow;": '\U00002193', + "ShortLeftArrow;": '\U00002190', + "ShortRightArrow;": '\U00002192', + "ShortUpArrow;": '\U00002191', + "Sigma;": '\U000003A3', + "SmallCircle;": '\U00002218', + "Sopf;": '\U0001D54A', + "Sqrt;": '\U0000221A', + "Square;": '\U000025A1', + "SquareIntersection;": '\U00002293', + "SquareSubset;": '\U0000228F', + "SquareSubsetEqual;": '\U00002291', + "SquareSuperset;": '\U00002290', + "SquareSupersetEqual;": '\U00002292', + "SquareUnion;": '\U00002294', + "Sscr;": '\U0001D4AE', + "Star;": '\U000022C6', + "Sub;": '\U000022D0', + "Subset;": '\U000022D0', + "SubsetEqual;": '\U00002286', + "Succeeds;": '\U0000227B', + "SucceedsEqual;": '\U00002AB0', + "SucceedsSlantEqual;": '\U0000227D', + "SucceedsTilde;": '\U0000227F', + "SuchThat;": '\U0000220B', + "Sum;": '\U00002211', + "Sup;": '\U000022D1', + "Superset;": '\U00002283', + "SupersetEqual;": '\U00002287', + "Supset;": '\U000022D1', + "THORN;": '\U000000DE', + "TRADE;": '\U00002122', + "TSHcy;": '\U0000040B', + "TScy;": '\U00000426', + "Tab;": '\U00000009', + "Tau;": '\U000003A4', + "Tcaron;": '\U00000164', + "Tcedil;": '\U00000162', + "Tcy;": '\U00000422', + "Tfr;": '\U0001D517', + "Therefore;": '\U00002234', + "Theta;": '\U00000398', + "ThinSpace;": '\U00002009', + "Tilde;": '\U0000223C', + "TildeEqual;": '\U00002243', + "TildeFullEqual;": '\U00002245', + "TildeTilde;": '\U00002248', + "Topf;": '\U0001D54B', + "TripleDot;": '\U000020DB', + "Tscr;": '\U0001D4AF', + "Tstrok;": '\U00000166', + "Uacute;": '\U000000DA', + "Uarr;": '\U0000219F', + "Uarrocir;": '\U00002949', + "Ubrcy;": '\U0000040E', + "Ubreve;": '\U0000016C', + "Ucirc;": '\U000000DB', + "Ucy;": '\U00000423', + "Udblac;": '\U00000170', + "Ufr;": '\U0001D518', + "Ugrave;": '\U000000D9', + "Umacr;": '\U0000016A', + "UnderBar;": '\U0000005F', + "UnderBrace;": '\U000023DF', + "UnderBracket;": '\U000023B5', + "UnderParenthesis;": '\U000023DD', + "Union;": '\U000022C3', + "UnionPlus;": '\U0000228E', + "Uogon;": '\U00000172', + "Uopf;": '\U0001D54C', + "UpArrow;": '\U00002191', + "UpArrowBar;": '\U00002912', + "UpArrowDownArrow;": '\U000021C5', + "UpDownArrow;": '\U00002195', + "UpEquilibrium;": '\U0000296E', + "UpTee;": '\U000022A5', + "UpTeeArrow;": '\U000021A5', + "Uparrow;": '\U000021D1', + "Updownarrow;": '\U000021D5', + "UpperLeftArrow;": '\U00002196', + "UpperRightArrow;": '\U00002197', + "Upsi;": '\U000003D2', + "Upsilon;": '\U000003A5', + "Uring;": '\U0000016E', + "Uscr;": '\U0001D4B0', + "Utilde;": '\U00000168', + "Uuml;": '\U000000DC', + "VDash;": '\U000022AB', + "Vbar;": '\U00002AEB', + "Vcy;": '\U00000412', + "Vdash;": '\U000022A9', + "Vdashl;": '\U00002AE6', + "Vee;": '\U000022C1', + "Verbar;": '\U00002016', + "Vert;": '\U00002016', + "VerticalBar;": '\U00002223', + "VerticalLine;": '\U0000007C', + "VerticalSeparator;": '\U00002758', + "VerticalTilde;": '\U00002240', + "VeryThinSpace;": '\U0000200A', + "Vfr;": '\U0001D519', + "Vopf;": '\U0001D54D', + "Vscr;": '\U0001D4B1', + "Vvdash;": '\U000022AA', + "Wcirc;": '\U00000174', + "Wedge;": '\U000022C0', + "Wfr;": '\U0001D51A', + "Wopf;": '\U0001D54E', + "Wscr;": '\U0001D4B2', + "Xfr;": '\U0001D51B', + "Xi;": '\U0000039E', + "Xopf;": '\U0001D54F', + "Xscr;": '\U0001D4B3', + "YAcy;": '\U0000042F', + "YIcy;": '\U00000407', + "YUcy;": '\U0000042E', + "Yacute;": '\U000000DD', + "Ycirc;": '\U00000176', + "Ycy;": '\U0000042B', + "Yfr;": '\U0001D51C', + "Yopf;": '\U0001D550', + "Yscr;": '\U0001D4B4', + "Yuml;": '\U00000178', + "ZHcy;": '\U00000416', + "Zacute;": '\U00000179', + "Zcaron;": '\U0000017D', + "Zcy;": '\U00000417', + "Zdot;": '\U0000017B', + "ZeroWidthSpace;": '\U0000200B', + "Zeta;": '\U00000396', + "Zfr;": '\U00002128', + "Zopf;": '\U00002124', + "Zscr;": '\U0001D4B5', + "aacute;": '\U000000E1', + "abreve;": '\U00000103', + "ac;": '\U0000223E', + "acd;": '\U0000223F', + "acirc;": '\U000000E2', + "acute;": '\U000000B4', + "acy;": '\U00000430', + "aelig;": '\U000000E6', + "af;": '\U00002061', + "afr;": '\U0001D51E', + "agrave;": '\U000000E0', + "alefsym;": '\U00002135', + "aleph;": '\U00002135', + "alpha;": '\U000003B1', + "amacr;": '\U00000101', + "amalg;": '\U00002A3F', + "amp;": '\U00000026', + "and;": '\U00002227', + "andand;": '\U00002A55', + "andd;": '\U00002A5C', + "andslope;": '\U00002A58', + "andv;": '\U00002A5A', + "ang;": '\U00002220', + "ange;": '\U000029A4', + "angle;": '\U00002220', + "angmsd;": '\U00002221', + "angmsdaa;": '\U000029A8', + "angmsdab;": '\U000029A9', + "angmsdac;": '\U000029AA', + "angmsdad;": '\U000029AB', + "angmsdae;": '\U000029AC', + "angmsdaf;": '\U000029AD', + "angmsdag;": '\U000029AE', + "angmsdah;": '\U000029AF', + "angrt;": '\U0000221F', + "angrtvb;": '\U000022BE', + "angrtvbd;": '\U0000299D', + "angsph;": '\U00002222', + "angst;": '\U000000C5', + "angzarr;": '\U0000237C', + "aogon;": '\U00000105', + "aopf;": '\U0001D552', + "ap;": '\U00002248', + "apE;": '\U00002A70', + "apacir;": '\U00002A6F', + "ape;": '\U0000224A', + "apid;": '\U0000224B', + "apos;": '\U00000027', + "approx;": '\U00002248', + "approxeq;": '\U0000224A', + "aring;": '\U000000E5', + "ascr;": '\U0001D4B6', + "ast;": '\U0000002A', + "asymp;": '\U00002248', + "asympeq;": '\U0000224D', + "atilde;": '\U000000E3', + "auml;": '\U000000E4', + "awconint;": '\U00002233', + "awint;": '\U00002A11', + "bNot;": '\U00002AED', + "backcong;": '\U0000224C', + "backepsilon;": '\U000003F6', + "backprime;": '\U00002035', + "backsim;": '\U0000223D', + "backsimeq;": '\U000022CD', + "barvee;": '\U000022BD', + "barwed;": '\U00002305', + "barwedge;": '\U00002305', + "bbrk;": '\U000023B5', + "bbrktbrk;": '\U000023B6', + "bcong;": '\U0000224C', + "bcy;": '\U00000431', + "bdquo;": '\U0000201E', + "becaus;": '\U00002235', + "because;": '\U00002235', + "bemptyv;": '\U000029B0', + "bepsi;": '\U000003F6', + "bernou;": '\U0000212C', + "beta;": '\U000003B2', + "beth;": '\U00002136', + "between;": '\U0000226C', + "bfr;": '\U0001D51F', + "bigcap;": '\U000022C2', + "bigcirc;": '\U000025EF', + "bigcup;": '\U000022C3', + "bigodot;": '\U00002A00', + "bigoplus;": '\U00002A01', + "bigotimes;": '\U00002A02', + "bigsqcup;": '\U00002A06', + "bigstar;": '\U00002605', + "bigtriangledown;": '\U000025BD', + "bigtriangleup;": '\U000025B3', + "biguplus;": '\U00002A04', + "bigvee;": '\U000022C1', + "bigwedge;": '\U000022C0', + "bkarow;": '\U0000290D', + "blacklozenge;": '\U000029EB', + "blacksquare;": '\U000025AA', + "blacktriangle;": '\U000025B4', + "blacktriangledown;": '\U000025BE', + "blacktriangleleft;": '\U000025C2', + "blacktriangleright;": '\U000025B8', + "blank;": '\U00002423', + "blk12;": '\U00002592', + "blk14;": '\U00002591', + "blk34;": '\U00002593', + "block;": '\U00002588', + "bnot;": '\U00002310', + "bopf;": '\U0001D553', + "bot;": '\U000022A5', + "bottom;": '\U000022A5', + "bowtie;": '\U000022C8', + "boxDL;": '\U00002557', + "boxDR;": '\U00002554', + "boxDl;": '\U00002556', + "boxDr;": '\U00002553', + "boxH;": '\U00002550', + "boxHD;": '\U00002566', + "boxHU;": '\U00002569', + "boxHd;": '\U00002564', + "boxHu;": '\U00002567', + "boxUL;": '\U0000255D', + "boxUR;": '\U0000255A', + "boxUl;": '\U0000255C', + "boxUr;": '\U00002559', + "boxV;": '\U00002551', + "boxVH;": '\U0000256C', + "boxVL;": '\U00002563', + "boxVR;": '\U00002560', + "boxVh;": '\U0000256B', + "boxVl;": '\U00002562', + "boxVr;": '\U0000255F', + "boxbox;": '\U000029C9', + "boxdL;": '\U00002555', + "boxdR;": '\U00002552', + "boxdl;": '\U00002510', + "boxdr;": '\U0000250C', + "boxh;": '\U00002500', + "boxhD;": '\U00002565', + "boxhU;": '\U00002568', + "boxhd;": '\U0000252C', + "boxhu;": '\U00002534', + "boxminus;": '\U0000229F', + "boxplus;": '\U0000229E', + "boxtimes;": '\U000022A0', + "boxuL;": '\U0000255B', + "boxuR;": '\U00002558', + "boxul;": '\U00002518', + "boxur;": '\U00002514', + "boxv;": '\U00002502', + "boxvH;": '\U0000256A', + "boxvL;": '\U00002561', + "boxvR;": '\U0000255E', + "boxvh;": '\U0000253C', + "boxvl;": '\U00002524', + "boxvr;": '\U0000251C', + "bprime;": '\U00002035', + "breve;": '\U000002D8', + "brvbar;": '\U000000A6', + "bscr;": '\U0001D4B7', + "bsemi;": '\U0000204F', + "bsim;": '\U0000223D', + "bsime;": '\U000022CD', + "bsol;": '\U0000005C', + "bsolb;": '\U000029C5', + "bsolhsub;": '\U000027C8', + "bull;": '\U00002022', + "bullet;": '\U00002022', + "bump;": '\U0000224E', + "bumpE;": '\U00002AAE', + "bumpe;": '\U0000224F', + "bumpeq;": '\U0000224F', + "cacute;": '\U00000107', + "cap;": '\U00002229', + "capand;": '\U00002A44', + "capbrcup;": '\U00002A49', + "capcap;": '\U00002A4B', + "capcup;": '\U00002A47', + "capdot;": '\U00002A40', + "caret;": '\U00002041', + "caron;": '\U000002C7', + "ccaps;": '\U00002A4D', + "ccaron;": '\U0000010D', + "ccedil;": '\U000000E7', + "ccirc;": '\U00000109', + "ccups;": '\U00002A4C', + "ccupssm;": '\U00002A50', + "cdot;": '\U0000010B', + "cedil;": '\U000000B8', + "cemptyv;": '\U000029B2', + "cent;": '\U000000A2', + "centerdot;": '\U000000B7', + "cfr;": '\U0001D520', + "chcy;": '\U00000447', + "check;": '\U00002713', + "checkmark;": '\U00002713', + "chi;": '\U000003C7', + "cir;": '\U000025CB', + "cirE;": '\U000029C3', + "circ;": '\U000002C6', + "circeq;": '\U00002257', + "circlearrowleft;": '\U000021BA', + "circlearrowright;": '\U000021BB', + "circledR;": '\U000000AE', + "circledS;": '\U000024C8', + "circledast;": '\U0000229B', + "circledcirc;": '\U0000229A', + "circleddash;": '\U0000229D', + "cire;": '\U00002257', + "cirfnint;": '\U00002A10', + "cirmid;": '\U00002AEF', + "cirscir;": '\U000029C2', + "clubs;": '\U00002663', + "clubsuit;": '\U00002663', + "colon;": '\U0000003A', + "colone;": '\U00002254', + "coloneq;": '\U00002254', + "comma;": '\U0000002C', + "commat;": '\U00000040', + "comp;": '\U00002201', + "compfn;": '\U00002218', + "complement;": '\U00002201', + "complexes;": '\U00002102', + "cong;": '\U00002245', + "congdot;": '\U00002A6D', + "conint;": '\U0000222E', + "copf;": '\U0001D554', + "coprod;": '\U00002210', + "copy;": '\U000000A9', + "copysr;": '\U00002117', + "crarr;": '\U000021B5', + "cross;": '\U00002717', + "cscr;": '\U0001D4B8', + "csub;": '\U00002ACF', + "csube;": '\U00002AD1', + "csup;": '\U00002AD0', + "csupe;": '\U00002AD2', + "ctdot;": '\U000022EF', + "cudarrl;": '\U00002938', + "cudarrr;": '\U00002935', + "cuepr;": '\U000022DE', + "cuesc;": '\U000022DF', + "cularr;": '\U000021B6', + "cularrp;": '\U0000293D', + "cup;": '\U0000222A', + "cupbrcap;": '\U00002A48', + "cupcap;": '\U00002A46', + "cupcup;": '\U00002A4A', + "cupdot;": '\U0000228D', + "cupor;": '\U00002A45', + "curarr;": '\U000021B7', + "curarrm;": '\U0000293C', + "curlyeqprec;": '\U000022DE', + "curlyeqsucc;": '\U000022DF', + "curlyvee;": '\U000022CE', + "curlywedge;": '\U000022CF', + "curren;": '\U000000A4', + "curvearrowleft;": '\U000021B6', + "curvearrowright;": '\U000021B7', + "cuvee;": '\U000022CE', + "cuwed;": '\U000022CF', + "cwconint;": '\U00002232', + "cwint;": '\U00002231', + "cylcty;": '\U0000232D', + "dArr;": '\U000021D3', + "dHar;": '\U00002965', + "dagger;": '\U00002020', + "daleth;": '\U00002138', + "darr;": '\U00002193', + "dash;": '\U00002010', + "dashv;": '\U000022A3', + "dbkarow;": '\U0000290F', + "dblac;": '\U000002DD', + "dcaron;": '\U0000010F', + "dcy;": '\U00000434', + "dd;": '\U00002146', + "ddagger;": '\U00002021', + "ddarr;": '\U000021CA', + "ddotseq;": '\U00002A77', + "deg;": '\U000000B0', + "delta;": '\U000003B4', + "demptyv;": '\U000029B1', + "dfisht;": '\U0000297F', + "dfr;": '\U0001D521', + "dharl;": '\U000021C3', + "dharr;": '\U000021C2', + "diam;": '\U000022C4', + "diamond;": '\U000022C4', + "diamondsuit;": '\U00002666', + "diams;": '\U00002666', + "die;": '\U000000A8', + "digamma;": '\U000003DD', + "disin;": '\U000022F2', + "div;": '\U000000F7', + "divide;": '\U000000F7', + "divideontimes;": '\U000022C7', + "divonx;": '\U000022C7', + "djcy;": '\U00000452', + "dlcorn;": '\U0000231E', + "dlcrop;": '\U0000230D', + "dollar;": '\U00000024', + "dopf;": '\U0001D555', + "dot;": '\U000002D9', + "doteq;": '\U00002250', + "doteqdot;": '\U00002251', + "dotminus;": '\U00002238', + "dotplus;": '\U00002214', + "dotsquare;": '\U000022A1', + "doublebarwedge;": '\U00002306', + "downarrow;": '\U00002193', + "downdownarrows;": '\U000021CA', + "downharpoonleft;": '\U000021C3', + "downharpoonright;": '\U000021C2', + "drbkarow;": '\U00002910', + "drcorn;": '\U0000231F', + "drcrop;": '\U0000230C', + "dscr;": '\U0001D4B9', + "dscy;": '\U00000455', + "dsol;": '\U000029F6', + "dstrok;": '\U00000111', + "dtdot;": '\U000022F1', + "dtri;": '\U000025BF', + "dtrif;": '\U000025BE', + "duarr;": '\U000021F5', + "duhar;": '\U0000296F', + "dwangle;": '\U000029A6', + "dzcy;": '\U0000045F', + "dzigrarr;": '\U000027FF', + "eDDot;": '\U00002A77', + "eDot;": '\U00002251', + "eacute;": '\U000000E9', + "easter;": '\U00002A6E', + "ecaron;": '\U0000011B', + "ecir;": '\U00002256', + "ecirc;": '\U000000EA', + "ecolon;": '\U00002255', + "ecy;": '\U0000044D', + "edot;": '\U00000117', + "ee;": '\U00002147', + "efDot;": '\U00002252', + "efr;": '\U0001D522', + "eg;": '\U00002A9A', + "egrave;": '\U000000E8', + "egs;": '\U00002A96', + "egsdot;": '\U00002A98', + "el;": '\U00002A99', + "elinters;": '\U000023E7', + "ell;": '\U00002113', + "els;": '\U00002A95', + "elsdot;": '\U00002A97', + "emacr;": '\U00000113', + "empty;": '\U00002205', + "emptyset;": '\U00002205', + "emptyv;": '\U00002205', + "emsp;": '\U00002003', + "emsp13;": '\U00002004', + "emsp14;": '\U00002005', + "eng;": '\U0000014B', + "ensp;": '\U00002002', + "eogon;": '\U00000119', + "eopf;": '\U0001D556', + "epar;": '\U000022D5', + "eparsl;": '\U000029E3', + "eplus;": '\U00002A71', + "epsi;": '\U000003B5', + "epsilon;": '\U000003B5', + "epsiv;": '\U000003F5', + "eqcirc;": '\U00002256', + "eqcolon;": '\U00002255', + "eqsim;": '\U00002242', + "eqslantgtr;": '\U00002A96', + "eqslantless;": '\U00002A95', + "equals;": '\U0000003D', + "equest;": '\U0000225F', + "equiv;": '\U00002261', + "equivDD;": '\U00002A78', + "eqvparsl;": '\U000029E5', + "erDot;": '\U00002253', + "erarr;": '\U00002971', + "escr;": '\U0000212F', + "esdot;": '\U00002250', + "esim;": '\U00002242', + "eta;": '\U000003B7', + "eth;": '\U000000F0', + "euml;": '\U000000EB', + "euro;": '\U000020AC', + "excl;": '\U00000021', + "exist;": '\U00002203', + "expectation;": '\U00002130', + "exponentiale;": '\U00002147', + "fallingdotseq;": '\U00002252', + "fcy;": '\U00000444', + "female;": '\U00002640', + "ffilig;": '\U0000FB03', + "fflig;": '\U0000FB00', + "ffllig;": '\U0000FB04', + "ffr;": '\U0001D523', + "filig;": '\U0000FB01', + "flat;": '\U0000266D', + "fllig;": '\U0000FB02', + "fltns;": '\U000025B1', + "fnof;": '\U00000192', + "fopf;": '\U0001D557', + "forall;": '\U00002200', + "fork;": '\U000022D4', + "forkv;": '\U00002AD9', + "fpartint;": '\U00002A0D', + "frac12;": '\U000000BD', + "frac13;": '\U00002153', + "frac14;": '\U000000BC', + "frac15;": '\U00002155', + "frac16;": '\U00002159', + "frac18;": '\U0000215B', + "frac23;": '\U00002154', + "frac25;": '\U00002156', + "frac34;": '\U000000BE', + "frac35;": '\U00002157', + "frac38;": '\U0000215C', + "frac45;": '\U00002158', + "frac56;": '\U0000215A', + "frac58;": '\U0000215D', + "frac78;": '\U0000215E', + "frasl;": '\U00002044', + "frown;": '\U00002322', + "fscr;": '\U0001D4BB', + "gE;": '\U00002267', + "gEl;": '\U00002A8C', + "gacute;": '\U000001F5', + "gamma;": '\U000003B3', + "gammad;": '\U000003DD', + "gap;": '\U00002A86', + "gbreve;": '\U0000011F', + "gcirc;": '\U0000011D', + "gcy;": '\U00000433', + "gdot;": '\U00000121', + "ge;": '\U00002265', + "gel;": '\U000022DB', + "geq;": '\U00002265', + "geqq;": '\U00002267', + "geqslant;": '\U00002A7E', + "ges;": '\U00002A7E', + "gescc;": '\U00002AA9', + "gesdot;": '\U00002A80', + "gesdoto;": '\U00002A82', + "gesdotol;": '\U00002A84', + "gesles;": '\U00002A94', + "gfr;": '\U0001D524', + "gg;": '\U0000226B', + "ggg;": '\U000022D9', + "gimel;": '\U00002137', + "gjcy;": '\U00000453', + "gl;": '\U00002277', + "glE;": '\U00002A92', + "gla;": '\U00002AA5', + "glj;": '\U00002AA4', + "gnE;": '\U00002269', + "gnap;": '\U00002A8A', + "gnapprox;": '\U00002A8A', + "gne;": '\U00002A88', + "gneq;": '\U00002A88', + "gneqq;": '\U00002269', + "gnsim;": '\U000022E7', + "gopf;": '\U0001D558', + "grave;": '\U00000060', + "gscr;": '\U0000210A', + "gsim;": '\U00002273', + "gsime;": '\U00002A8E', + "gsiml;": '\U00002A90', + "gt;": '\U0000003E', + "gtcc;": '\U00002AA7', + "gtcir;": '\U00002A7A', + "gtdot;": '\U000022D7', + "gtlPar;": '\U00002995', + "gtquest;": '\U00002A7C', + "gtrapprox;": '\U00002A86', + "gtrarr;": '\U00002978', + "gtrdot;": '\U000022D7', + "gtreqless;": '\U000022DB', + "gtreqqless;": '\U00002A8C', + "gtrless;": '\U00002277', + "gtrsim;": '\U00002273', + "hArr;": '\U000021D4', + "hairsp;": '\U0000200A', + "half;": '\U000000BD', + "hamilt;": '\U0000210B', + "hardcy;": '\U0000044A', + "harr;": '\U00002194', + "harrcir;": '\U00002948', + "harrw;": '\U000021AD', + "hbar;": '\U0000210F', + "hcirc;": '\U00000125', + "hearts;": '\U00002665', + "heartsuit;": '\U00002665', + "hellip;": '\U00002026', + "hercon;": '\U000022B9', + "hfr;": '\U0001D525', + "hksearow;": '\U00002925', + "hkswarow;": '\U00002926', + "hoarr;": '\U000021FF', + "homtht;": '\U0000223B', + "hookleftarrow;": '\U000021A9', + "hookrightarrow;": '\U000021AA', + "hopf;": '\U0001D559', + "horbar;": '\U00002015', + "hscr;": '\U0001D4BD', + "hslash;": '\U0000210F', + "hstrok;": '\U00000127', + "hybull;": '\U00002043', + "hyphen;": '\U00002010', + "iacute;": '\U000000ED', + "ic;": '\U00002063', + "icirc;": '\U000000EE', + "icy;": '\U00000438', + "iecy;": '\U00000435', + "iexcl;": '\U000000A1', + "iff;": '\U000021D4', + "ifr;": '\U0001D526', + "igrave;": '\U000000EC', + "ii;": '\U00002148', + "iiiint;": '\U00002A0C', + "iiint;": '\U0000222D', + "iinfin;": '\U000029DC', + "iiota;": '\U00002129', + "ijlig;": '\U00000133', + "imacr;": '\U0000012B', + "image;": '\U00002111', + "imagline;": '\U00002110', + "imagpart;": '\U00002111', + "imath;": '\U00000131', + "imof;": '\U000022B7', + "imped;": '\U000001B5', + "in;": '\U00002208', + "incare;": '\U00002105', + "infin;": '\U0000221E', + "infintie;": '\U000029DD', + "inodot;": '\U00000131', + "int;": '\U0000222B', + "intcal;": '\U000022BA', + "integers;": '\U00002124', + "intercal;": '\U000022BA', + "intlarhk;": '\U00002A17', + "intprod;": '\U00002A3C', + "iocy;": '\U00000451', + "iogon;": '\U0000012F', + "iopf;": '\U0001D55A', + "iota;": '\U000003B9', + "iprod;": '\U00002A3C', + "iquest;": '\U000000BF', + "iscr;": '\U0001D4BE', + "isin;": '\U00002208', + "isinE;": '\U000022F9', + "isindot;": '\U000022F5', + "isins;": '\U000022F4', + "isinsv;": '\U000022F3', + "isinv;": '\U00002208', + "it;": '\U00002062', + "itilde;": '\U00000129', + "iukcy;": '\U00000456', + "iuml;": '\U000000EF', + "jcirc;": '\U00000135', + "jcy;": '\U00000439', + "jfr;": '\U0001D527', + "jmath;": '\U00000237', + "jopf;": '\U0001D55B', + "jscr;": '\U0001D4BF', + "jsercy;": '\U00000458', + "jukcy;": '\U00000454', + "kappa;": '\U000003BA', + "kappav;": '\U000003F0', + "kcedil;": '\U00000137', + "kcy;": '\U0000043A', + "kfr;": '\U0001D528', + "kgreen;": '\U00000138', + "khcy;": '\U00000445', + "kjcy;": '\U0000045C', + "kopf;": '\U0001D55C', + "kscr;": '\U0001D4C0', + "lAarr;": '\U000021DA', + "lArr;": '\U000021D0', + "lAtail;": '\U0000291B', + "lBarr;": '\U0000290E', + "lE;": '\U00002266', + "lEg;": '\U00002A8B', + "lHar;": '\U00002962', + "lacute;": '\U0000013A', + "laemptyv;": '\U000029B4', + "lagran;": '\U00002112', + "lambda;": '\U000003BB', + "lang;": '\U000027E8', + "langd;": '\U00002991', + "langle;": '\U000027E8', + "lap;": '\U00002A85', + "laquo;": '\U000000AB', + "larr;": '\U00002190', + "larrb;": '\U000021E4', + "larrbfs;": '\U0000291F', + "larrfs;": '\U0000291D', + "larrhk;": '\U000021A9', + "larrlp;": '\U000021AB', + "larrpl;": '\U00002939', + "larrsim;": '\U00002973', + "larrtl;": '\U000021A2', + "lat;": '\U00002AAB', + "latail;": '\U00002919', + "late;": '\U00002AAD', + "lbarr;": '\U0000290C', + "lbbrk;": '\U00002772', + "lbrace;": '\U0000007B', + "lbrack;": '\U0000005B', + "lbrke;": '\U0000298B', + "lbrksld;": '\U0000298F', + "lbrkslu;": '\U0000298D', + "lcaron;": '\U0000013E', + "lcedil;": '\U0000013C', + "lceil;": '\U00002308', + "lcub;": '\U0000007B', + "lcy;": '\U0000043B', + "ldca;": '\U00002936', + "ldquo;": '\U0000201C', + "ldquor;": '\U0000201E', + "ldrdhar;": '\U00002967', + "ldrushar;": '\U0000294B', + "ldsh;": '\U000021B2', + "le;": '\U00002264', + "leftarrow;": '\U00002190', + "leftarrowtail;": '\U000021A2', + "leftharpoondown;": '\U000021BD', + "leftharpoonup;": '\U000021BC', + "leftleftarrows;": '\U000021C7', + "leftrightarrow;": '\U00002194', + "leftrightarrows;": '\U000021C6', + "leftrightharpoons;": '\U000021CB', + "leftrightsquigarrow;": '\U000021AD', + "leftthreetimes;": '\U000022CB', + "leg;": '\U000022DA', + "leq;": '\U00002264', + "leqq;": '\U00002266', + "leqslant;": '\U00002A7D', + "les;": '\U00002A7D', + "lescc;": '\U00002AA8', + "lesdot;": '\U00002A7F', + "lesdoto;": '\U00002A81', + "lesdotor;": '\U00002A83', + "lesges;": '\U00002A93', + "lessapprox;": '\U00002A85', + "lessdot;": '\U000022D6', + "lesseqgtr;": '\U000022DA', + "lesseqqgtr;": '\U00002A8B', + "lessgtr;": '\U00002276', + "lesssim;": '\U00002272', + "lfisht;": '\U0000297C', + "lfloor;": '\U0000230A', + "lfr;": '\U0001D529', + "lg;": '\U00002276', + "lgE;": '\U00002A91', + "lhard;": '\U000021BD', + "lharu;": '\U000021BC', + "lharul;": '\U0000296A', + "lhblk;": '\U00002584', + "ljcy;": '\U00000459', + "ll;": '\U0000226A', + "llarr;": '\U000021C7', + "llcorner;": '\U0000231E', + "llhard;": '\U0000296B', + "lltri;": '\U000025FA', + "lmidot;": '\U00000140', + "lmoust;": '\U000023B0', + "lmoustache;": '\U000023B0', + "lnE;": '\U00002268', + "lnap;": '\U00002A89', + "lnapprox;": '\U00002A89', + "lne;": '\U00002A87', + "lneq;": '\U00002A87', + "lneqq;": '\U00002268', + "lnsim;": '\U000022E6', + "loang;": '\U000027EC', + "loarr;": '\U000021FD', + "lobrk;": '\U000027E6', + "longleftarrow;": '\U000027F5', + "longleftrightarrow;": '\U000027F7', + "longmapsto;": '\U000027FC', + "longrightarrow;": '\U000027F6', + "looparrowleft;": '\U000021AB', + "looparrowright;": '\U000021AC', + "lopar;": '\U00002985', + "lopf;": '\U0001D55D', + "loplus;": '\U00002A2D', + "lotimes;": '\U00002A34', + "lowast;": '\U00002217', + "lowbar;": '\U0000005F', + "loz;": '\U000025CA', + "lozenge;": '\U000025CA', + "lozf;": '\U000029EB', + "lpar;": '\U00000028', + "lparlt;": '\U00002993', + "lrarr;": '\U000021C6', + "lrcorner;": '\U0000231F', + "lrhar;": '\U000021CB', + "lrhard;": '\U0000296D', + "lrm;": '\U0000200E', + "lrtri;": '\U000022BF', + "lsaquo;": '\U00002039', + "lscr;": '\U0001D4C1', + "lsh;": '\U000021B0', + "lsim;": '\U00002272', + "lsime;": '\U00002A8D', + "lsimg;": '\U00002A8F', + "lsqb;": '\U0000005B', + "lsquo;": '\U00002018', + "lsquor;": '\U0000201A', + "lstrok;": '\U00000142', + "lt;": '\U0000003C', + "ltcc;": '\U00002AA6', + "ltcir;": '\U00002A79', + "ltdot;": '\U000022D6', + "lthree;": '\U000022CB', + "ltimes;": '\U000022C9', + "ltlarr;": '\U00002976', + "ltquest;": '\U00002A7B', + "ltrPar;": '\U00002996', + "ltri;": '\U000025C3', + "ltrie;": '\U000022B4', + "ltrif;": '\U000025C2', + "lurdshar;": '\U0000294A', + "luruhar;": '\U00002966', + "mDDot;": '\U0000223A', + "macr;": '\U000000AF', + "male;": '\U00002642', + "malt;": '\U00002720', + "maltese;": '\U00002720', + "map;": '\U000021A6', + "mapsto;": '\U000021A6', + "mapstodown;": '\U000021A7', + "mapstoleft;": '\U000021A4', + "mapstoup;": '\U000021A5', + "marker;": '\U000025AE', + "mcomma;": '\U00002A29', + "mcy;": '\U0000043C', + "mdash;": '\U00002014', + "measuredangle;": '\U00002221', + "mfr;": '\U0001D52A', + "mho;": '\U00002127', + "micro;": '\U000000B5', + "mid;": '\U00002223', + "midast;": '\U0000002A', + "midcir;": '\U00002AF0', + "middot;": '\U000000B7', + "minus;": '\U00002212', + "minusb;": '\U0000229F', + "minusd;": '\U00002238', + "minusdu;": '\U00002A2A', + "mlcp;": '\U00002ADB', + "mldr;": '\U00002026', + "mnplus;": '\U00002213', + "models;": '\U000022A7', + "mopf;": '\U0001D55E', + "mp;": '\U00002213', + "mscr;": '\U0001D4C2', + "mstpos;": '\U0000223E', + "mu;": '\U000003BC', + "multimap;": '\U000022B8', + "mumap;": '\U000022B8', + "nLeftarrow;": '\U000021CD', + "nLeftrightarrow;": '\U000021CE', + "nRightarrow;": '\U000021CF', + "nVDash;": '\U000022AF', + "nVdash;": '\U000022AE', + "nabla;": '\U00002207', + "nacute;": '\U00000144', + "nap;": '\U00002249', + "napos;": '\U00000149', + "napprox;": '\U00002249', + "natur;": '\U0000266E', + "natural;": '\U0000266E', + "naturals;": '\U00002115', + "nbsp;": '\U000000A0', + "ncap;": '\U00002A43', + "ncaron;": '\U00000148', + "ncedil;": '\U00000146', + "ncong;": '\U00002247', + "ncup;": '\U00002A42', + "ncy;": '\U0000043D', + "ndash;": '\U00002013', + "ne;": '\U00002260', + "neArr;": '\U000021D7', + "nearhk;": '\U00002924', + "nearr;": '\U00002197', + "nearrow;": '\U00002197', + "nequiv;": '\U00002262', + "nesear;": '\U00002928', + "nexist;": '\U00002204', + "nexists;": '\U00002204', + "nfr;": '\U0001D52B', + "nge;": '\U00002271', + "ngeq;": '\U00002271', + "ngsim;": '\U00002275', + "ngt;": '\U0000226F', + "ngtr;": '\U0000226F', + "nhArr;": '\U000021CE', + "nharr;": '\U000021AE', + "nhpar;": '\U00002AF2', + "ni;": '\U0000220B', + "nis;": '\U000022FC', + "nisd;": '\U000022FA', + "niv;": '\U0000220B', + "njcy;": '\U0000045A', + "nlArr;": '\U000021CD', + "nlarr;": '\U0000219A', + "nldr;": '\U00002025', + "nle;": '\U00002270', + "nleftarrow;": '\U0000219A', + "nleftrightarrow;": '\U000021AE', + "nleq;": '\U00002270', + "nless;": '\U0000226E', + "nlsim;": '\U00002274', + "nlt;": '\U0000226E', + "nltri;": '\U000022EA', + "nltrie;": '\U000022EC', + "nmid;": '\U00002224', + "nopf;": '\U0001D55F', + "not;": '\U000000AC', + "notin;": '\U00002209', + "notinva;": '\U00002209', + "notinvb;": '\U000022F7', + "notinvc;": '\U000022F6', + "notni;": '\U0000220C', + "notniva;": '\U0000220C', + "notnivb;": '\U000022FE', + "notnivc;": '\U000022FD', + "npar;": '\U00002226', + "nparallel;": '\U00002226', + "npolint;": '\U00002A14', + "npr;": '\U00002280', + "nprcue;": '\U000022E0', + "nprec;": '\U00002280', + "nrArr;": '\U000021CF', + "nrarr;": '\U0000219B', + "nrightarrow;": '\U0000219B', + "nrtri;": '\U000022EB', + "nrtrie;": '\U000022ED', + "nsc;": '\U00002281', + "nsccue;": '\U000022E1', + "nscr;": '\U0001D4C3', + "nshortmid;": '\U00002224', + "nshortparallel;": '\U00002226', + "nsim;": '\U00002241', + "nsime;": '\U00002244', + "nsimeq;": '\U00002244', + "nsmid;": '\U00002224', + "nspar;": '\U00002226', + "nsqsube;": '\U000022E2', + "nsqsupe;": '\U000022E3', + "nsub;": '\U00002284', + "nsube;": '\U00002288', + "nsubseteq;": '\U00002288', + "nsucc;": '\U00002281', + "nsup;": '\U00002285', + "nsupe;": '\U00002289', + "nsupseteq;": '\U00002289', + "ntgl;": '\U00002279', + "ntilde;": '\U000000F1', + "ntlg;": '\U00002278', + "ntriangleleft;": '\U000022EA', + "ntrianglelefteq;": '\U000022EC', + "ntriangleright;": '\U000022EB', + "ntrianglerighteq;": '\U000022ED', + "nu;": '\U000003BD', + "num;": '\U00000023', + "numero;": '\U00002116', + "numsp;": '\U00002007', + "nvDash;": '\U000022AD', + "nvHarr;": '\U00002904', + "nvdash;": '\U000022AC', + "nvinfin;": '\U000029DE', + "nvlArr;": '\U00002902', + "nvrArr;": '\U00002903', + "nwArr;": '\U000021D6', + "nwarhk;": '\U00002923', + "nwarr;": '\U00002196', + "nwarrow;": '\U00002196', + "nwnear;": '\U00002927', + "oS;": '\U000024C8', + "oacute;": '\U000000F3', + "oast;": '\U0000229B', + "ocir;": '\U0000229A', + "ocirc;": '\U000000F4', + "ocy;": '\U0000043E', + "odash;": '\U0000229D', + "odblac;": '\U00000151', + "odiv;": '\U00002A38', + "odot;": '\U00002299', + "odsold;": '\U000029BC', + "oelig;": '\U00000153', + "ofcir;": '\U000029BF', + "ofr;": '\U0001D52C', + "ogon;": '\U000002DB', + "ograve;": '\U000000F2', + "ogt;": '\U000029C1', + "ohbar;": '\U000029B5', + "ohm;": '\U000003A9', + "oint;": '\U0000222E', + "olarr;": '\U000021BA', + "olcir;": '\U000029BE', + "olcross;": '\U000029BB', + "oline;": '\U0000203E', + "olt;": '\U000029C0', + "omacr;": '\U0000014D', + "omega;": '\U000003C9', + "omicron;": '\U000003BF', + "omid;": '\U000029B6', + "ominus;": '\U00002296', + "oopf;": '\U0001D560', + "opar;": '\U000029B7', + "operp;": '\U000029B9', + "oplus;": '\U00002295', + "or;": '\U00002228', + "orarr;": '\U000021BB', + "ord;": '\U00002A5D', + "order;": '\U00002134', + "orderof;": '\U00002134', + "ordf;": '\U000000AA', + "ordm;": '\U000000BA', + "origof;": '\U000022B6', + "oror;": '\U00002A56', + "orslope;": '\U00002A57', + "orv;": '\U00002A5B', + "oscr;": '\U00002134', + "oslash;": '\U000000F8', + "osol;": '\U00002298', + "otilde;": '\U000000F5', + "otimes;": '\U00002297', + "otimesas;": '\U00002A36', + "ouml;": '\U000000F6', + "ovbar;": '\U0000233D', + "par;": '\U00002225', + "para;": '\U000000B6', + "parallel;": '\U00002225', + "parsim;": '\U00002AF3', + "parsl;": '\U00002AFD', + "part;": '\U00002202', + "pcy;": '\U0000043F', + "percnt;": '\U00000025', + "period;": '\U0000002E', + "permil;": '\U00002030', + "perp;": '\U000022A5', + "pertenk;": '\U00002031', + "pfr;": '\U0001D52D', + "phi;": '\U000003C6', + "phiv;": '\U000003D5', + "phmmat;": '\U00002133', + "phone;": '\U0000260E', + "pi;": '\U000003C0', + "pitchfork;": '\U000022D4', + "piv;": '\U000003D6', + "planck;": '\U0000210F', + "planckh;": '\U0000210E', + "plankv;": '\U0000210F', + "plus;": '\U0000002B', + "plusacir;": '\U00002A23', + "plusb;": '\U0000229E', + "pluscir;": '\U00002A22', + "plusdo;": '\U00002214', + "plusdu;": '\U00002A25', + "pluse;": '\U00002A72', + "plusmn;": '\U000000B1', + "plussim;": '\U00002A26', + "plustwo;": '\U00002A27', + "pm;": '\U000000B1', + "pointint;": '\U00002A15', + "popf;": '\U0001D561', + "pound;": '\U000000A3', + "pr;": '\U0000227A', + "prE;": '\U00002AB3', + "prap;": '\U00002AB7', + "prcue;": '\U0000227C', + "pre;": '\U00002AAF', + "prec;": '\U0000227A', + "precapprox;": '\U00002AB7', + "preccurlyeq;": '\U0000227C', + "preceq;": '\U00002AAF', + "precnapprox;": '\U00002AB9', + "precneqq;": '\U00002AB5', + "precnsim;": '\U000022E8', + "precsim;": '\U0000227E', + "prime;": '\U00002032', + "primes;": '\U00002119', + "prnE;": '\U00002AB5', + "prnap;": '\U00002AB9', + "prnsim;": '\U000022E8', + "prod;": '\U0000220F', + "profalar;": '\U0000232E', + "profline;": '\U00002312', + "profsurf;": '\U00002313', + "prop;": '\U0000221D', + "propto;": '\U0000221D', + "prsim;": '\U0000227E', + "prurel;": '\U000022B0', + "pscr;": '\U0001D4C5', + "psi;": '\U000003C8', + "puncsp;": '\U00002008', + "qfr;": '\U0001D52E', + "qint;": '\U00002A0C', + "qopf;": '\U0001D562', + "qprime;": '\U00002057', + "qscr;": '\U0001D4C6', + "quaternions;": '\U0000210D', + "quatint;": '\U00002A16', + "quest;": '\U0000003F', + "questeq;": '\U0000225F', + "quot;": '\U00000022', + "rAarr;": '\U000021DB', + "rArr;": '\U000021D2', + "rAtail;": '\U0000291C', + "rBarr;": '\U0000290F', + "rHar;": '\U00002964', + "racute;": '\U00000155', + "radic;": '\U0000221A', + "raemptyv;": '\U000029B3', + "rang;": '\U000027E9', + "rangd;": '\U00002992', + "range;": '\U000029A5', + "rangle;": '\U000027E9', + "raquo;": '\U000000BB', + "rarr;": '\U00002192', + "rarrap;": '\U00002975', + "rarrb;": '\U000021E5', + "rarrbfs;": '\U00002920', + "rarrc;": '\U00002933', + "rarrfs;": '\U0000291E', + "rarrhk;": '\U000021AA', + "rarrlp;": '\U000021AC', + "rarrpl;": '\U00002945', + "rarrsim;": '\U00002974', + "rarrtl;": '\U000021A3', + "rarrw;": '\U0000219D', + "ratail;": '\U0000291A', + "ratio;": '\U00002236', + "rationals;": '\U0000211A', + "rbarr;": '\U0000290D', + "rbbrk;": '\U00002773', + "rbrace;": '\U0000007D', + "rbrack;": '\U0000005D', + "rbrke;": '\U0000298C', + "rbrksld;": '\U0000298E', + "rbrkslu;": '\U00002990', + "rcaron;": '\U00000159', + "rcedil;": '\U00000157', + "rceil;": '\U00002309', + "rcub;": '\U0000007D', + "rcy;": '\U00000440', + "rdca;": '\U00002937', + "rdldhar;": '\U00002969', + "rdquo;": '\U0000201D', + "rdquor;": '\U0000201D', + "rdsh;": '\U000021B3', + "real;": '\U0000211C', + "realine;": '\U0000211B', + "realpart;": '\U0000211C', + "reals;": '\U0000211D', + "rect;": '\U000025AD', + "reg;": '\U000000AE', + "rfisht;": '\U0000297D', + "rfloor;": '\U0000230B', + "rfr;": '\U0001D52F', + "rhard;": '\U000021C1', + "rharu;": '\U000021C0', + "rharul;": '\U0000296C', + "rho;": '\U000003C1', + "rhov;": '\U000003F1', + "rightarrow;": '\U00002192', + "rightarrowtail;": '\U000021A3', + "rightharpoondown;": '\U000021C1', + "rightharpoonup;": '\U000021C0', + "rightleftarrows;": '\U000021C4', + "rightleftharpoons;": '\U000021CC', + "rightrightarrows;": '\U000021C9', + "rightsquigarrow;": '\U0000219D', + "rightthreetimes;": '\U000022CC', + "ring;": '\U000002DA', + "risingdotseq;": '\U00002253', + "rlarr;": '\U000021C4', + "rlhar;": '\U000021CC', + "rlm;": '\U0000200F', + "rmoust;": '\U000023B1', + "rmoustache;": '\U000023B1', + "rnmid;": '\U00002AEE', + "roang;": '\U000027ED', + "roarr;": '\U000021FE', + "robrk;": '\U000027E7', + "ropar;": '\U00002986', + "ropf;": '\U0001D563', + "roplus;": '\U00002A2E', + "rotimes;": '\U00002A35', + "rpar;": '\U00000029', + "rpargt;": '\U00002994', + "rppolint;": '\U00002A12', + "rrarr;": '\U000021C9', + "rsaquo;": '\U0000203A', + "rscr;": '\U0001D4C7', + "rsh;": '\U000021B1', + "rsqb;": '\U0000005D', + "rsquo;": '\U00002019', + "rsquor;": '\U00002019', + "rthree;": '\U000022CC', + "rtimes;": '\U000022CA', + "rtri;": '\U000025B9', + "rtrie;": '\U000022B5', + "rtrif;": '\U000025B8', + "rtriltri;": '\U000029CE', + "ruluhar;": '\U00002968', + "rx;": '\U0000211E', + "sacute;": '\U0000015B', + "sbquo;": '\U0000201A', + "sc;": '\U0000227B', + "scE;": '\U00002AB4', + "scap;": '\U00002AB8', + "scaron;": '\U00000161', + "sccue;": '\U0000227D', + "sce;": '\U00002AB0', + "scedil;": '\U0000015F', + "scirc;": '\U0000015D', + "scnE;": '\U00002AB6', + "scnap;": '\U00002ABA', + "scnsim;": '\U000022E9', + "scpolint;": '\U00002A13', + "scsim;": '\U0000227F', + "scy;": '\U00000441', + "sdot;": '\U000022C5', + "sdotb;": '\U000022A1', + "sdote;": '\U00002A66', + "seArr;": '\U000021D8', + "searhk;": '\U00002925', + "searr;": '\U00002198', + "searrow;": '\U00002198', + "sect;": '\U000000A7', + "semi;": '\U0000003B', + "seswar;": '\U00002929', + "setminus;": '\U00002216', + "setmn;": '\U00002216', + "sext;": '\U00002736', + "sfr;": '\U0001D530', + "sfrown;": '\U00002322', + "sharp;": '\U0000266F', + "shchcy;": '\U00000449', + "shcy;": '\U00000448', + "shortmid;": '\U00002223', + "shortparallel;": '\U00002225', + "shy;": '\U000000AD', + "sigma;": '\U000003C3', + "sigmaf;": '\U000003C2', + "sigmav;": '\U000003C2', + "sim;": '\U0000223C', + "simdot;": '\U00002A6A', + "sime;": '\U00002243', + "simeq;": '\U00002243', + "simg;": '\U00002A9E', + "simgE;": '\U00002AA0', + "siml;": '\U00002A9D', + "simlE;": '\U00002A9F', + "simne;": '\U00002246', + "simplus;": '\U00002A24', + "simrarr;": '\U00002972', + "slarr;": '\U00002190', + "smallsetminus;": '\U00002216', + "smashp;": '\U00002A33', + "smeparsl;": '\U000029E4', + "smid;": '\U00002223', + "smile;": '\U00002323', + "smt;": '\U00002AAA', + "smte;": '\U00002AAC', + "softcy;": '\U0000044C', + "sol;": '\U0000002F', + "solb;": '\U000029C4', + "solbar;": '\U0000233F', + "sopf;": '\U0001D564', + "spades;": '\U00002660', + "spadesuit;": '\U00002660', + "spar;": '\U00002225', + "sqcap;": '\U00002293', + "sqcup;": '\U00002294', + "sqsub;": '\U0000228F', + "sqsube;": '\U00002291', + "sqsubset;": '\U0000228F', + "sqsubseteq;": '\U00002291', + "sqsup;": '\U00002290', + "sqsupe;": '\U00002292', + "sqsupset;": '\U00002290', + "sqsupseteq;": '\U00002292', + "squ;": '\U000025A1', + "square;": '\U000025A1', + "squarf;": '\U000025AA', + "squf;": '\U000025AA', + "srarr;": '\U00002192', + "sscr;": '\U0001D4C8', + "ssetmn;": '\U00002216', + "ssmile;": '\U00002323', + "sstarf;": '\U000022C6', + "star;": '\U00002606', + "starf;": '\U00002605', + "straightepsilon;": '\U000003F5', + "straightphi;": '\U000003D5', + "strns;": '\U000000AF', + "sub;": '\U00002282', + "subE;": '\U00002AC5', + "subdot;": '\U00002ABD', + "sube;": '\U00002286', + "subedot;": '\U00002AC3', + "submult;": '\U00002AC1', + "subnE;": '\U00002ACB', + "subne;": '\U0000228A', + "subplus;": '\U00002ABF', + "subrarr;": '\U00002979', + "subset;": '\U00002282', + "subseteq;": '\U00002286', + "subseteqq;": '\U00002AC5', + "subsetneq;": '\U0000228A', + "subsetneqq;": '\U00002ACB', + "subsim;": '\U00002AC7', + "subsub;": '\U00002AD5', + "subsup;": '\U00002AD3', + "succ;": '\U0000227B', + "succapprox;": '\U00002AB8', + "succcurlyeq;": '\U0000227D', + "succeq;": '\U00002AB0', + "succnapprox;": '\U00002ABA', + "succneqq;": '\U00002AB6', + "succnsim;": '\U000022E9', + "succsim;": '\U0000227F', + "sum;": '\U00002211', + "sung;": '\U0000266A', + "sup;": '\U00002283', + "sup1;": '\U000000B9', + "sup2;": '\U000000B2', + "sup3;": '\U000000B3', + "supE;": '\U00002AC6', + "supdot;": '\U00002ABE', + "supdsub;": '\U00002AD8', + "supe;": '\U00002287', + "supedot;": '\U00002AC4', + "suphsol;": '\U000027C9', + "suphsub;": '\U00002AD7', + "suplarr;": '\U0000297B', + "supmult;": '\U00002AC2', + "supnE;": '\U00002ACC', + "supne;": '\U0000228B', + "supplus;": '\U00002AC0', + "supset;": '\U00002283', + "supseteq;": '\U00002287', + "supseteqq;": '\U00002AC6', + "supsetneq;": '\U0000228B', + "supsetneqq;": '\U00002ACC', + "supsim;": '\U00002AC8', + "supsub;": '\U00002AD4', + "supsup;": '\U00002AD6', + "swArr;": '\U000021D9', + "swarhk;": '\U00002926', + "swarr;": '\U00002199', + "swarrow;": '\U00002199', + "swnwar;": '\U0000292A', + "szlig;": '\U000000DF', + "target;": '\U00002316', + "tau;": '\U000003C4', + "tbrk;": '\U000023B4', + "tcaron;": '\U00000165', + "tcedil;": '\U00000163', + "tcy;": '\U00000442', + "tdot;": '\U000020DB', + "telrec;": '\U00002315', + "tfr;": '\U0001D531', + "there4;": '\U00002234', + "therefore;": '\U00002234', + "theta;": '\U000003B8', + "thetasym;": '\U000003D1', + "thetav;": '\U000003D1', + "thickapprox;": '\U00002248', + "thicksim;": '\U0000223C', + "thinsp;": '\U00002009', + "thkap;": '\U00002248', + "thksim;": '\U0000223C', + "thorn;": '\U000000FE', + "tilde;": '\U000002DC', + "times;": '\U000000D7', + "timesb;": '\U000022A0', + "timesbar;": '\U00002A31', + "timesd;": '\U00002A30', + "tint;": '\U0000222D', + "toea;": '\U00002928', + "top;": '\U000022A4', + "topbot;": '\U00002336', + "topcir;": '\U00002AF1', + "topf;": '\U0001D565', + "topfork;": '\U00002ADA', + "tosa;": '\U00002929', + "tprime;": '\U00002034', + "trade;": '\U00002122', + "triangle;": '\U000025B5', + "triangledown;": '\U000025BF', + "triangleleft;": '\U000025C3', + "trianglelefteq;": '\U000022B4', + "triangleq;": '\U0000225C', + "triangleright;": '\U000025B9', + "trianglerighteq;": '\U000022B5', + "tridot;": '\U000025EC', + "trie;": '\U0000225C', + "triminus;": '\U00002A3A', + "triplus;": '\U00002A39', + "trisb;": '\U000029CD', + "tritime;": '\U00002A3B', + "trpezium;": '\U000023E2', + "tscr;": '\U0001D4C9', + "tscy;": '\U00000446', + "tshcy;": '\U0000045B', + "tstrok;": '\U00000167', + "twixt;": '\U0000226C', + "twoheadleftarrow;": '\U0000219E', + "twoheadrightarrow;": '\U000021A0', + "uArr;": '\U000021D1', + "uHar;": '\U00002963', + "uacute;": '\U000000FA', + "uarr;": '\U00002191', + "ubrcy;": '\U0000045E', + "ubreve;": '\U0000016D', + "ucirc;": '\U000000FB', + "ucy;": '\U00000443', + "udarr;": '\U000021C5', + "udblac;": '\U00000171', + "udhar;": '\U0000296E', + "ufisht;": '\U0000297E', + "ufr;": '\U0001D532', + "ugrave;": '\U000000F9', + "uharl;": '\U000021BF', + "uharr;": '\U000021BE', + "uhblk;": '\U00002580', + "ulcorn;": '\U0000231C', + "ulcorner;": '\U0000231C', + "ulcrop;": '\U0000230F', + "ultri;": '\U000025F8', + "umacr;": '\U0000016B', + "uml;": '\U000000A8', + "uogon;": '\U00000173', + "uopf;": '\U0001D566', + "uparrow;": '\U00002191', + "updownarrow;": '\U00002195', + "upharpoonleft;": '\U000021BF', + "upharpoonright;": '\U000021BE', + "uplus;": '\U0000228E', + "upsi;": '\U000003C5', + "upsih;": '\U000003D2', + "upsilon;": '\U000003C5', + "upuparrows;": '\U000021C8', + "urcorn;": '\U0000231D', + "urcorner;": '\U0000231D', + "urcrop;": '\U0000230E', + "uring;": '\U0000016F', + "urtri;": '\U000025F9', + "uscr;": '\U0001D4CA', + "utdot;": '\U000022F0', + "utilde;": '\U00000169', + "utri;": '\U000025B5', + "utrif;": '\U000025B4', + "uuarr;": '\U000021C8', + "uuml;": '\U000000FC', + "uwangle;": '\U000029A7', + "vArr;": '\U000021D5', + "vBar;": '\U00002AE8', + "vBarv;": '\U00002AE9', + "vDash;": '\U000022A8', + "vangrt;": '\U0000299C', + "varepsilon;": '\U000003F5', + "varkappa;": '\U000003F0', + "varnothing;": '\U00002205', + "varphi;": '\U000003D5', + "varpi;": '\U000003D6', + "varpropto;": '\U0000221D', + "varr;": '\U00002195', + "varrho;": '\U000003F1', + "varsigma;": '\U000003C2', + "vartheta;": '\U000003D1', + "vartriangleleft;": '\U000022B2', + "vartriangleright;": '\U000022B3', + "vcy;": '\U00000432', + "vdash;": '\U000022A2', + "vee;": '\U00002228', + "veebar;": '\U000022BB', + "veeeq;": '\U0000225A', + "vellip;": '\U000022EE', + "verbar;": '\U0000007C', + "vert;": '\U0000007C', + "vfr;": '\U0001D533', + "vltri;": '\U000022B2', + "vopf;": '\U0001D567', + "vprop;": '\U0000221D', + "vrtri;": '\U000022B3', + "vscr;": '\U0001D4CB', + "vzigzag;": '\U0000299A', + "wcirc;": '\U00000175', + "wedbar;": '\U00002A5F', + "wedge;": '\U00002227', + "wedgeq;": '\U00002259', + "weierp;": '\U00002118', + "wfr;": '\U0001D534', + "wopf;": '\U0001D568', + "wp;": '\U00002118', + "wr;": '\U00002240', + "wreath;": '\U00002240', + "wscr;": '\U0001D4CC', + "xcap;": '\U000022C2', + "xcirc;": '\U000025EF', + "xcup;": '\U000022C3', + "xdtri;": '\U000025BD', + "xfr;": '\U0001D535', + "xhArr;": '\U000027FA', + "xharr;": '\U000027F7', + "xi;": '\U000003BE', + "xlArr;": '\U000027F8', + "xlarr;": '\U000027F5', + "xmap;": '\U000027FC', + "xnis;": '\U000022FB', + "xodot;": '\U00002A00', + "xopf;": '\U0001D569', + "xoplus;": '\U00002A01', + "xotime;": '\U00002A02', + "xrArr;": '\U000027F9', + "xrarr;": '\U000027F6', + "xscr;": '\U0001D4CD', + "xsqcup;": '\U00002A06', + "xuplus;": '\U00002A04', + "xutri;": '\U000025B3', + "xvee;": '\U000022C1', + "xwedge;": '\U000022C0', + "yacute;": '\U000000FD', + "yacy;": '\U0000044F', + "ycirc;": '\U00000177', + "ycy;": '\U0000044B', + "yen;": '\U000000A5', + "yfr;": '\U0001D536', + "yicy;": '\U00000457', + "yopf;": '\U0001D56A', + "yscr;": '\U0001D4CE', + "yucy;": '\U0000044E', + "yuml;": '\U000000FF', + "zacute;": '\U0000017A', + "zcaron;": '\U0000017E', + "zcy;": '\U00000437', + "zdot;": '\U0000017C', + "zeetrf;": '\U00002128', + "zeta;": '\U000003B6', + "zfr;": '\U0001D537', + "zhcy;": '\U00000436', + "zigrarr;": '\U000021DD', + "zopf;": '\U0001D56B', + "zscr;": '\U0001D4CF', + "zwj;": '\U0000200D', + "zwnj;": '\U0000200C', + "AElig": '\U000000C6', + "AMP": '\U00000026', + "Aacute": '\U000000C1', + "Acirc": '\U000000C2', + "Agrave": '\U000000C0', + "Aring": '\U000000C5', + "Atilde": '\U000000C3', + "Auml": '\U000000C4', + "COPY": '\U000000A9', + "Ccedil": '\U000000C7', + "ETH": '\U000000D0', + "Eacute": '\U000000C9', + "Ecirc": '\U000000CA', + "Egrave": '\U000000C8', + "Euml": '\U000000CB', + "GT": '\U0000003E', + "Iacute": '\U000000CD', + "Icirc": '\U000000CE', + "Igrave": '\U000000CC', + "Iuml": '\U000000CF', + "LT": '\U0000003C', + "Ntilde": '\U000000D1', + "Oacute": '\U000000D3', + "Ocirc": '\U000000D4', + "Ograve": '\U000000D2', + "Oslash": '\U000000D8', + "Otilde": '\U000000D5', + "Ouml": '\U000000D6', + "QUOT": '\U00000022', + "REG": '\U000000AE', + "THORN": '\U000000DE', + "Uacute": '\U000000DA', + "Ucirc": '\U000000DB', + "Ugrave": '\U000000D9', + "Uuml": '\U000000DC', + "Yacute": '\U000000DD', + "aacute": '\U000000E1', + "acirc": '\U000000E2', + "acute": '\U000000B4', + "aelig": '\U000000E6', + "agrave": '\U000000E0', + "amp": '\U00000026', + "aring": '\U000000E5', + "atilde": '\U000000E3', + "auml": '\U000000E4', + "brvbar": '\U000000A6', + "ccedil": '\U000000E7', + "cedil": '\U000000B8', + "cent": '\U000000A2', + "copy": '\U000000A9', + "curren": '\U000000A4', + "deg": '\U000000B0', + "divide": '\U000000F7', + "eacute": '\U000000E9', + "ecirc": '\U000000EA', + "egrave": '\U000000E8', + "eth": '\U000000F0', + "euml": '\U000000EB', + "frac12": '\U000000BD', + "frac14": '\U000000BC', + "frac34": '\U000000BE', + "gt": '\U0000003E', + "iacute": '\U000000ED', + "icirc": '\U000000EE', + "iexcl": '\U000000A1', + "igrave": '\U000000EC', + "iquest": '\U000000BF', + "iuml": '\U000000EF', + "laquo": '\U000000AB', + "lt": '\U0000003C', + "macr": '\U000000AF', + "micro": '\U000000B5', + "middot": '\U000000B7', + "nbsp": '\U000000A0', + "not": '\U000000AC', + "ntilde": '\U000000F1', + "oacute": '\U000000F3', + "ocirc": '\U000000F4', + "ograve": '\U000000F2', + "ordf": '\U000000AA', + "ordm": '\U000000BA', + "oslash": '\U000000F8', + "otilde": '\U000000F5', + "ouml": '\U000000F6', + "para": '\U000000B6', + "plusmn": '\U000000B1', + "pound": '\U000000A3', + "quot": '\U00000022', + "raquo": '\U000000BB', + "reg": '\U000000AE', + "sect": '\U000000A7', + "shy": '\U000000AD', + "sup1": '\U000000B9', + "sup2": '\U000000B2', + "sup3": '\U000000B3', + "szlig": '\U000000DF', + "thorn": '\U000000FE', + "times": '\U000000D7', + "uacute": '\U000000FA', + "ucirc": '\U000000FB', + "ugrave": '\U000000F9', + "uml": '\U000000A8', + "uuml": '\U000000FC', + "yacute": '\U000000FD', + "yen": '\U000000A5', + "yuml": '\U000000FF', +} + +// HTML entities that are two unicode codepoints. +var entity2 = map[string][2]rune{ + // TODO(nigeltao): Handle replacements that are wider than their names. + // "nLt;": {'\u226A', '\u20D2'}, + // "nGt;": {'\u226B', '\u20D2'}, + "NotEqualTilde;": {'\u2242', '\u0338'}, + "NotGreaterFullEqual;": {'\u2267', '\u0338'}, + "NotGreaterGreater;": {'\u226B', '\u0338'}, + "NotGreaterSlantEqual;": {'\u2A7E', '\u0338'}, + "NotHumpDownHump;": {'\u224E', '\u0338'}, + "NotHumpEqual;": {'\u224F', '\u0338'}, + "NotLeftTriangleBar;": {'\u29CF', '\u0338'}, + "NotLessLess;": {'\u226A', '\u0338'}, + "NotLessSlantEqual;": {'\u2A7D', '\u0338'}, + "NotNestedGreaterGreater;": {'\u2AA2', '\u0338'}, + "NotNestedLessLess;": {'\u2AA1', '\u0338'}, + "NotPrecedesEqual;": {'\u2AAF', '\u0338'}, + "NotRightTriangleBar;": {'\u29D0', '\u0338'}, + "NotSquareSubset;": {'\u228F', '\u0338'}, + "NotSquareSuperset;": {'\u2290', '\u0338'}, + "NotSubset;": {'\u2282', '\u20D2'}, + "NotSucceedsEqual;": {'\u2AB0', '\u0338'}, + "NotSucceedsTilde;": {'\u227F', '\u0338'}, + "NotSuperset;": {'\u2283', '\u20D2'}, + "ThickSpace;": {'\u205F', '\u200A'}, + "acE;": {'\u223E', '\u0333'}, + "bne;": {'\u003D', '\u20E5'}, + "bnequiv;": {'\u2261', '\u20E5'}, + "caps;": {'\u2229', '\uFE00'}, + "cups;": {'\u222A', '\uFE00'}, + "fjlig;": {'\u0066', '\u006A'}, + "gesl;": {'\u22DB', '\uFE00'}, + "gvertneqq;": {'\u2269', '\uFE00'}, + "gvnE;": {'\u2269', '\uFE00'}, + "lates;": {'\u2AAD', '\uFE00'}, + "lesg;": {'\u22DA', '\uFE00'}, + "lvertneqq;": {'\u2268', '\uFE00'}, + "lvnE;": {'\u2268', '\uFE00'}, + "nGg;": {'\u22D9', '\u0338'}, + "nGtv;": {'\u226B', '\u0338'}, + "nLl;": {'\u22D8', '\u0338'}, + "nLtv;": {'\u226A', '\u0338'}, + "nang;": {'\u2220', '\u20D2'}, + "napE;": {'\u2A70', '\u0338'}, + "napid;": {'\u224B', '\u0338'}, + "nbump;": {'\u224E', '\u0338'}, + "nbumpe;": {'\u224F', '\u0338'}, + "ncongdot;": {'\u2A6D', '\u0338'}, + "nedot;": {'\u2250', '\u0338'}, + "nesim;": {'\u2242', '\u0338'}, + "ngE;": {'\u2267', '\u0338'}, + "ngeqq;": {'\u2267', '\u0338'}, + "ngeqslant;": {'\u2A7E', '\u0338'}, + "nges;": {'\u2A7E', '\u0338'}, + "nlE;": {'\u2266', '\u0338'}, + "nleqq;": {'\u2266', '\u0338'}, + "nleqslant;": {'\u2A7D', '\u0338'}, + "nles;": {'\u2A7D', '\u0338'}, + "notinE;": {'\u22F9', '\u0338'}, + "notindot;": {'\u22F5', '\u0338'}, + "nparsl;": {'\u2AFD', '\u20E5'}, + "npart;": {'\u2202', '\u0338'}, + "npre;": {'\u2AAF', '\u0338'}, + "npreceq;": {'\u2AAF', '\u0338'}, + "nrarrc;": {'\u2933', '\u0338'}, + "nrarrw;": {'\u219D', '\u0338'}, + "nsce;": {'\u2AB0', '\u0338'}, + "nsubE;": {'\u2AC5', '\u0338'}, + "nsubset;": {'\u2282', '\u20D2'}, + "nsubseteqq;": {'\u2AC5', '\u0338'}, + "nsucceq;": {'\u2AB0', '\u0338'}, + "nsupE;": {'\u2AC6', '\u0338'}, + "nsupset;": {'\u2283', '\u20D2'}, + "nsupseteqq;": {'\u2AC6', '\u0338'}, + "nvap;": {'\u224D', '\u20D2'}, + "nvge;": {'\u2265', '\u20D2'}, + "nvgt;": {'\u003E', '\u20D2'}, + "nvle;": {'\u2264', '\u20D2'}, + "nvlt;": {'\u003C', '\u20D2'}, + "nvltrie;": {'\u22B4', '\u20D2'}, + "nvrtrie;": {'\u22B5', '\u20D2'}, + "nvsim;": {'\u223C', '\u20D2'}, + "race;": {'\u223D', '\u0331'}, + "smtes;": {'\u2AAC', '\uFE00'}, + "sqcaps;": {'\u2293', '\uFE00'}, + "sqcups;": {'\u2294', '\uFE00'}, + "varsubsetneq;": {'\u228A', '\uFE00'}, + "varsubsetneqq;": {'\u2ACB', '\uFE00'}, + "varsupsetneq;": {'\u228B', '\uFE00'}, + "varsupsetneqq;": {'\u2ACC', '\uFE00'}, + "vnsub;": {'\u2282', '\u20D2'}, + "vnsup;": {'\u2283', '\u20D2'}, + "vsubnE;": {'\u2ACB', '\uFE00'}, + "vsubne;": {'\u228A', '\uFE00'}, + "vsupnE;": {'\u2ACC', '\uFE00'}, + "vsupne;": {'\u228B', '\uFE00'}, +} diff --git a/vendor/golang.org/x/net/html/escape.go b/vendor/golang.org/x/net/html/escape.go new file mode 100644 index 0000000..d856139 --- /dev/null +++ b/vendor/golang.org/x/net/html/escape.go @@ -0,0 +1,258 @@ +// Copyright 2010 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 html + +import ( + "bytes" + "strings" + "unicode/utf8" +) + +// These replacements permit compatibility with old numeric entities that +// assumed Windows-1252 encoding. +// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference +var replacementTable = [...]rune{ + '\u20AC', // First entry is what 0x80 should be replaced with. + '\u0081', + '\u201A', + '\u0192', + '\u201E', + '\u2026', + '\u2020', + '\u2021', + '\u02C6', + '\u2030', + '\u0160', + '\u2039', + '\u0152', + '\u008D', + '\u017D', + '\u008F', + '\u0090', + '\u2018', + '\u2019', + '\u201C', + '\u201D', + '\u2022', + '\u2013', + '\u2014', + '\u02DC', + '\u2122', + '\u0161', + '\u203A', + '\u0153', + '\u009D', + '\u017E', + '\u0178', // Last entry is 0x9F. + // 0x00->'\uFFFD' is handled programmatically. + // 0x0D->'\u000D' is a no-op. +} + +// unescapeEntity reads an entity like "<" from b[src:] and writes the +// corresponding "<" to b[dst:], returning the incremented dst and src cursors. +// Precondition: b[src] == '&' && dst <= src. +// attribute should be true if parsing an attribute value. +func unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) { + // https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference + + // i starts at 1 because we already know that s[0] == '&'. + i, s := 1, b[src:] + + if len(s) <= 1 { + b[dst] = b[src] + return dst + 1, src + 1 + } + + if s[i] == '#' { + if len(s) <= 3 { // We need to have at least "&#.". + b[dst] = b[src] + return dst + 1, src + 1 + } + i++ + c := s[i] + hex := false + if c == 'x' || c == 'X' { + hex = true + i++ + } + + x := '\x00' + for i < len(s) { + c = s[i] + i++ + if hex { + if '0' <= c && c <= '9' { + x = 16*x + rune(c) - '0' + continue + } else if 'a' <= c && c <= 'f' { + x = 16*x + rune(c) - 'a' + 10 + continue + } else if 'A' <= c && c <= 'F' { + x = 16*x + rune(c) - 'A' + 10 + continue + } + } else if '0' <= c && c <= '9' { + x = 10*x + rune(c) - '0' + continue + } + if c != ';' { + i-- + } + break + } + + if i <= 3 { // No characters matched. + b[dst] = b[src] + return dst + 1, src + 1 + } + + if 0x80 <= x && x <= 0x9F { + // Replace characters from Windows-1252 with UTF-8 equivalents. + x = replacementTable[x-0x80] + } else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF { + // Replace invalid characters with the replacement character. + x = '\uFFFD' + } + + return dst + utf8.EncodeRune(b[dst:], x), src + i + } + + // Consume the maximum number of characters possible, with the + // consumed characters matching one of the named references. + + for i < len(s) { + c := s[i] + i++ + // Lower-cased characters are more common in entities, so we check for them first. + if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { + continue + } + if c != ';' { + i-- + } + break + } + + entityName := string(s[1:i]) + if entityName == "" { + // No-op. + } else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' { + // No-op. + } else if x := entity[entityName]; x != 0 { + return dst + utf8.EncodeRune(b[dst:], x), src + i + } else if x := entity2[entityName]; x[0] != 0 { + dst1 := dst + utf8.EncodeRune(b[dst:], x[0]) + return dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i + } else if !attribute { + maxLen := len(entityName) - 1 + if maxLen > longestEntityWithoutSemicolon { + maxLen = longestEntityWithoutSemicolon + } + for j := maxLen; j > 1; j-- { + if x := entity[entityName[:j]]; x != 0 { + return dst + utf8.EncodeRune(b[dst:], x), src + j + 1 + } + } + } + + dst1, src1 = dst+i, src+i + copy(b[dst:dst1], b[src:src1]) + return dst1, src1 +} + +// unescape unescapes b's entities in-place, so that "a<b" becomes "a': + esc = ">" + case '"': + // """ is shorter than """. + esc = """ + case '\r': + esc = " " + default: + panic("unrecognized escape character") + } + s = s[i+1:] + if _, err := w.WriteString(esc); err != nil { + return err + } + i = strings.IndexAny(s, escapedChars) + } + _, err := w.WriteString(s) + return err +} + +// EscapeString escapes special characters like "<" to become "<". It +// escapes only five such characters: <, >, &, ' and ". +// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't +// always true. +func EscapeString(s string) string { + if strings.IndexAny(s, escapedChars) == -1 { + return s + } + var buf bytes.Buffer + escape(&buf, s) + return buf.String() +} + +// UnescapeString unescapes entities like "<" to become "<". It unescapes a +// larger range of entities than EscapeString escapes. For example, "á" +// unescapes to "á", as does "á" and "&xE1;". +// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't +// always true. +func UnescapeString(s string) string { + for _, c := range s { + if c == '&' { + return string(unescape([]byte(s), false)) + } + } + return s +} diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go new file mode 100644 index 0000000..01477a9 --- /dev/null +++ b/vendor/golang.org/x/net/html/foreign.go @@ -0,0 +1,226 @@ +// Copyright 2011 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 html + +import ( + "strings" +) + +func adjustAttributeNames(aa []Attribute, nameMap map[string]string) { + for i := range aa { + if newName, ok := nameMap[aa[i].Key]; ok { + aa[i].Key = newName + } + } +} + +func adjustForeignAttributes(aa []Attribute) { + for i, a := range aa { + if a.Key == "" || a.Key[0] != 'x' { + continue + } + switch a.Key { + case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show", + "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink": + j := strings.Index(a.Key, ":") + aa[i].Namespace = a.Key[:j] + aa[i].Key = a.Key[j+1:] + } + } +} + +func htmlIntegrationPoint(n *Node) bool { + if n.Type != ElementNode { + return false + } + switch n.Namespace { + case "math": + if n.Data == "annotation-xml" { + for _, a := range n.Attr { + if a.Key == "encoding" { + val := strings.ToLower(a.Val) + if val == "text/html" || val == "application/xhtml+xml" { + return true + } + } + } + } + case "svg": + switch n.Data { + case "desc", "foreignObject", "title": + return true + } + } + return false +} + +func mathMLTextIntegrationPoint(n *Node) bool { + if n.Namespace != "math" { + return false + } + switch n.Data { + case "mi", "mo", "mn", "ms", "mtext": + return true + } + return false +} + +// Section 12.2.6.5. +var breakout = map[string]bool{ + "b": true, + "big": true, + "blockquote": true, + "body": true, + "br": true, + "center": true, + "code": true, + "dd": true, + "div": true, + "dl": true, + "dt": true, + "em": true, + "embed": true, + "h1": true, + "h2": true, + "h3": true, + "h4": true, + "h5": true, + "h6": true, + "head": true, + "hr": true, + "i": true, + "img": true, + "li": true, + "listing": true, + "menu": true, + "meta": true, + "nobr": true, + "ol": true, + "p": true, + "pre": true, + "ruby": true, + "s": true, + "small": true, + "span": true, + "strong": true, + "strike": true, + "sub": true, + "sup": true, + "table": true, + "tt": true, + "u": true, + "ul": true, + "var": true, +} + +// Section 12.2.6.5. +var svgTagNameAdjustments = map[string]string{ + "altglyph": "altGlyph", + "altglyphdef": "altGlyphDef", + "altglyphitem": "altGlyphItem", + "animatecolor": "animateColor", + "animatemotion": "animateMotion", + "animatetransform": "animateTransform", + "clippath": "clipPath", + "feblend": "feBlend", + "fecolormatrix": "feColorMatrix", + "fecomponenttransfer": "feComponentTransfer", + "fecomposite": "feComposite", + "feconvolvematrix": "feConvolveMatrix", + "fediffuselighting": "feDiffuseLighting", + "fedisplacementmap": "feDisplacementMap", + "fedistantlight": "feDistantLight", + "feflood": "feFlood", + "fefunca": "feFuncA", + "fefuncb": "feFuncB", + "fefuncg": "feFuncG", + "fefuncr": "feFuncR", + "fegaussianblur": "feGaussianBlur", + "feimage": "feImage", + "femerge": "feMerge", + "femergenode": "feMergeNode", + "femorphology": "feMorphology", + "feoffset": "feOffset", + "fepointlight": "fePointLight", + "fespecularlighting": "feSpecularLighting", + "fespotlight": "feSpotLight", + "fetile": "feTile", + "feturbulence": "feTurbulence", + "foreignobject": "foreignObject", + "glyphref": "glyphRef", + "lineargradient": "linearGradient", + "radialgradient": "radialGradient", + "textpath": "textPath", +} + +// Section 12.2.6.1 +var mathMLAttributeAdjustments = map[string]string{ + "definitionurl": "definitionURL", +} + +var svgAttributeAdjustments = map[string]string{ + "attributename": "attributeName", + "attributetype": "attributeType", + "basefrequency": "baseFrequency", + "baseprofile": "baseProfile", + "calcmode": "calcMode", + "clippathunits": "clipPathUnits", + "contentscripttype": "contentScriptType", + "contentstyletype": "contentStyleType", + "diffuseconstant": "diffuseConstant", + "edgemode": "edgeMode", + "externalresourcesrequired": "externalResourcesRequired", + "filterres": "filterRes", + "filterunits": "filterUnits", + "glyphref": "glyphRef", + "gradienttransform": "gradientTransform", + "gradientunits": "gradientUnits", + "kernelmatrix": "kernelMatrix", + "kernelunitlength": "kernelUnitLength", + "keypoints": "keyPoints", + "keysplines": "keySplines", + "keytimes": "keyTimes", + "lengthadjust": "lengthAdjust", + "limitingconeangle": "limitingConeAngle", + "markerheight": "markerHeight", + "markerunits": "markerUnits", + "markerwidth": "markerWidth", + "maskcontentunits": "maskContentUnits", + "maskunits": "maskUnits", + "numoctaves": "numOctaves", + "pathlength": "pathLength", + "patterncontentunits": "patternContentUnits", + "patterntransform": "patternTransform", + "patternunits": "patternUnits", + "pointsatx": "pointsAtX", + "pointsaty": "pointsAtY", + "pointsatz": "pointsAtZ", + "preservealpha": "preserveAlpha", + "preserveaspectratio": "preserveAspectRatio", + "primitiveunits": "primitiveUnits", + "refx": "refX", + "refy": "refY", + "repeatcount": "repeatCount", + "repeatdur": "repeatDur", + "requiredextensions": "requiredExtensions", + "requiredfeatures": "requiredFeatures", + "specularconstant": "specularConstant", + "specularexponent": "specularExponent", + "spreadmethod": "spreadMethod", + "startoffset": "startOffset", + "stddeviation": "stdDeviation", + "stitchtiles": "stitchTiles", + "surfacescale": "surfaceScale", + "systemlanguage": "systemLanguage", + "tablevalues": "tableValues", + "targetx": "targetX", + "targety": "targetY", + "textlength": "textLength", + "viewbox": "viewBox", + "viewtarget": "viewTarget", + "xchannelselector": "xChannelSelector", + "ychannelselector": "yChannelSelector", + "zoomandpan": "zoomAndPan", +} diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go new file mode 100644 index 0000000..6f136c4 --- /dev/null +++ b/vendor/golang.org/x/net/html/node.go @@ -0,0 +1,194 @@ +// Copyright 2011 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 html + +import ( + "golang.org/x/net/html/atom" +) + +// A NodeType is the type of a Node. +type NodeType uint32 + +const ( + ErrorNode NodeType = iota + TextNode + DocumentNode + ElementNode + CommentNode + DoctypeNode + scopeMarkerNode +) + +// Section 12.2.4.3 says "The markers are inserted when entering applet, +// object, marquee, template, td, th, and caption elements, and are used +// to prevent formatting from "leaking" into applet, object, marquee, +// template, td, th, and caption elements". +var scopeMarker = Node{Type: scopeMarkerNode} + +// A Node consists of a NodeType and some Data (tag name for element nodes, +// content for text) and are part of a tree of Nodes. Element nodes may also +// have a Namespace and contain a slice of Attributes. Data is unescaped, so +// that it looks like "a 0 { + return (*s)[i-1] + } + return nil +} + +// index returns the index of the top-most occurrence of n in the stack, or -1 +// if n is not present. +func (s *nodeStack) index(n *Node) int { + for i := len(*s) - 1; i >= 0; i-- { + if (*s)[i] == n { + return i + } + } + return -1 +} + +// insert inserts a node at the given index. +func (s *nodeStack) insert(i int, n *Node) { + (*s) = append(*s, nil) + copy((*s)[i+1:], (*s)[i:]) + (*s)[i] = n +} + +// remove removes a node from the stack. It is a no-op if n is not present. +func (s *nodeStack) remove(n *Node) { + i := s.index(n) + if i == -1 { + return + } + copy((*s)[i:], (*s)[i+1:]) + j := len(*s) - 1 + (*s)[j] = nil + *s = (*s)[:j] +} diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go new file mode 100644 index 0000000..2a5abdd --- /dev/null +++ b/vendor/golang.org/x/net/html/parse.go @@ -0,0 +1,2094 @@ +// Copyright 2010 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 html + +import ( + "errors" + "fmt" + "io" + "strings" + + a "golang.org/x/net/html/atom" +) + +// A parser implements the HTML5 parsing algorithm: +// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction +type parser struct { + // tokenizer provides the tokens for the parser. + tokenizer *Tokenizer + // tok is the most recently read token. + tok Token + // Self-closing tags like
are treated as start tags, except that + // hasSelfClosingToken is set while they are being processed. + hasSelfClosingToken bool + // doc is the document root element. + doc *Node + // The stack of open elements (section 12.2.4.2) and active formatting + // elements (section 12.2.4.3). + oe, afe nodeStack + // Element pointers (section 12.2.4.4). + head, form *Node + // Other parsing state flags (section 12.2.4.5). + scripting, framesetOK bool + // im is the current insertion mode. + im insertionMode + // originalIM is the insertion mode to go back to after completing a text + // or inTableText insertion mode. + originalIM insertionMode + // fosterParenting is whether new elements should be inserted according to + // the foster parenting rules (section 12.2.6.1). + fosterParenting bool + // quirks is whether the parser is operating in "quirks mode." + quirks bool + // fragment is whether the parser is parsing an HTML fragment. + fragment bool + // context is the context element when parsing an HTML fragment + // (section 12.4). + context *Node +} + +func (p *parser) top() *Node { + if n := p.oe.top(); n != nil { + return n + } + return p.doc +} + +// Stop tags for use in popUntil. These come from section 12.2.4.2. +var ( + defaultScopeStopTags = map[string][]a.Atom{ + "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, + "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, + "svg": {a.Desc, a.ForeignObject, a.Title}, + } +) + +type scope int + +const ( + defaultScope scope = iota + listItemScope + buttonScope + tableScope + tableRowScope + tableBodyScope + selectScope +) + +// popUntil pops the stack of open elements at the highest element whose tag +// is in matchTags, provided there is no higher element in the scope's stop +// tags (as defined in section 12.2.4.2). It returns whether or not there was +// such an element. If there was not, popUntil leaves the stack unchanged. +// +// For example, the set of stop tags for table scope is: "html", "table". If +// the stack was: +// ["html", "body", "font", "table", "b", "i", "u"] +// then popUntil(tableScope, "font") would return false, but +// popUntil(tableScope, "i") would return true and the stack would become: +// ["html", "body", "font", "table", "b"] +// +// If an element's tag is in both the stop tags and matchTags, then the stack +// will be popped and the function returns true (provided, of course, there was +// no higher element in the stack that was also in the stop tags). For example, +// popUntil(tableScope, "table") returns true and leaves: +// ["html", "body", "font"] +func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { + if i := p.indexOfElementInScope(s, matchTags...); i != -1 { + p.oe = p.oe[:i] + return true + } + return false +} + +// indexOfElementInScope returns the index in p.oe of the highest element whose +// tag is in matchTags that is in scope. If no matching element is in scope, it +// returns -1. +func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { + for i := len(p.oe) - 1; i >= 0; i-- { + tagAtom := p.oe[i].DataAtom + if p.oe[i].Namespace == "" { + for _, t := range matchTags { + if t == tagAtom { + return i + } + } + switch s { + case defaultScope: + // No-op. + case listItemScope: + if tagAtom == a.Ol || tagAtom == a.Ul { + return -1 + } + case buttonScope: + if tagAtom == a.Button { + return -1 + } + case tableScope: + if tagAtom == a.Html || tagAtom == a.Table { + return -1 + } + case selectScope: + if tagAtom != a.Optgroup && tagAtom != a.Option { + return -1 + } + default: + panic("unreachable") + } + } + switch s { + case defaultScope, listItemScope, buttonScope: + for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { + if t == tagAtom { + return -1 + } + } + } + } + return -1 +} + +// elementInScope is like popUntil, except that it doesn't modify the stack of +// open elements. +func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { + return p.indexOfElementInScope(s, matchTags...) != -1 +} + +// clearStackToContext pops elements off the stack of open elements until a +// scope-defined element is found. +func (p *parser) clearStackToContext(s scope) { + for i := len(p.oe) - 1; i >= 0; i-- { + tagAtom := p.oe[i].DataAtom + switch s { + case tableScope: + if tagAtom == a.Html || tagAtom == a.Table { + p.oe = p.oe[:i+1] + return + } + case tableRowScope: + if tagAtom == a.Html || tagAtom == a.Tr { + p.oe = p.oe[:i+1] + return + } + case tableBodyScope: + if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { + p.oe = p.oe[:i+1] + return + } + default: + panic("unreachable") + } + } +} + +// generateImpliedEndTags pops nodes off the stack of open elements as long as +// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. +// If exceptions are specified, nodes with that name will not be popped off. +func (p *parser) generateImpliedEndTags(exceptions ...string) { + var i int +loop: + for i = len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if n.Type == ElementNode { + switch n.DataAtom { + case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: + for _, except := range exceptions { + if n.Data == except { + break loop + } + } + continue + } + } + break + } + + p.oe = p.oe[:i+1] +} + +// addChild adds a child node n to the top element, and pushes n onto the stack +// of open elements if it is an element node. +func (p *parser) addChild(n *Node) { + if p.shouldFosterParent() { + p.fosterParent(n) + } else { + p.top().AppendChild(n) + } + + if n.Type == ElementNode { + p.oe = append(p.oe, n) + } +} + +// shouldFosterParent returns whether the next node to be added should be +// foster parented. +func (p *parser) shouldFosterParent() bool { + if p.fosterParenting { + switch p.top().DataAtom { + case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: + return true + } + } + return false +} + +// fosterParent adds a child node according to the foster parenting rules. +// Section 12.2.6.1, "foster parenting". +func (p *parser) fosterParent(n *Node) { + var table, parent, prev *Node + var i int + for i = len(p.oe) - 1; i >= 0; i-- { + if p.oe[i].DataAtom == a.Table { + table = p.oe[i] + break + } + } + + if table == nil { + // The foster parent is the html element. + parent = p.oe[0] + } else { + parent = table.Parent + } + if parent == nil { + parent = p.oe[i-1] + } + + if table != nil { + prev = table.PrevSibling + } else { + prev = parent.LastChild + } + if prev != nil && prev.Type == TextNode && n.Type == TextNode { + prev.Data += n.Data + return + } + + parent.InsertBefore(n, table) +} + +// addText adds text to the preceding node if it is a text node, or else it +// calls addChild with a new text node. +func (p *parser) addText(text string) { + if text == "" { + return + } + + if p.shouldFosterParent() { + p.fosterParent(&Node{ + Type: TextNode, + Data: text, + }) + return + } + + t := p.top() + if n := t.LastChild; n != nil && n.Type == TextNode { + n.Data += text + return + } + p.addChild(&Node{ + Type: TextNode, + Data: text, + }) +} + +// addElement adds a child element based on the current token. +func (p *parser) addElement() { + p.addChild(&Node{ + Type: ElementNode, + DataAtom: p.tok.DataAtom, + Data: p.tok.Data, + Attr: p.tok.Attr, + }) +} + +// Section 12.2.4.3. +func (p *parser) addFormattingElement() { + tagAtom, attr := p.tok.DataAtom, p.tok.Attr + p.addElement() + + // Implement the Noah's Ark clause, but with three per family instead of two. + identicalElements := 0 +findIdenticalElements: + for i := len(p.afe) - 1; i >= 0; i-- { + n := p.afe[i] + if n.Type == scopeMarkerNode { + break + } + if n.Type != ElementNode { + continue + } + if n.Namespace != "" { + continue + } + if n.DataAtom != tagAtom { + continue + } + if len(n.Attr) != len(attr) { + continue + } + compareAttributes: + for _, t0 := range n.Attr { + for _, t1 := range attr { + if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { + // Found a match for this attribute, continue with the next attribute. + continue compareAttributes + } + } + // If we get here, there is no attribute that matches a. + // Therefore the element is not identical to the new one. + continue findIdenticalElements + } + + identicalElements++ + if identicalElements >= 3 { + p.afe.remove(n) + } + } + + p.afe = append(p.afe, p.top()) +} + +// Section 12.2.4.3. +func (p *parser) clearActiveFormattingElements() { + for { + n := p.afe.pop() + if len(p.afe) == 0 || n.Type == scopeMarkerNode { + return + } + } +} + +// Section 12.2.4.3. +func (p *parser) reconstructActiveFormattingElements() { + n := p.afe.top() + if n == nil { + return + } + if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { + return + } + i := len(p.afe) - 1 + for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { + if i == 0 { + i = -1 + break + } + i-- + n = p.afe[i] + } + for { + i++ + clone := p.afe[i].clone() + p.addChild(clone) + p.afe[i] = clone + if i == len(p.afe)-1 { + break + } + } +} + +// Section 12.2.5. +func (p *parser) acknowledgeSelfClosingTag() { + p.hasSelfClosingToken = false +} + +// An insertion mode (section 12.2.4.1) is the state transition function from +// a particular state in the HTML5 parser's state machine. It updates the +// parser's fields depending on parser.tok (where ErrorToken means EOF). +// It returns whether the token was consumed. +type insertionMode func(*parser) bool + +// setOriginalIM sets the insertion mode to return to after completing a text or +// inTableText insertion mode. +// Section 12.2.4.1, "using the rules for". +func (p *parser) setOriginalIM() { + if p.originalIM != nil { + panic("html: bad parser state: originalIM was set twice") + } + p.originalIM = p.im +} + +// Section 12.2.4.1, "reset the insertion mode". +func (p *parser) resetInsertionMode() { + for i := len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if i == 0 && p.context != nil { + n = p.context + } + + switch n.DataAtom { + case a.Select: + p.im = inSelectIM + case a.Td, a.Th: + p.im = inCellIM + case a.Tr: + p.im = inRowIM + case a.Tbody, a.Thead, a.Tfoot: + p.im = inTableBodyIM + case a.Caption: + p.im = inCaptionIM + case a.Colgroup: + p.im = inColumnGroupIM + case a.Table: + p.im = inTableIM + case a.Head: + p.im = inBodyIM + case a.Body: + p.im = inBodyIM + case a.Frameset: + p.im = inFramesetIM + case a.Html: + p.im = beforeHeadIM + default: + continue + } + return + } + p.im = inBodyIM +} + +const whitespace = " \t\r\n\f" + +// Section 12.2.6.4.1. +func initialIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case CommentToken: + p.doc.AppendChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + n, quirks := parseDoctype(p.tok.Data) + p.doc.AppendChild(n) + p.quirks = quirks + p.im = beforeHTMLIM + return true + } + p.quirks = true + p.im = beforeHTMLIM + return false +} + +// Section 12.2.6.4.2. +func beforeHTMLIM(p *parser) bool { + switch p.tok.Type { + case DoctypeToken: + // Ignore the token. + return true + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case StartTagToken: + if p.tok.DataAtom == a.Html { + p.addElement() + p.im = beforeHeadIM + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head, a.Body, a.Html, a.Br: + p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.doc.AppendChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + } + p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) + return false +} + +// Section 12.2.6.4.3. +func beforeHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) + if len(p.tok.Data) == 0 { + // It was all whitespace, so ignore it. + return true + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Head: + p.addElement() + p.head = p.top() + p.im = inHeadIM + return true + case a.Html: + return inBodyIM(p) + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head, a.Body, a.Html, a.Br: + p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) + return false +} + +// Section 12.2.6.4.4. +func inHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + s := strings.TrimLeft(p.tok.Data, whitespace) + if len(s) < len(p.tok.Data) { + // Add the initial whitespace to the current node. + p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) + if s == "" { + return true + } + p.tok.Data = s + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Html: + return inBodyIM(p) + case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: + p.addElement() + p.oe.pop() + p.acknowledgeSelfClosingTag() + return true + case a.Script, a.Title, a.Noscript, a.Noframes, a.Style: + p.addElement() + p.setOriginalIM() + p.im = textIM + return true + case a.Head: + // Ignore the token. + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Head: + n := p.oe.pop() + if n.DataAtom != a.Head { + panic("html: bad parser state: element not found, in the in-head insertion mode") + } + p.im = afterHeadIM + return true + case a.Body, a.Html, a.Br: + p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) + return false + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) + return false +} + +// Section 12.2.6.4.6. +func afterHeadIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + s := strings.TrimLeft(p.tok.Data, whitespace) + if len(s) < len(p.tok.Data) { + // Add the initial whitespace to the current node. + p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) + if s == "" { + return true + } + p.tok.Data = s + } + case StartTagToken: + switch p.tok.DataAtom { + case a.Html: + return inBodyIM(p) + case a.Body: + p.addElement() + p.framesetOK = false + p.im = inBodyIM + return true + case a.Frameset: + p.addElement() + p.im = inFramesetIM + return true + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + p.oe = append(p.oe, p.head) + defer p.oe.remove(p.head) + return inHeadIM(p) + case a.Head: + // Ignore the token. + return true + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Body, a.Html, a.Br: + // Drop down to creating an implied tag. + default: + // Ignore the token. + return true + } + case CommentToken: + p.addChild(&Node{ + Type: CommentNode, + Data: p.tok.Data, + }) + return true + case DoctypeToken: + // Ignore the token. + return true + } + + p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) + p.framesetOK = true + return false +} + +// copyAttributes copies attributes of src not found on dst to dst. +func copyAttributes(dst *Node, src Token) { + if len(src.Attr) == 0 { + return + } + attr := map[string]string{} + for _, t := range dst.Attr { + attr[t.Key] = t.Val + } + for _, t := range src.Attr { + if _, ok := attr[t.Key]; !ok { + dst.Attr = append(dst.Attr, t) + attr[t.Key] = t.Val + } + } +} + +// Section 12.2.6.4.7. +func inBodyIM(p *parser) bool { + switch p.tok.Type { + case TextToken: + d := p.tok.Data + switch n := p.oe.top(); n.DataAtom { + case a.Pre, a.Listing: + if n.FirstChild == nil { + // Ignore a newline at the start of a
 block.
+				if d != "" && d[0] == '\r' {
+					d = d[1:]
+				}
+				if d != "" && d[0] == '\n' {
+					d = d[1:]
+				}
+			}
+		}
+		d = strings.Replace(d, "\x00", "", -1)
+		if d == "" {
+			return true
+		}
+		p.reconstructActiveFormattingElements()
+		p.addText(d)
+		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
+			// There were non-whitespace characters inserted.
+			p.framesetOK = false
+		}
+	case StartTagToken:
+		switch p.tok.DataAtom {
+		case a.Html:
+			copyAttributes(p.oe[0], p.tok)
+		case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:
+			return inHeadIM(p)
+		case a.Body:
+			if len(p.oe) >= 2 {
+				body := p.oe[1]
+				if body.Type == ElementNode && body.DataAtom == a.Body {
+					p.framesetOK = false
+					copyAttributes(body, p.tok)
+				}
+			}
+		case a.Frameset:
+			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
+				// Ignore the token.
+				return true
+			}
+			body := p.oe[1]
+			if body.Parent != nil {
+				body.Parent.RemoveChild(body)
+			}
+			p.oe = p.oe[:1]
+			p.addElement()
+			p.im = inFramesetIM
+			return true
+		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+			p.popUntil(buttonScope, a.P)
+			switch n := p.top(); n.DataAtom {
+			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+				p.oe.pop()
+			}
+			p.addElement()
+		case a.Pre, a.Listing:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+			// The newline, if any, will be dealt with by the TextToken case.
+			p.framesetOK = false
+		case a.Form:
+			if p.form == nil {
+				p.popUntil(buttonScope, a.P)
+				p.addElement()
+				p.form = p.top()
+			}
+		case a.Li:
+			p.framesetOK = false
+			for i := len(p.oe) - 1; i >= 0; i-- {
+				node := p.oe[i]
+				switch node.DataAtom {
+				case a.Li:
+					p.oe = p.oe[:i]
+				case a.Address, a.Div, a.P:
+					continue
+				default:
+					if !isSpecialElement(node) {
+						continue
+					}
+				}
+				break
+			}
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Dd, a.Dt:
+			p.framesetOK = false
+			for i := len(p.oe) - 1; i >= 0; i-- {
+				node := p.oe[i]
+				switch node.DataAtom {
+				case a.Dd, a.Dt:
+					p.oe = p.oe[:i]
+				case a.Address, a.Div, a.P:
+					continue
+				default:
+					if !isSpecialElement(node) {
+						continue
+					}
+				}
+				break
+			}
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Plaintext:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+		case a.Button:
+			p.popUntil(defaultScope, a.Button)
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.framesetOK = false
+		case a.A:
+			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
+				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
+					p.inBodyEndTagFormatting(a.A)
+					p.oe.remove(n)
+					p.afe.remove(n)
+					break
+				}
+			}
+			p.reconstructActiveFormattingElements()
+			p.addFormattingElement()
+		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
+			p.reconstructActiveFormattingElements()
+			p.addFormattingElement()
+		case a.Nobr:
+			p.reconstructActiveFormattingElements()
+			if p.elementInScope(defaultScope, a.Nobr) {
+				p.inBodyEndTagFormatting(a.Nobr)
+				p.reconstructActiveFormattingElements()
+			}
+			p.addFormattingElement()
+		case a.Applet, a.Marquee, a.Object:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.afe = append(p.afe, &scopeMarker)
+			p.framesetOK = false
+		case a.Table:
+			if !p.quirks {
+				p.popUntil(buttonScope, a.P)
+			}
+			p.addElement()
+			p.framesetOK = false
+			p.im = inTableIM
+			return true
+		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+			if p.tok.DataAtom == a.Input {
+				for _, t := range p.tok.Attr {
+					if t.Key == "type" {
+						if strings.ToLower(t.Val) == "hidden" {
+							// Skip setting framesetOK = false
+							return true
+						}
+					}
+				}
+			}
+			p.framesetOK = false
+		case a.Param, a.Source, a.Track:
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+		case a.Hr:
+			p.popUntil(buttonScope, a.P)
+			p.addElement()
+			p.oe.pop()
+			p.acknowledgeSelfClosingTag()
+			p.framesetOK = false
+		case a.Image:
+			p.tok.DataAtom = a.Img
+			p.tok.Data = a.Img.String()
+			return false
+		case a.Isindex:
+			if p.form != nil {
+				// Ignore the token.
+				return true
+			}
+			action := ""
+			prompt := "This is a searchable index. Enter search keywords: "
+			attr := []Attribute{{Key: "name", Val: "isindex"}}
+			for _, t := range p.tok.Attr {
+				switch t.Key {
+				case "action":
+					action = t.Val
+				case "name":
+					// Ignore the attribute.
+				case "prompt":
+					prompt = t.Val
+				default:
+					attr = append(attr, t)
+				}
+			}
+			p.acknowledgeSelfClosingTag()
+			p.popUntil(buttonScope, a.P)
+			p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
+			if action != "" {
+				p.form.Attr = []Attribute{{Key: "action", Val: action}}
+			}
+			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
+			p.parseImpliedToken(StartTagToken, a.Label, a.Label.String())
+			p.addText(prompt)
+			p.addChild(&Node{
+				Type:     ElementNode,
+				DataAtom: a.Input,
+				Data:     a.Input.String(),
+				Attr:     attr,
+			})
+			p.oe.pop()
+			p.parseImpliedToken(EndTagToken, a.Label, a.Label.String())
+			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
+			p.parseImpliedToken(EndTagToken, a.Form, a.Form.String())
+		case a.Textarea:
+			p.addElement()
+			p.setOriginalIM()
+			p.framesetOK = false
+			p.im = textIM
+		case a.Xmp:
+			p.popUntil(buttonScope, a.P)
+			p.reconstructActiveFormattingElements()
+			p.framesetOK = false
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Iframe:
+			p.framesetOK = false
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Noembed, a.Noscript:
+			p.addElement()
+			p.setOriginalIM()
+			p.im = textIM
+		case a.Select:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+			p.framesetOK = false
+			p.im = inSelectIM
+			return true
+		case a.Optgroup, a.Option:
+			if p.top().DataAtom == a.Option {
+				p.oe.pop()
+			}
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+		case a.Rp, a.Rt:
+			if p.elementInScope(defaultScope, a.Ruby) {
+				p.generateImpliedEndTags()
+			}
+			p.addElement()
+		case a.Math, a.Svg:
+			p.reconstructActiveFormattingElements()
+			if p.tok.DataAtom == a.Math {
+				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
+			} else {
+				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
+			}
+			adjustForeignAttributes(p.tok.Attr)
+			p.addElement()
+			p.top().Namespace = p.tok.Data
+			if p.hasSelfClosingToken {
+				p.oe.pop()
+				p.acknowledgeSelfClosingTag()
+			}
+			return true
+		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
+			// Ignore the token.
+		default:
+			p.reconstructActiveFormattingElements()
+			p.addElement()
+		}
+	case EndTagToken:
+		switch p.tok.DataAtom {
+		case a.Body:
+			if p.elementInScope(defaultScope, a.Body) {
+				p.im = afterBodyIM
+			}
+		case a.Html:
+			if p.elementInScope(defaultScope, a.Body) {
+				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
+				return false
+			}
+			return true
+		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
+			p.popUntil(defaultScope, p.tok.DataAtom)
+		case a.Form:
+			node := p.form
+			p.form = nil
+			i := p.indexOfElementInScope(defaultScope, a.Form)
+			if node == nil || i == -1 || p.oe[i] != node {
+				// Ignore the token.
+				return true
+			}
+			p.generateImpliedEndTags()
+			p.oe.remove(node)
+		case a.P:
+			if !p.elementInScope(buttonScope, a.P) {
+				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
+			}
+			p.popUntil(buttonScope, a.P)
+		case a.Li:
+			p.popUntil(listItemScope, a.Li)
+		case a.Dd, a.Dt:
+			p.popUntil(defaultScope, p.tok.DataAtom)
+		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
+			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
+		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
+			p.inBodyEndTagFormatting(p.tok.DataAtom)
+		case a.Applet, a.Marquee, a.Object:
+			if p.popUntil(defaultScope, p.tok.DataAtom) {
+				p.clearActiveFormattingElements()
+			}
+		case a.Br:
+			p.tok.Type = StartTagToken
+			return false
+		default:
+			p.inBodyEndTagOther(p.tok.DataAtom)
+		}
+	case CommentToken:
+		p.addChild(&Node{
+			Type: CommentNode,
+			Data: p.tok.Data,
+		})
+	}
+
+	return true
+}
+
+func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
+	// This is the "adoption agency" algorithm, described at
+	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
+
+	// TODO: this is a fairly literal line-by-line translation of that algorithm.
+	// Once the code successfully parses the comprehensive test suite, we should
+	// refactor this code to be more idiomatic.
+
+	// Steps 1-4. The outer loop.
+	for i := 0; i < 8; i++ {
+		// Step 5. Find the formatting element.
+		var formattingElement *Node
+		for j := len(p.afe) - 1; j >= 0; j-- {
+			if p.afe[j].Type == scopeMarkerNode {
+				break
+			}
+			if p.afe[j].DataAtom == tagAtom {
+				formattingElement = p.afe[j]
+				break
+			}
+		}
+		if formattingElement == nil {
+			p.inBodyEndTagOther(tagAtom)
+			return
+		}
+		feIndex := p.oe.index(formattingElement)
+		if feIndex == -1 {
+			p.afe.remove(formattingElement)
+			return
+		}
+		if !p.elementInScope(defaultScope, tagAtom) {
+			// Ignore the tag.
+			return
+		}
+
+		// Steps 9-10. Find the furthest block.
+		var furthestBlock *Node
+		for _, e := range p.oe[feIndex:] {
+			if isSpecialElement(e) {
+				furthestBlock = e
+				break
+			}
+		}
+		if furthestBlock == nil {
+			e := p.oe.pop()
+			for e != formattingElement {
+				e = p.oe.pop()
+			}
+			p.afe.remove(e)
+			return
+		}
+
+		// Steps 11-12. Find the common ancestor and bookmark node.
+		commonAncestor := p.oe[feIndex-1]
+		bookmark := p.afe.index(formattingElement)
+
+		// Step 13. The inner loop. Find the lastNode to reparent.
+		lastNode := furthestBlock
+		node := furthestBlock
+		x := p.oe.index(node)
+		// Steps 13.1-13.2
+		for j := 0; j < 3; j++ {
+			// Step 13.3.
+			x--
+			node = p.oe[x]
+			// Step 13.4 - 13.5.
+			if p.afe.index(node) == -1 {
+				p.oe.remove(node)
+				continue
+			}
+			// Step 13.6.
+			if node == formattingElement {
+				break
+			}
+			// Step 13.7.
+			clone := node.clone()
+			p.afe[p.afe.index(node)] = clone
+			p.oe[p.oe.index(node)] = clone
+			node = clone
+			// Step 13.8.
+			if lastNode == furthestBlock {
+				bookmark = p.afe.index(node) + 1
+			}
+			// Step 13.9.
+			if lastNode.Parent != nil {
+				lastNode.Parent.RemoveChild(lastNode)
+			}
+			node.AppendChild(lastNode)
+			// Step 13.10.
+			lastNode = node
+		}
+
+		// Step 14. Reparent lastNode to the common ancestor,
+		// or for misnested table nodes, to the foster parent.
+		if lastNode.Parent != nil {
+			lastNode.Parent.RemoveChild(lastNode)
+		}
+		switch commonAncestor.DataAtom {
+		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
+			p.fosterParent(lastNode)
+		default:
+			commonAncestor.AppendChild(lastNode)
+		}
+
+		// Steps 15-17. Reparent nodes from the furthest block's children
+		// to a clone of the formatting element.
+		clone := formattingElement.clone()
+		reparentChildren(clone, furthestBlock)
+		furthestBlock.AppendChild(clone)
+
+		// Step 18. Fix up the list of active formatting elements.
+		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
+			// Move the bookmark with the rest of the list.
+			bookmark--
+		}
+		p.afe.remove(formattingElement)
+		p.afe.insert(bookmark, clone)
+
+		// Step 19. Fix up the stack of open elements.
+		p.oe.remove(formattingElement)
+		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
+	}
+}
+
+// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
+// "Any other end tag" handling from 12.2.6.5 The rules for parsing tokens in foreign content
+// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
+func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
+	for i := len(p.oe) - 1; i >= 0; i-- {
+		if p.oe[i].DataAtom == tagAtom {
+			p.oe = p.oe[:i]
+			break
+		}
+		if isSpecialElement(p.oe[i]) {
+			break
+		}
+	}
+}
+
+// Section 12.2.6.4.8.
+func textIM(p *parser) bool {
+	switch p.tok.Type {
+	case ErrorToken:
+		p.oe.pop()
+	case TextToken:
+		d := p.tok.Data
+		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
+			// Ignore a newline at the start of a