Commit Graph

10 Commits

Author SHA1 Message Date
Dmitri Shuralyov a01c060faa gl: Improve API signatures to match spec, improve docs.
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.
Resolves golang/go#10218 again.

Change-Id: I5b822235d9485701186a43dae0b9fd898cc6a3d8
Reviewed-on: https://go-review.googlesource.com/8166
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-30 19:58:17 +00:00
Dmitri Shuralyov eaba00bca5 gl: use better spec-defined func names, fix bug, increase consistency
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.
Resolves golang/go#10218.

Change-Id: Ib33dfff7c22c4d178b2e6b8d228f80f3c17308a8
Reviewed-on: https://go-review.googlesource.com/8000
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-25 21:38:11 +00:00
David Crawshaw 25e80f6a77 gl: build on darwin/arm
Change-Id: I9962d49a4e620fb734bc218ebfa558336ade8e06
Reviewed-on: https://go-review.googlesource.com/5200
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-02-19 15:56:40 +00:00
Hyang-Ah Hana Kim a8fcf739b9 mobile: limit app/font/gl packages to linux/darwin.
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>
2015-01-15 20:16:28 +00:00
David Crawshaw e8bfa872c4 gl: use Uniform type for consistency
Change-Id: I90a813c0823498297ff0bb7718bee6cd61b87581
Reviewed-on: https://go-review.googlesource.com/1517
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2014-12-15 17:53:49 +00:00
Hana (Hyang-Ah) Kim daf6d8060b gl: use go generate to generate gldebug.go by invoking gendebug.go
Change-Id: I7d682d153da5b200f9dd5cea8d09d76935daa18c
Reviewed-on: https://go-review.googlesource.com/1225
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2014-12-09 17:31:03 +00:00
David Crawshaw 81f7d26930 gl: regen gldebug.go and stop logging on glBoolean
Change-Id: Icad6cb694b31924164483609e0fd9c7cce8e3f0d
Reviewed-on: https://go-review.googlesource.com/1185
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2014-12-08 23:39:28 +00:00
David Crawshaw 5875cc8cf7 x/mobile/go: remove GLES2 headers
LGTM=nigeltao
R=rsc, nigeltao
CC=golang-codereviews
https://golang.org/cl/174590043
2014-12-05 10:14:12 -05:00
David Crawshaw b1ea4eba37 go.mobile/gl: f32 utilities and extra debugging
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
2014-09-17 18:07:50 -04:00
David Crawshaw 3bd69d3fcc go.mobile/gl: tracing debug mode
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
2014-08-26 10:03:00 -04:00