This change deletes unnecessary files - they are auto-generated by
the gomobile bind command.
Change-Id: I490664dfcf52683dd8d2ea821d0b7e458bc06671
Reviewed-on: https://go-review.googlesource.com/8925
Reviewed-by: David Crawshaw <crawshaw@golang.org>
OpenAL Soft is licensed with LGPL which requires users to add a notice
about its license under their open source notices screen.
Change-Id: Ic3c3bcc4a38896508b19d54a8c526bcd1fa9d5b3
Reviewed-on: https://go-review.googlesource.com/8868
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Orientation invokes onNativeWindowRedrawNeeded.
Requery the window width and height when redraw needed.
Change-Id: I45816f13b42db38e71d28cb05bf7cfffda75882c
Reviewed-on: https://go-review.googlesource.com/8700
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This is to enable more flexible encoding/decoding of Go string.
For Java, we use UTF16 to be compatible with java string.
For other languages, we will want other way to represent a string.
Change-Id: Iccd53e2eea18d37636c3c619d06cb473facef0cd
Reviewed-on: https://go-review.googlesource.com/8628
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Drain the event queue between ALooper_pollAll calls. ALooper_pollAll
makes an epoll to see if there is any I/O going on the underlying
resources and is relatively a costly operation. Try to consume the
queue first and block on pollAll again if necessary.
We should stop retrying if timeout occurs and return immediately.
Change-Id: I6e9f85df2dd275fb014f90f13de4f05d776d4b7d
Reviewed-on: https://go-review.googlesource.com/8590
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Don't block on Read forever, force timeout if nothing happens for
a while. 30 secs is high enough not to be the desired delay for
the movement sensors.
Change-Id: I257120809855382d7a945a132f5b7a2cff1ecfca
Reviewed-on: https://go-review.googlesource.com/8580
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
If the looper is waking up, the current timeout limit is exceeded.
There are no external APIs to query if a looper is trying to wake up
or blocking to wait for the event data. Therefore, I'm this
change and will replace the timeout with a significantly high number
that could only be exceeded if sensor fails with a fatal problem.
The goal is not to wait on ALooper_pollAll forever.
This reverts commit 1575a42f33.
Change-Id: I861d81f2550c4435247a0b1d4ce141e94d1e3ec9
Reviewed-on: https://go-review.googlesource.com/8565
Reviewed-by: Burcu Dogan <jbd@google.com>
The necessity to destroy an ALC context is not to leave a leaking
context as Context instances are being collected. If the user doesn't
Destroy, do it when finalizing. If a context is destroyed by the user,
a finalizer is no more needed.
Change-Id: If6330361f7983ec8ede0e93b7f6e3a440de9fd6c
Reviewed-on: https://go-review.googlesource.com/8497
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
It's a common requirement to call MakeContextCurrent with a nil value
before destroying a context. Nil value as a reciever is not as user-
friendly as a standalone MakeContextCurrent.
Change-Id: I537ec0330657ef134f97a3c3b0d32793012eee86
Reviewed-on: https://go-review.googlesource.com/8500
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Avoid blocking forever until there are no new events in the
queue. The queue should have been fed with new events once in each t,
where t is 2 * minimum delay enabled on the queue.
Change-Id: Ie6c754816e89a93adf62d71448c6c85f167350eb
Reviewed-on: https://go-review.googlesource.com/8414
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I0550055b54545b75248bb76086377ebbedda7f58
Reviewed-on: https://go-review.googlesource.com/8458
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I42152d6fd5af220a780a6e3a288a97551ee53f39
Reviewed-on: https://go-review.googlesource.com/8413
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Iae635926dad40248df2a14a6bb2fbaff1b5bcd03
Reviewed-on: https://go-review.googlesource.com/8412
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL contains an Android-specific Manager implementation.
On Android, we create a new ALooper for each Manager instance and
all CGO calls are proxified to an OS-thread-locked goroutine.
Change-Id: I33272cd4369d0b7850f97e840fe4bbe5aee78ec0
Reviewed-on: https://go-review.googlesource.com/8249
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Manager ops are not promised to be thread-safe.
Change-Id: Ib28b80d758234a7a19287c457c57099e36d73f9b
Reviewed-on: https://go-review.googlesource.com/8248
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Instead of the ad-hoc output directory structure to hold java source code
and compiled .so files, this change makes the bind command create an AAR
bundle. AAR is the format for Android library project/module outputs.
AAR is similar to .jar except that includes resource files.
http://tools.android.com/tech-docs/new-build-system/aar-format
This AAR format is in the Android's new build system's roadmap (
http://tools.android.com/tech-docs/jackandjill) and Android IDEs
are likely supporting the format.
For integration with Android Studio project, the user is expected to place
the .aar file to the main app's libs directory and specify the dependency
in the gradle rule. This can be done through a gradle plugin or with Android
Studio integration. For Buck, the .aar file can be the input of the
android_prebuilt_aar rule.
This depends on the availability of javac and android SDK -
which may not be an issue because the bind users will need them anyway
to build their main app.
Change-Id: I635902e994d002bb875c7838e19f172e187b0b87
Reviewed-on: https://go-review.googlesource.com/8084
Reviewed-by: David Crawshaw <crawshaw@golang.org>
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>
Sensors package will contain APIs to read data from a wide variety
of movement, position and other physical signals.
This CL contains the initial APIs that are targeting event-based
sensors. Some of the concerns that influenced the APIs are:
- Target game developers. Latency is critical, allow output rates
up to ~10 samples per second.
- It’s rarely possible to predetermine the minimally viable sample
rate requirement of the app. - Allow users to set an upper bound rate
to avoid garbage and preserve battery life.
- Allow multiple instances of accelerometer, gyroscope, magnetometer
and altimeter sensors to be started. Optimize the share of the
underlying resources as long as it is not a bottleneck for the
sample rate.
- Prefer blocking APIs. An automatic
poll-timeout could be useful if we’re far behind the sample rate.
But, sensor initialization and waking-up significantly take longer
and there is no easy way to determine a sensor is in either one of
these states.
- Provide timestamps for each event to determine the actual rate of
the sensor data.
- Allow user to return multiple events from each call. Buffering the
events at the cost of additional latency is sometimes more
neglectable than the overhead of a function call that polls the
events one by one. Allow user to determine how many items they want
to buffer. The typical latency of a read a single event is 56 usec.
Reading 8-16 events at once has a relatively lower bound per event.
For high precision throughput, the opportunity to minimize a
function call overhead could be useful.
- Allow users to check the sensor availability on the device.
Change-Id: I9582c8f025d9f922d9635e247d60817f95bdacb9
Reviewed-on: https://go-review.googlesource.com/8174
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I2a41cf0f16dcefe87c73ab0a8f02a251c1243157
Reviewed-on: https://go-review.googlesource.com/8121
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
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>
See golang.org/cl/4131 for context.
Change-Id: I94f2b9dc20fc8ab6156257de157c98cb887a0709
Reviewed-on: https://go-review.googlesource.com/7725
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: Id3c5c58050fa11ec57e8efd2661047dc5e0dfc2d
Reviewed-on: https://go-review.googlesource.com/7665
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The audio package runs on Android now, we can list it on README.
Change-Id: I2ff03f025328a1d0e6ffc12b860ace9c980dc422
Reviewed-on: https://go-review.googlesource.com/7521
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
filepath.Join returns a Cleaned path that went through FromSlash.
Change-Id: I23afeea32453c3eb271d4e4bf47147940061c20f
Reviewed-on: https://go-review.googlesource.com/7161
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I47b42db1443040bcd9c77cd1d19a0e0f8c5119ec
Reviewed-on: https://go-review.googlesource.com/7090
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Comment from golang.org/cl/6642. As bionic (surprisingly) has strlcat,
using it instead of strncat. If you're not familiar with the l-variants,
see http://www.sudo.ws/todd/papers/strlcpy.html
Change-Id: I69958ee99917903f9d10dda0ec99111c4793db71
Reviewed-on: https://go-review.googlesource.com/7011
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Go.init must be called once and from the main thread.
setUp is called from a non-main thread and once per each test.
Change-Id: I848a1461793463785b38141e077da5bf5e53cb4c
Reviewed-on: https://go-review.googlesource.com/6832
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I415a6c4693be340ff8236d5f56c3c00fa95ce2e0
Reviewed-on: https://go-review.googlesource.com/6822
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I1a7282fcb31d778ff12d7a655eadbac1a01e584b
Reviewed-on: https://go-review.googlesource.com/6720
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Due to licensing limitations, OpenAL should be dynamically
loaded. Android apps that needs to import the audio package
needs to be packed with libopenal.so as an extenal lib
dependency.
Instructions to build OpenAL for Android is available at
http://repo.or.cz/w/openal-soft.git/blob/HEAD:/XCompile-Android.txt
The packed libopenal.so is exported to
/data/data/<package_name>/lib/libopenal.so at installation.
The audio package dlopens libopenal.so from this location and
dlsym to dispatch the OpenAL functions.
Change-Id: I7aa36bb8dd0ae8e101ae4aa5366c3d426b2569a9
Reviewed-on: https://go-review.googlesource.com/6642
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Also moved the full ndk fetch into a separate function.
Change-Id: Ib5c4687e98a5d92ff3aa3ca99ec0ebee85d31f86
Reviewed-on: https://go-review.googlesource.com/6662
Reviewed-by: David Crawshaw <crawshaw@golang.org>
There is no good reason for MakeCurrentContext to be a standalone
function since we don't allow nil contextes to be the current.
Change-Id: I4483c30a2ed78262b67c96e73739188a22f685b9
Reviewed-on: https://go-review.googlesource.com/6640
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I68dcc392b0ae7c539c12c6306d9b312d02603b5b
Reviewed-on: https://go-review.googlesource.com/6570
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
context: https://go-review.googlesource.com/6510
Windows env var names are case insensitive and may contain "=".
Before merging, apply strings.ToUpper. Pass env vars that are not
in "key=value" form untouched.
Change-Id: I0d51d2f3bc64fcee72f765c04c550299d7b285e9
Reviewed-on: https://go-review.googlesource.com/6513
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>