Commit Graph

59 Commits

Author SHA1 Message Date
David Crawshaw 07f3aef267 go.mobile/sprite/clock: Time type and Cubic Bezier tween functions
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/151120043
2014-10-07 12:19:04 -07:00
David Crawshaw c7a16f3e6b go.mobile/sprite: use f32.Affine and draw to backing image
LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/146150043
2014-10-03 14:56:54 +10:00
Nigel Tao 925df10ad0 go.mobile/f32: make matrix multiplication work even if the dst matrix
is the same as an arg matrix.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/152850043
2014-10-03 14:33:15 +10:00
Nigel Tao d3df5eca0b go.mobile/f32: fix matrix multiply to be m0*m1 not m1*m0.
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
2014-10-03 12:33:49 +10:00
Nigel Tao 52d35457e3 go.mobile/f32: add an Affine type.
Also fix the f32_test.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/149310043
2014-10-03 09:25:48 +10:00
Nigel Tao fac63c531f go.mobile/sprite: initial check-in.
Mostly just a design sketch for now.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/150390043
2014-10-02 13:25:02 +10:00
Nigel Tao 4313b67f84 go.mobile/f32: make Mat4.Translate take a pointer, to be consistent
with the other methods.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/147420043
2014-10-02 09:35:09 +10:00
Nigel Tao 75e726bb56 go.mobile/f32: add a Mat3 type.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/150380043
2014-10-01 13:51:19 +10:00
David Crawshaw 5217175bab go.mobile/app: darwin window drawing support for debugging
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
2014-09-29 13:22:23 +10:00
David Crawshaw 659ad767f0 go.mobile/testdata: add some small gophers
LGTM=adg
R=adg, nigeltao
CC=golang-codereviews
https://golang.org/cl/151840043
2014-09-29 07:53:16 +10:00
David Crawshaw 12badfbcea go.mobile/example/basic: fix build
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/145470043
2014-09-29 05:17:34 +10:00
David Crawshaw 39b42192b2 go.mobile/geom: introduce Rectangle
LGTM=adg
R=adg, nigeltao
CC=golang-codereviews
https://golang.org/cl/151820043
2014-09-29 05:13:18 +10:00
Andrew Gerrand 98ca0ae78e go.mobile: add Dockerfile for portable build environment
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
2014-09-28 16:09:12 +10:00
David Crawshaw 7f2ffa1c58 go.mobile/app: remove enum not defined in earlier android platforms
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/143680044
2014-09-28 08:22:16 +10:00
David Crawshaw 4ea61e7184 go.mobile/sprite/portable: affine transform
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
2014-09-27 03:10:15 +10:00
David Crawshaw 022508a5a3 go.mobile/app/debug: basic GL-based debugging tools
LGTM=nigeltao
R=nigeltao, bryanturley, crawshaw
CC=adg, davidday, golang-codereviews
https://golang.org/cl/136550043
2014-09-22 11:18:43 -04:00
David Crawshaw 8439ecbf6b go.mobile/example/gopher: import generated gopher data
As you can't see it in the review tool, there is a copyright
notice in gopher.obj:

