github.com/thommil/tge-gl@v0.0.0-20190313100017-83d8f10f8fae/types.go (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package gl 6 7 // Enum is equivalent to GLenum, and is normally used with one of the 8 // constants defined in this package. 9 type Enum uint32 10 11 // Types are defined a structs so that in debug mode they can carry 12 // extra information, such as a string name. See typesdebug.go. 13 14 // Attrib identifies the location of a specific attribute variable. 15 type Attrib int32 16 17 // Program identifies a compiled shader program. 18 type Program uint32 19 20 // Shader identifies a GLSL shader. 21 type Shader uint32 22 23 // Buffer identifies a GL buffer object. 24 type Buffer uint32 25 26 // Framebuffer identifies a GL framebuffer. 27 type Framebuffer uint32 28 29 // A Renderbuffer is a GL object that holds an image in an internal format. 30 type Renderbuffer uint32 31 32 // A Texture identifies a GL texture unit. 33 type Texture uint32 34 35 // Uniform identifies the location of a specific uniform variable. 36 type Uniform int32 37 38 // A VertexArray is a GL object that holds vertices in an internal format. 39 type VertexArray uint32 40 41 // Valid indicates if attrib is valid in OpenGL context 42 func (v Attrib) Valid() bool { return v >= 0 } 43 44 // Valid indicates if program is valid in OpenGL context 45 func (v Program) Valid() bool { return v > 0 } 46 47 // Valid indicates if shader is valid in OpenGL context 48 func (v Shader) Valid() bool { return v > 0 } 49 50 // Valid indicates if buffer is valid in OpenGL context 51 func (v Buffer) Valid() bool { return v > 0 } 52 53 // Valid indicates if framebuffer is valid in OpenGL context 54 func (v Framebuffer) Valid() bool { return v > 0 } 55 56 // Valid indicates if renderbuffer is valid in OpenGL context 57 func (v Renderbuffer) Valid() bool { return v > 0 } 58 59 // Valid indicates if texture is valid in OpenGL context 60 func (v Texture) Valid() bool { return v > 0 } 61 62 // Valid indicates if uniform is valid in OpenGL context 63 func (v Uniform) Valid() bool { return v >= 0 } 64 65 // Valid indicates if VAO is valid in OpenGL context 66 func (v VertexArray) Valid() bool { return v > 0 }