Author Topic: Would a WebGL port be possible via GWT?  (Read 965 times)

Offline Darkflame

  • int
  • **
  • Posts: 55
    • View Profile
Would a WebGL port be possible via GWT?
« on: April 15, 2013, 06:56:07 pm »
At the moment this is speculation, but I'd like feedback on how hard this would be as (with permission) its something I might like to try a few months from now.

I am a really big fan of Jpct, its made my Android project a lot easier.
I do a lot of web work as well, and it would be nice if I could leverage my knowledge of Jpct to make 3d web apps and games easily.

*WebGL is based on Open GL ES.

*GWT is a rather nice framework for writing Java and having it cross-compiled to Javascript.  It works well enough that you can normally reuse Java libs you might have, provided they are not intended for any visual or loading stuff. (I have, for example, shared a lot of semantic logic code between a Android app and a Web game)
https://developers.google.com/web-toolkit/

* Theres already libs for GWT that allow you to use WebGL in Java:
http://code.google.com/p/gwtgl/wiki/BindingTutorial
(essentially a 1:1 mapping of the Javascript functions)



So my thinking is that it should be possible to make a version of Jcpt which you can import into a GWT project. Essentially mapping the Open GL ES functions to their equivalent WebGL  Javascript functions.

Is this a mad dream?
Is it a insane amount of work?

Thoughts?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Would a WebGL port be possible via GWT?
« Reply #1 on: April 15, 2013, 09:08:16 pm »
It might be possible, but most likely not as it is now. Loading of files and textures might be a problem as well as threading. The most problems will be caused by jPCT-AE's support for OpenGL ES1.x. There's no match for this in WebGL, so it had to be stripped.

Offline Darkflame

  • int
  • **
  • Posts: 55
    • View Profile
Re: Would a WebGL port be possible via GWT?
« Reply #2 on: April 15, 2013, 09:39:21 pm »
Thats a shame.
I could probably work around any loading issues, but I have little knowledge of threading in regard to Jpct. Is multi-threading is needed?I am not even sure if GWT supports webworkers. :-/

Quote
The most problems will be caused by jPCT-AE's support for OpenGL ES1.x. There's no match for this in WebGL, so it had to be stripped.

How badly will stripping it mess up the rest of the code?

I guess the end goal of this is to have jPCT usable to the state which you can load and manipulate objects without having to write hundreds of lines just to display a white triangle ;)