Commit Graph

18 Commits

Author SHA1 Message Date
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 c0dc93779f gl/glutil: context is only for desktop darwin
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>
2015-02-21 01:04:00 +00:00
Hyang-Ah Hana Kim 90d6854261 mobile: add extra build tags.
missing ones from https://go-review.googlesource.com/#/c/2902/

Change-Id: If42f9e53bdd7be468315ad746ba35d397a874ee6
Reviewed-on: https://go-review.googlesource.com/2965
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-01-20 15:15:48 +00:00
David Symonds 7b659348a5 mobile: add import comments.
Change-Id: I0ff6d42a8e11f49df6fc3066e86be75015b93631
Reviewed-on: https://go-review.googlesource.com/1238
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-10 01:59:04 +00:00
Andrew Gerrand 9470e0ba58 go.mobile: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/162710043
2014-11-10 08:55:57 +11:00
Nigel Tao 3e603f3a38 go.mobile/gl/glutil: enable glimage_test on linux/X11.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/167020043
2014-11-03 10:31:19 +11:00
David Crawshaw b208e914e7 go.mobile/gl/glutil: take advantage of new degree of freedom in test
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/166030043
2014-11-01 07:48:07 -04:00
Nigel Tao 970a0a0162 go.mobile/gl/glutil: let Image.Draw draw non-axis-aligned quads.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/160710043
2014-10-31 14:32:34 +11:00
David Crawshaw 0ac70a3835 go.mobile/gl/glutil, go.mobile/app/debug: create glimage with pixel size
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/165940043
2014-10-30 19:43:51 -04:00
David Crawshaw fd18e8dcec go.mobile/gl/glutil: correct image size and switch to testpattern.png
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/167910043
2014-10-30 17:30:38 -04:00
David Crawshaw 897e5be307 go.mobile/gl/glutil: use correct image bounds in translation
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
2014-10-30 17:26:23 -04:00
Nigel Tao 2457abfa93 go.mobile/f32: add a f32.Bytes function.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/166720044
2014-10-29 09:19:38 +11:00
Nigel Tao 3aced57cb0 go.mobile/gl/glutil: use a triangle strip instead of two triangles.
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
2014-10-28 10:55:58 +11:00
Nigel Tao fab1e51609 go.mobile/geom: rename Scale to PixelsPerPt.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/160160043
2014-10-22 13:50:04 +11:00
David Crawshaw 17b03aaff9 go.mobile: a test for glutil.Image
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/152420043
2014-10-12 18:01:54 -07:00
David Crawshaw 8a5f40b7b3 go.mobile: move glimage to glutil package and export
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
2014-10-12 17:58:22 -07: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 1d1714ebe9 go.mobile/gl/glutil: OpenGL utilities package
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
2014-09-05 14:02:43 -04:00