mojo-html5-gl
mojo-html5-gl copied to clipboard
An experimental patch for mojo, that replaces the standard 2d-context with WebGL (abandoned)
This patch is deprecated!
There won’t be no updates, no bugfixes, no compatibility with new Monkey versions.
How to add WebGL support for mojo now?
I made new implementation of WebGL support for mojo in my Monkey fork - mungo. It’s a better implementation which gives ~10 time better performance than this patch and works in IE11. Here is a small demo.
Now you can use these two methods to enable WebGL acceleration for your mojo projects:
1. Download and install mungo
The fastest way to use new WebGL implementation for mojo is to download and install mungo.
2. Create custom HTML5 target
If you don’t want to use mungo you can add WebGL support for mojo by following this short manual:
- Create a new HTML5 target based on the standard HTML5 monkey target.
- Rename directory of the new target. For example: html5_webgl
- There, replace files in modules/native folder by files from mungo
- Rename new target in
TARGET.MONKEY
file. For example:#TARGET_NAME="Html5 WebGL Game"
- Copy-paste code from mojo.html5.webgl.js file into
template/main.js
file after//${TRANSCODE_END}
line - Add
#HTML5_WEBGL_ENABLED=True
intemplate/CONFIG.MONKEY
file
Mojo HTML5 GL
An experimental patch for mojo, that replaces the standard 2d-context with WebGL.
Features
- It does not require code changes
- High SetBlend performance for images
- High SetColor performance for images
- #MOJO_IMAGE_FILTERING_ENABLED support
- Chrome Frame support
- It works in browsers that do not support WebGL (2d-context used)
- Small file size - 12KB only!
Usage
- Just connect mojo.html5.gl.min.js to a page with the game.
- Optional. Enable Chrome Frame support in Internet Explorer. More info.