Posted by
Sven Gothel on
Mar 04, 2011; 2:28pm
URL: https://forum.jogamp.org/WebGL-specification-1-0-is-final-and-also-WebCL-tp2631673p2633350.html
On Friday, March 04, 2011 08:40:24 BrickFarmer [via jogamp] wrote:
>
> This should interest a few people here:
>
>
http://learningwebgl.com/blog/?p=3396> original:
>
http://www.khronos.org/news/press/releases/khronos-releases-final-webgl-1.0-specification>
> So when are we going to add a WebGL binding to JOGL? :)
Well, I thought about this too, ie allowing a more tight HTML5 integration
using WebGL's offscreen (layer) rendering for later compositioning.
The problem right now is to gain access to WebGL's current context.
For example:
+++
<!DOCTYPE html>
<html>
<head>
<title>WebGL + JOGL</title>
<script>
var gl;
var joglApplet;
function webGLStart()
{
var canvas = document.getElementById("canvas");
try { gl = canvas.getContext("experimental-webgl");
} catch(e) {}
if ( !gl ) {alert("Your browser does not support WebGL"); return;}
gl.viewport(0, 0, width, height);
joglApplet = document.getElementById("GearsExtApplet");
joglApplet.display("init");
...
</head>
<body id="body" onload="webGLStart();" onresize="reshape();">
<canvas id="canvas" width="800px" height="600px">
There is supposed to be an example drawing here, but it's not important.
</canvas>
<applet id="GearsExtApplet" name="GearsExtApplet" code="org.jdesktop.applet.util.JNLPAppletLauncher"
...
+++
would integrate the JOGL Applet with WebGL.
But WebGL runs in the browser process (or it's own if they have a proper and secure layering)
and the Java Applet runs in it's own process.
This renders it impossible to fetch WebGL's current GL context from the JOGL side.
Until we have access to the native WebGL context or drawable, I am afraid we are out of luck.
>
> It sounds like there are already quite a few 'post PC' devices supporting
> this.
>
> What next, JOGL on 1 million iPhones anyone?
Sure .. but natively via dalvik etc :)
It's in the pipe ..
~Sven