|
Home
|
Examples
|
Download
|
Google Code
|
Documentation
|
About
|

Click to start JebGL...

Click to start WebGL...

JebGL is a piece of Javascript which lets you run your WebGL apps in browsers lacking WebGL support without having to modify your existing code! Behind the scenes JebGL uses a fallback Java applet to emulate the WebGL canvas if needed, and the Java applet runs hardware accelerated on all platforms using JOGL. JebGL is open source, released under the MIT license.

Usage

Essentially, all you need to do is include the jebgl.js, and change the function that runs after the page has loaded. E.g. if you call drawHandler() you would instead call jebgl(canvasElement, drawHandler). JebGL checks if your browser supports WebGL, and if not it replaces the canvas with the JebGL applet.

Example

This is an example using jQuery. If the function that does the drawing is called drawHandler() so might be running your app like this:

<script type="text/javascript">
  $(function() {
    var context = $("#canvas").get(0).getContext("experimental-webgl");
    drawHandler(context);
  });
</script>

Using JebGL you would change this to:

<script type="text/javascript" 
         src="http://jebgl.googlecode.com/files/jebgl-0.1.js"></script>

<script type="text/javascript">
  $(function() {
    jebgl($("#canvas").get(0), function() {
      var context = $("#canvas").get(0).getContext("experimental-webgl");
      drawHandler(context);
    });
  });
</script>

You pass the canvas element to the jebgl() so that it can replace it in case it is needed.

Download

Latest release:0.1 (2011.06.11)
Latest code:SVN repository

Follow us

Join forum

or send a question to jebgl@googlegroups.com.