Monday, February 11, 2008

It starts

So in order to get this project started the first thing I did was, well naturally, download WebKit. That took about two hours. Haha. Well I guess I have time to talk about what it is that I'm going to do (or plan to do) with WebKit. In short, the plan is to enable the OpenGL API for WebKit-based Web browsers. So, a developer would be able to write an OpenGL program but instead of the rendering happening in a window provided by the operating system it would happen inside the Web browser.
After the downloading came the compiling. I ran into some difficulties because the environment for Linux has to be setup differently. Specifically, I had to install the QT development libraries and set the appropriate environment variables. The WebKit installation instructions didn't provide any help when I first ran into compiling problems, but , as always, Google helped me find the way. I eventually came across a post which explained what I need to do. The compilation took about another hour.
After that I had similar problems running the bare-bones browser which comes with
WebKit. The solution, again, was in setting up the correct environment variables.
After ensuring everything was up and running I started looking at the code structure in order to figure out where I would have to insert code to create the new OpenGL HTML tag. I searched for the HTML Canvas code by greping for the clearRect method which is specific to the Canvas API. I found two main places where the code laid. The first is WebKit/WebCore/html which is where the code for each of the HTML elements lives. The second is /WebKit/WebCore/rendering which is where the code that actually does the rendering for the HTML Canvas tag lives. I looks like it is within these two directories that the majority of the WebOpenGL code will reside.

1 comment:

Anonymous said...

The correct approach would be to add a new 3d context to canvas. eg. Using the canvas API's getContext method something of the form
getContext("webkit-3d"). Mozilla and Opera are both looking at integrating 3d support to their canvas implementations so you may wish to look at what they're doing:
http://wiki.mozilla.org/Canvas:3D
http://my.opera.com/timjoh/blog/2007/11/13/taking-the-canvas-to-another-dimension

Personally i'm in favour of Opera's model