Reorder DrawElements arguments to match OpenGL spec order:
DrawElements(mode, ty, offset, count) -> (mode, count, ty, offset)
GetActiveAttrib, GetActiveUniform are defined by spec to accept
corresponding integer _index_, not location type. Change their
signature to do that:
GetActiveAttrib(p Program, a Attrib) -> (p Program, index uint32)
GetActiveUniform(p Program, u Uniform) -> (p Program, index uint32)
Clarify and make documentation, parameter names more clear for Uniform
(uniform location), Attrib (attribute location) types,
EnableVertexAttribArray, DisableVertexAttribArray, GetAttribLocation,
GetUniformLocation funcs.
Resolvesgolang/go#10218 again.
Change-Id: I5b822235d9485701186a43dae0b9fd898cc6a3d8
Reviewed-on: https://go-review.googlesource.com/8166
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change func names and parameter order to more closely follow OpenGL
ES/WebGL spec.
BufferData(target, usage, src) -> BufferData(target, src, usage)
GenBuffer -> CreateBuffer
GenFramebuffer -> CreateFramebuffer
GenRenderbuffer -> CreateRenderbuffer
GenTexture -> CreateTexture
Fix issue where glBoolean helper was returning inverted result.
Make Attrib.String() logic consistent with others (print value, not
struct).
Make internal code of GetUniformLocation the same as GetAttribLocation
and BindAttribLocation for consistency.
Resolvesgolang/go#10218.
Change-Id: Ib33dfff7c22c4d178b2e6b8d228f80f3c17308a8
Reviewed-on: https://go-review.googlesource.com/8000
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Only used in package tests that are only
supported on OS X / linux (for now).
Change-Id: I9708cd370ccf52c231d66dec9ccc1c06b45f4acd
Reviewed-on: https://go-review.googlesource.com/5490
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I9962d49a4e620fb734bc218ebfa558336ade8e06
Reviewed-on: https://go-review.googlesource.com/5200
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Also s/bufer/buffer/ in comment for VertexAttribPointer.
Change-Id: Icb2ce35e4fed91939ebd00012e5caf88453fcbbf
Reviewed-on: https://go-review.googlesource.com/3959
Reviewed-by: David Crawshaw <crawshaw@golang.org>
They don't make sense for other platforms yet.
See golang/go#9603
Change-Id: I2ed269a00b1e1961aadf0a47fc95bbe3cd230113
Reviewed-on: https://go-review.googlesource.com/2902
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I90a813c0823498297ff0bb7718bee6cd61b87581
Reviewed-on: https://go-review.googlesource.com/1517
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I73a6d37ecc1827fa65c94cd6d743874785f7e93a
Reviewed-on: https://go-review.googlesource.com/1374
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Icad6cb694b31924164483609e0fd9c7cce8e3f0d
Reviewed-on: https://go-review.googlesource.com/1185
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
C changes the types silently, so there's no need for the code to be
different (beyond the standard header ifdef boilerplate).
Change-Id: I0eddb5fa050c083cdac9db499634bf3d1bb9bb04
Reviewed-on: https://go-review.googlesource.com/1184
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I2ff85d2b4529fc12e08404c93266b827dd88b8ef
Reviewed-on: https://go-review.googlesource.com/1183
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
I have included the gl.LINEAR bugfix here as it changes the
images substantially.
Based on Nigel's excellent analysis in cl/160710043.
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/168820043
It's not a big deal in this case, but we'll probably want to do the same
for the sprite/gl package.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/163990043
Drawing now supports defining both the source and destination
bounds, which is equivalent to clipping and scaling an image.
LGTM=nigeltao
R=nigeltao, crawshaw
CC=adg, golang-codereviews
https://golang.org/cl/144480043
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
Split constants out into their own file. Hide the
values in named types in a struct, so that when
using the gldebug tag we can attach extra
information (such as the name of a uniform and
attribute).
LGTM=nigeltao
R=golang-codereviews, bryanturley, nigeltao
CC=davidday, golang-codereviews
https://golang.org/cl/137630043
No tests yet. I am working on a gltest package that can
create a windowless context on a variety of platforms for
testing GL code, but given current priorities it is a
couple of weeks away.
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/135450043
Various versions of these headers cause harmless (but frustrating)
compile errors, e.g. *C.char being swapped out in some function
definitions for *C.uchar. To simplify builds, importing the
headers from khronos.org.
LGTM=nigeltao
R=golang-codereviews, nigeltao
CC=golang-codereviews
https://golang.org/cl/127020043
Compiling a binary with "-tags gldebug" will add log
tracing to each GL function call. This is the best I
can offer in lieu of of real error handling.
A colleague has accused me of Aspect-oriented
programming. The wikipedia article on the topic lost
me in the first paragraph, so just for the record,
this was inspired by the way the cover tool rewrites
source code.
LGTM=sameer
R=golang-codereviews, sameer
CC=golang-codereviews
https://golang.org/cl/128640043
A new set of bindings, as none of the existing open source
ones meet all the desired criteria:
- just ES 2/3, no deprecated/wider interfaces
- no hiding of GL functions behind higher-level interfaces
- no exported use of C types
- no other library dependencies
- no exported use of unsafe.Pointer
- use Go slices for passing arrays
Function stubs were generated from the gl.xml spec file,
however there were enough special cases (and few enough
functions in the ES spec) that it was easier to construct
most of this file by hand rather than complete a generator
script. So it is not included in this CL.
LGTM=adg
R=golang-codereviews, bryanturley, adg, capnm9
CC=golang-codereviews
https://golang.org/cl/127870043