A question about OpenGL and porting between platforms...
I have some existing code that uses X specific data structures (e.g., GLXDrawable). I want to port this code to Macintosh, which doesn''t use the X data structures, but uses some similar ones (e.g., AGLDrawable). Is conditional compilation the general solution for this type of thing? Or is there a better solution within the OpenGL framework? Thanks.
There is stil GLUT, but that''s not always a good solution. I would include everything system specific in a seperate source file, divided by ifdef''s, and with a standard API. Don''t put multi-platform conditional compilation commands in your general code - that''s going to be #ifdef hell. But if you isolate everything, then this is IMO the best way to do it.