Monday, October 1, 2007

OpenGL on Nebula3

I just started working on a port of nebula3 to support OpenGL yesterday. My main objective for this is to have nebula3 run on Linux and more importantly on Mac OSX. I like how nebula3 has been broken down into many smaller modules, it makes it much easier to work with and code for.

I created two new classes Win32OGLRenderDevice and Win32OGLDisplayDevice. The Win32OGLRenderDevice was pretty straight forward but the display device was a bit tricky. It turns out that for you to query hardware capabilities you have to attach a render context and for you to create a render context with the capabilities that you require you have to query the hardware's capabilities - chicken or the egg anyone?


I have it such that the display device first creates a renderdevice and opens a window with default capabilities then queries for the required capabilities e.g. fsaa etc then re-opens the window with those.

After about 4 hours of work, I had a DisplayDevice and a RenderDevice compiling but I cant test it yet since when the base RenderDevice opens it creates a render target which I have not implemented yet and the currently implemented one is tied to the Direct3DRenderDevice.

I want to have OpenGL running on Windows first before I start porting nebula3 to linux and later Mac OS as I don't have access to a Mac yet.

No comments: