Jump to content

[WIP] gles.js - OpenGL ES bindings for JS (aka fast WebGL for Android)


Boris van Schooten
 Share

Recommended Posts

Hi Boris,

 
I have been trying to compile latest version of v8 and came across your post onstackoverflow.com.
 
I made the changes which worked for you but i still see errors when i compile with my android jni code.

api.cc:function v8::CheckConstructor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSObject>, char const*): error: undefined reference to 'V8_Fatal'

:

:

 

libv8_base.a(runtime-i18n.o):runtime-i18n.cc:function v8::internal::Runtime_GetLanguageTagVariants(int, v8::internal::Object**, v8::internal::Isolate*): error: undefined reference to 'uloc_getBaseName_54'

:

 

libv8_base.a(runtime-test.o):runtime-test.cc:function v8::internal::Runtime_AbortJS(int, v8::internal::Object**, v8::internal::Isolate*): error: undefined reference to 'v8::base::OS::Abort()'

 

Would really appreciate your help on this!!

 

Thanks!!

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
  • 6 months later...

I tried to get gles.js to work using Android Studio (v1.5.1) and I just want to try a simple pixi demo to see if I can get this working. However, I ran into some problems. Here's what I tried:

  1. First, open Android Studio and import the project (as downloaded from github)
  2. Then build and run and I got a Gradle error "NDK integration is deprecated in the current plugin" which was solved after adding a file gradle.properties with content "android.useDeprecatedNdk=true" to root of project (answer found here)
  3. Tried to run again, but get a console error "Error opening directory '/mnt/sdcard/.android_secure/', skipping: Permission denied." so I add to AndroidManifest.xml: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  4. I also got this error at one point but that somehow went away again: 04-03 11:48:35.678 275-379/system_process E/ThrottleService: problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException: /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)
  5. Then I got an error that it can't find "ndk-build.cmd" So I downloaded the NDK which is about 700+ MB (note: the NDK can't be installed via the Android SDK Manager) and paste into the directory  C:\Users\JohnDoe\AppData\Local\Android\sdk\ndk-bundle and in file local.properties I add a line:  ndk.dir=C\:\\Users\\JohnDoe\\AppData\\Local\\Android\\sdk\\ndk-bundle

But now I'm stuck with an error in main.cpp "android_native_app_glue.h: No such file or directory" :wacko:

I think only the libglesjs.so needs to be added to the project, but looking at the instructions here I can't make heads or tails of it.. :blink: Anyone here who is familiar with Android Studio ?

Link to comment
Share on other sites

  • 2 weeks later...

I've managed to get it working in Android Studio :) I've uploaded the Android Studio project to github

However, I run into an issue with the touch input, the dude in my example just moves up and down when I swipe left and right. But when I swipe up and down doesn't move, the x position never changes and is always 100..? Does anyone have any ideas or know how to fix this?

EDIT: Never mind, I was accidentally using an older  html5.js from the PhaserExampleInvaders.apk example, which still had

function _mouseMoveCallback(x,y) {

instead of

function _mouseMoveCallback(ptrid,x,y) {
Edited by BdR
Accidentally was using an older html5.js version from PhaserExampleInvaders.apk
Link to comment
Share on other sites

On 7-7-2014 at 11:15 PM, Boris van Schooten said:

Finished coding basic support for DOM, input, and sound, and a few more GL bindings.  I just got my first game running on it!  Check out the APK on the website.

At the moment I'm trying to get sound working in GLESJS, but it keeps either not playing the sounds or crashing the app. :wacko:

At first I added audio tags to index.html and then loading them, but that didn't work.

<audio id="forcefield" preload="auto" type="audio/wav">
	<source src="snd/forcefield.wav" type="audio/wav"/>
</audio>
// and then load it like this:
soundForcefield = new Audio('forcefield');
//soundForcefield = new Audio('snd/forcefield.wav'); // same effect

Then I saw your TsunamiCruiser apk file and I added JGAudio.js to my project, but that also crashes.

// first load sound in prefloader
JGAudio.load('forcefield', 'snd/forcefield');

// and then later play it
JGAudio.play('forcefield');

When I call soundForcefield.play() or JGAudio.play('forcefield') it crashes the entire app, and gives this error:

E/dalvikvm: JNI ERROR (app bug): accessed stale local reference 0x32b00005 (index 1 in a table of size 1)
E/dalvikvm: VM aborting
A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 17169 (Thread-10633)

I have no idea what I'm doing wrong, because when I run the same thing in my browser (Chrome on Win8.1) it runs fine with sound.

I've updated my github example but with the .play line disabled for now.
https://github.com/BdR76/GLES.JS-Android-Studio-project

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...