Irrlicht and OFW

I’m attempting to write a Irrlicht wrapper for OFW.

1 ) First problem getting the includes to compile. I have posted the details here.

The basic problem, if you include irrlicht after ofw, then there are clashes of types (PI definition in fact)

#include “ofMain.h”
#include “testApp.h”
#include “irrlicht.h”

But if you include it before, everything compiles ok

#include “irrlicht.h”
#include “ofMain.h”
#include “testApp.h”

How could I get around this, because the wrapper would init after ofw?

  1. I need to start an Irrlicht window within opengl/glut ofws window. Does the glut window have an id?

glutCreateWindow("");

Why-I-need-an-id

Thanks

about (1) I’m not sure that that is a problem, include order doesn’t really matter, it’s more of when you get around to using the things themselves. we’ve written our #defines so that if PI is defined elsewhere, it should be ok.

about (2) this will give you the current hwnd:

  
  
HWND wnd = WindowFromDC(wglGetCurrentDC());   
  

there are other ways involving naming the glut window, but this seems to work ok (I use it for some libs that require it)

take care
zach

ps but I believe IRRLICHT and OF will colide all over the place, since they are both windowing libraries (like glut vs directshow) and I’m not sure what the outcome will be. good luck.

if you want, you can rip out all the glut stuff altogether to get OF running on top of irrlicht (we’ve run OF on top of CPW, glut and wxWindows) but glut calls are in alot of the code at this point.