Code Monkey home page Code Monkey logo

gles.js-android-studio-project's Introduction

GLESjs project for Android Studio

This is an Android Studio project that uses the GLES.JS project by Boris van Schooten.

Setting up an Android Studio project with GLES.JS was not very intuitive and requires gradle editing and other steps etc. So I wanted to provide a working example to anyone interested in working with GLES.JS.

I've set up the project file through trial and error so if you have any it works, but it might contain incorrect settings or redundant files. Any suggestions or improvements, please let me know (see end of file).

preview screenshot

GLESjs

GLES.JS on github

GLES.JS by Boris van Schooten (tmtg.net / [email protected]) provides Android WebGL bindings for the Javascript V8 engine (ARMv7 architecture).

The purpose of GLES.JS is to wrap a HTML5/JavaScript game and compile it into a native Android app. GLESjs translates the WebGL calls directly to OpenGL ES, giving the game a much increased performance when compared to wrapping it with Cordova/PhoneGap or CocoonJS.

Put simply, glesjs "binds" the JavaScript canvas element directly to the GPU of a Android device, making it possible to package JavaScript 2D action games that need to run at 60 frames per second (fps). The downside is that the compatibility with DOM objects is limited.

HTML5/JavaScript game frameworks that render inside a canvas element can probably benefit from GLESjs, but frameworks that focus more on HTML, CSS and DOM manipulations will probably not benefit, so:

Possible benefit Probably NO benefit
Phaser jQuery
pixi.js Angular
Three.js React.js
Panda.js Ember.js
etc. etc.

Android Studio project

How to install this project Android Studio

  1. Copy the folder "Android Studio project" to your projects folder (for example to C:\Users<MyUsername>\AndroidStudioProjects)
  2. Rename the folder to your project name, for example "MyNewGLESJSGame"
  3. Open Android Studio and select "Open an existing Android Studio project"
  4. select the folder "MyNewGLESJSGame"
  5. Build app and run

Difference with browser

GLES.JS has some limitations over browser

  • limited HTML handling and DOM manipulation
  • limited handling of XML structures (so Phaser.js fonts don't work)

There are some minor differences between running your HTML5/Jaascript game with GLES.js when compared to running them in a browser like Chrome or Firefox:

  • glesjs requires the html5.js file provided with glesjs

  • not glesjs related, but when you try to run a Phaser game in Chrome from your local harddisk (istead of a internet fileserver) by default Chrome won't load images and sounds from your local harddisk. You can fix this by starting Chrome with the parameter:

    chrome.exe --allow-file-access-from-files

History

2016-apr-10 Android Studio projetc released on github

Send any questions, comments to Bas de Reuver - [email protected]

gles.js-android-studio-project's People

Contributors

bdr76 avatar tbfly avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.