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
Also fix String methods' receivers to be T, not *T, so that
var m f32.Mat32
s := fmt.Sprintf("m=%v", m)
works.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/147490043
This lets you run really simple apps in a window on an OS X
machine. It's not an official target, but slightly more
productive than waiting for an apk install when working on
the sprite package.
LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/147910043
This Dockerfile provides a base environment for building
Go Android apps. It can build example/basic, and that's
where I stopped for today.
$ docker build -t mobile /path/to/go.mobile
$ docker run --rm mobile /bin/bash -c 'cd example/gopher && ./make.bash'
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/151010043
This code is an import from my long-defunct graphics
library, code.google.com/p/graphics-go. It was
reviewed by nigeltao back in the day.
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/142520043
I apologise for the poor state of this library.
I hope to improve it significantly soon. Right
now it exists to support example/gopher and the
debug library.
LGTM=nigeltao
R=nigeltao, bryanturley
CC=adg, davidday, golang-codereviews
https://golang.org/cl/141440043
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
This example now uses the pre-L build system.
A gradle-based example will follow as soon as
I am testing on Android L devices.
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/143900043
This is the first example of an App written entirely in Go that
draws to the device screen. Build and run process is driven
entirely by all.bash, no need for the Android Studio button
mashing in the lib* examples.
LGTM=nigeltao
R=golang-codereviews, nigeltao, bryanturley
CC=golang-codereviews
https://golang.org/cl/130420043
Missing many features (like event processing). This is
just enough to get example/basic working.
LGTM=nigeltao
R=golang-codereviews, capnm9, bryanturley, nigeltao, crawshaw
CC=golang-codereviews
https://golang.org/cl/131030043
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