Hi,
I'm currently thinking about an class for GWT which wraps the WebGL
(*) interface. It should be easy to wrap all the methods. E.g.
glBindTexture would look like this:
public native void bindTexture(int target, JavaScriptObject texture) /
*-{
[email protected]::gl.bindTexture(target, texture);
}-*/;
Since native methods are inline, there should be no overhead. However,
the problem is, what to do with fields? It would be nice to have them
as static final fields in the GWT-WebGL class. Is there any way that
an static final field is mapped internally/inline to it's
corresponding field in native JavaScript?
I think I need something like this:
public native static final int TEXTURE_2D = /*-
{ [email protected]::gl.TEXTURE_2D }-*/;
Is this kind of native fields even possible?
Since all fields do not change and are well defined it would be
possible to define them all in the class. But because there are MANY
of them, I'm not sure if that solution is wise:
public static final int TEXTURE_2D = 0x0DE1;
Would this blow up the compiled code size?
Another way would be something like this:
public native int TEXTURE_2D() /*-{
return [email protected]::gl.TEXTURE_2D;
}-*/;
Should be fast, but ugly because I would need "()" brackets
everywhere.
What do you think is the best way to do this?
thanks in advance,
best regards,
Coolcat
(*) WebGL is an OpenGL binding for JavaScript, currently supported by
development versions of Firefox, Google Chorme and Safari. It allows
hardware accelerated 3D graphics, even shaders, with no need for
plugins.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---