Montag, 28. März 2011

GwtGL examples and Opera

A few weeks ago, a preview of Opera with WebGL support was published.

I activated Opera in the GwtGL examples (not live on http://gwtgl-examples.appspot.com/):

Now our *.gwt.xml looks like this:


GwtGL and GWT 2.2 Canvas

As mentioned in my last post, GwtGL 0.9 will bring basic support for the GWT 2.2 Canvas widget.

But how must the Code be changed to use that?
At the moment, you have sth. like this to initialize your WebGLCanvas:
WebGLCanvas webGLCanvas = new WebGLCanvas("500px", "500px");
glContext = webGLCanvas.getGlContext();
glContext.viewport(0, 0, 500, 500);
[...]
To use the GWT 2.2 Canvas you must include the GWT module containing the canvas widget:
<inherits name='com.google.gwt.canvas.Canvas'/>
and change the initialization code to:
webGLCanvas = Canvas.createIfSupported();
webGLCanvas.setCoordinateSpaceHeight(500);
webGLCanvas.setCoordinateSpaceWidth(500);
glContext = (WebGLRenderingContext) webGLCanvas.getContext("experimental-webgl");

glContext.viewport(0, 0, 500, 500);

[...]
Remember: The Canvas and WebGLRenderingContext can both be null if the browser doesn't support Canvas or WebGL.


Now that it's possible to use a standard GWT widget for GwtGL, our own WebGLCanvas will be deprecated. But we don't delete it as you can't use the WebGLContextAttributes with the GWT 2.2 Canvas.

Montag, 21. März 2011

Updated GwtGL Roadmap

Much has changed in the last weeks:
  • WebGL 1.0 is final! 
  • Google Chrome 10 supports WebGL
  • Firefox 4 (of course with WebGL support) is on its way
  • A first preview of Opera with WebGL support was released
So we decided to update the GwtGL roadmap. We planned 3 releases:
  • 0.3 will be released to support Chrome 10 and Firefox 4
  • 0.9 will provide support for the GWT 2.2 Canvas widget together with a renewal of the WebGlRenderingContext.
  • 1.0 will be our first stable release
Sadly GwtGL 0.9 will break some of the existing APIs.