Also rename some files: types.go -> types_prod.go typesdebug.go -> types_debug.go (new file) types_common.go In discussing https://golang.org/cl/144480043/ crawshaw said: The third argument to glUniformMatrix* is "transpose." According to the linked documentation, which is usually better: "If transpose is GL_FALSE, each matrix is assumed to be supplied in column major order. If transpose is GL_TRUE, each matrix is assumed to be supplied in row major order." However, the documentation for OpenGL ES 2 doesn't bother even telling you, it just says that this parameter must always be set to GL_FALSE. So it's not supported on most Android devices. (Sadly the older documentation appears to have been discontinued.) So yes, GL seems to default to column-major, and the older GLES2 I'm targeting left the transpose argument in but doesn't support it. Hence I'm not exposing it through this API. LGTM=crawshaw R=crawshaw CC=golang-codereviews https://golang.org/cl/148690043
72 lines
2.0 KiB
Go
72 lines
2.0 KiB
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build gldebug
|
|
|
|
package gl
|
|
|
|
// Alternate versions of the types defined in types.go with extra
|
|
// debugging information attached. For documentation, see types.go.
|
|
|
|
//#cgo darwin LDFLAGS: -framework OpenGL
|
|
//#cgo linux LDFLAGS: -lGLESv2
|
|
//#include "gl2.h"
|
|
import "C"
|
|
import "fmt"
|
|
|
|
type Enum uint32
|
|
|
|
type Attrib struct {
|
|
Value uint
|
|
name string
|
|
}
|
|
|
|
type Program struct {
|
|
Value uint32
|
|
}
|
|
|
|
type Shader struct {
|
|
Value uint32
|
|
}
|
|
|
|
type Buffer struct {
|
|
Value uint32
|
|
}
|
|
|
|
type Framebuffer struct {
|
|
Value uint32
|
|
}
|
|
|
|
type Renderbuffer struct {
|
|
Value uint32
|
|
}
|
|
|
|
type Texture struct {
|
|
Value uint32
|
|
}
|
|
|
|
type Uniform struct {
|
|
Value int32
|
|
name string
|
|
}
|
|
|
|
func (v Attrib) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Enum) c() C.GLenum { return C.GLenum(v) }
|
|
func (v Program) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Shader) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Buffer) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Framebuffer) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Renderbuffer) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Texture) c() C.GLuint { return C.GLuint(v.Value) }
|
|
func (v Uniform) c() C.GLint { return C.GLint(v.Value) }
|
|
|
|
func (v Attrib) String() string { return fmt.Sprintf("Attrib(%d:%s)", v.Value, v.name) }
|
|
func (v Program) String() string { return fmt.Sprintf("Program(%d)", v.Value) }
|
|
func (v Shader) String() string { return fmt.Sprintf("Shader(%d)", v.Value) }
|
|
func (v Buffer) String() string { return fmt.Sprintf("Buffer(%d)", v.Value) }
|
|
func (v Framebuffer) String() string { return fmt.Sprintf("Framebuffer(%d)", v.Value) }
|
|
func (v Renderbuffer) String() string { return fmt.Sprintf("Renderbuffer(%d)", v.Value) }
|
|
func (v Texture) String() string { return fmt.Sprintf("Texture(%d)", v.Value) }
|
|
func (v Uniform) String() string { return fmt.Sprintf("Uniform(%d:%s)", v.Value, v.name) }
|