The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
The gopher 3D model was made by Takuya Ueda (http://u.hinoichi.net).
Licensed under the Creative Commons 3.0 Attributions license.

Model from http://github.com/golang-samples/gopher-3d

LGTM=adg, nigeltao
R=nigeltao, adg, bryanturley
CC=davidday, golang-codereviews
https://golang.org/cl/143840044
2014-09-17 18:38:43 -04:00
David Crawshaw 400bc443a2 go.mobile/example/gopher: parse wavefront obj file
LGTM=nigeltao
R=nigeltao, adg
CC=davidday, golang-codereviews
https://golang.org/cl/139510043
2014-09-17 18:35:56 -04:00
David Crawshaw 79cb3f5193 go.mobile/README: update libhello instructions
LGTM=adg
R=adg, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/141480044
2014-09-17 18:12:08 -04:00
David Crawshaw 7384be2e72 go.mobile/f32: float32 math library
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
2014-09-17 18:11:21 -04: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 7dcf08fb02 go.mobile/example/libhello: make example self-contained
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
2014-09-12 10:54:02 -04:00
David Crawshaw 3b555d82f6 go.mobile/bind/java: fix build
I really need to sort out a builder story for end-to-end apps.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/136580043
2014-09-12 10:53:03 -04:00
David Crawshaw f0835e57bf go.mobile/README: update with more build instructions
LGTM=adg
R=golang-codereviews, adg, lucio.dere
CC=golang-codereviews
https://golang.org/cl/137490043
2014-09-12 05:44:53 -04:00
David Crawshaw 56cb2dac4e go.mobile/app: Touch callback
LGTM=adg, nigeltao
R=nigeltao, adg, bryanturley
CC=davidday, golang-codereviews
https://golang.org/cl/140450043
2014-09-11 19:39:16 -04:00
David Crawshaw 3fd6804d3e go.mobile/example/basic: respond to touch events
LGTM=nigeltao
R=nigeltao
CC=adg, bryanturley, davidday, golang-codereviews
https://golang.org/cl/139440043
2014-09-11 19:14:12 -04:00
David Crawshaw 1a7379ccf0 go.mobile/event: types for user input events, starting with touch
LGTM=adg, nigeltao
R=nigeltao, bryanturley, adg, crawshaw
CC=davidday, golang-codereviews
https://golang.org/cl/141060043
2014-09-09 20:54:51 -04:00
David Crawshaw f3dc0a9c65 go.mobile/example/basic: app that draws a triangle
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
2014-09-09 20:25:47 -04:00
David Crawshaw e27dbf7bf9 go.mobile/app: an exceedingly simple display loop
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
2014-09-09 19:51:04 -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
David Crawshaw 0a1cd6409e go.mobile/geom: coordinate system and unit of length
LGTM=nigeltao
R=nigeltao, ruiu
CC=adg, davidday, golang-codereviews
https://golang.org/cl/140940044
2014-09-04 09:02:06 -04:00
David Crawshaw d56aee7394 go.mobile/example: give library examples a lib prefix
LGTM=nigeltao
R=golang-codereviews, nigeltao
CC=golang-codereviews
https://golang.org/cl/130910043
2014-09-03 09:28:47 -04:00
David Crawshaw 6acad32cab go.mobile/gl: import OpenGL 2 ES headers
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
2014-09-03 09:03:42 -04:00
David Crawshaw 3d312b5a2b go.mobile: break dependency on gobind
Preparation for NativeActivity-based apps.

LGTM=nigeltao
R=golang-codereviews, nigeltao
CC=golang-codereviews
https://golang.org/cl/126520043
2014-09-03 09:03:00 -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
David Crawshaw 0394fdc6fe go.mobile/gl: OpenGL ES 2 bindings
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
2014-08-25 08:17:08 -04:00
David Crawshaw 4b6d21f64f go.mobile/app: a little documentation
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/128580044
2014-08-21 16:07:33 -04:00
David Crawshaw f53c6fa014 go.mobile/app: override log output
Results in faster writes to logcat as it skips the pipe.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/132800044
2014-08-21 16:06:11 -04:00
David Crawshaw cd38d7f2f1 go.mobile/cmd/gobind: newline after printing errors
LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/123210043
2014-08-12 14:29:18 -04:00
David Crawshaw d58b149990 go.mobile/cmd/gobind: use go/loader to load packages
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/127050043
2014-08-12 14:09:08 -04:00
David Crawshaw e8dea067be go.mobile/cmd/gobind: language binding command line tool
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/120140043
2014-08-01 10:45:18 -04:00
David Crawshaw 997628f863 go.mobile/example/hello: trivial language binding example
LGTM=adonovan
R=adonovan, adg
CC=golang-codereviews
https://golang.org/cl/116260043
2014-07-31 15:20:01 -04:00
David Crawshaw 9f144f9410 go.mobile/bind: language binding generator
Details: http://golang.org/s/gobind

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/118240044
2014-07-31 15:09:13 -04:00
David Crawshaw 1e86c633f3 go.mobile/app: initialize java language binding
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/114300043
2014-07-31 08:27:33 -04:00
David Crawshaw 5487fc8103 go.mobile/bind/java: tests of object reference tracking
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/112700044
2014-07-31 08:25:23 -04:00
David Crawshaw 6a88edec71 go.mobile/bind/java: cgo-JNI bridge using seq
Details: http://golang.org/s/gobind

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/110550044
2014-07-31 08:24:05 -04:00
David Crawshaw e9c430e74e go.mobile/app: redirect os.Stdout and os.Stderr to logcat
LGTM=sameer
R=sameer, nightlyone
CC=golang-codereviews
https://golang.org/cl/116330044
2014-07-31 08:23:38 -04:00
David Crawshaw 2861ce3b89 go.mobile/bind/seq: Go implementation of parameter serialization
Details: http://golang.org/s/gobind

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/116800043
2014-07-28 15:47:26 -04:00
David Crawshaw 35f7226e83 go.mobile: update readme, add build instructions
LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/109480043
2014-07-23 09:46:19 -07:00
David Crawshaw eaed638e63 go.mobile/example: basic android example
LGTM=bradfitz
R=bradfitz, golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/111870043
2014-07-23 09:45:34 -07:00