Hi,  I'm another newbie with mesa3d.  I've been reading the opengl programming guide, and trying out the examples.  I've written programs where the opengl stuff is in the main.cpp (executable) file, ala the example programs.  All of these programs have worked fine.

The problem comes when I try to move the graphics functions into a separate class so that I can call the class to create multiple windows.  When I initialize the graphics stuff with glutinit... functions, all is well until I get to the glut function references, like:

glutDisplayFunction(display);

when the gl/glut initialization stuff is either in my main.cpp or in the constructor for the new class (xwin), I get a compiler error:

type 'void (xwin::)()' does not match 'void(*)()'

telling me I can't pass the function name to glut, apparently because it's in the xwin class.
I've tried variations, including creating a pointer to the xwin::display() function, but nothing seems to work.

Does anyone have a simple example of how to have all the graphics functions outside of main.cpp?  Or have I completely missed the boat?  I would appreciate anything pointing me in the right direction.

I appollogise if this is the wrong list for this question.
Thanks in advance,
Marty


Yahoo! Travel
Find great deals to the top 10 hottest destinations!