M
Manuel
I'm trying to write a class for a simple openGL GUI.
I've written a method reshape:
------------------------
void MHwindow::reshape(int w, int h)
{
glViewport ( 0, 0, w, h );
[...]
glLoadIdentity ( );
}
------------------------
In the client code, this should be passed to GLUT, but
------------------------
MHwindow MainWindow();
[...]
glutReshapeFunc ( MainWindow.reshape );
------------------------
don't work:
main.cpp argument of type `void (MHwindow:(int, int)' does not match
`void (*)(int, int)'
However, if in the client code I write:
------------------------
void reshape(int w, int h)
{
MainWindow.reshape(w,h);
}
[...]
glutReshapeFunc ( reshape );
------------------------
it work.
It's legal?
This things is very important for my project.
Thanks,
Manuel
I've written a method reshape:
------------------------
void MHwindow::reshape(int w, int h)
{
glViewport ( 0, 0, w, h );
[...]
glLoadIdentity ( );
}
------------------------
In the client code, this should be passed to GLUT, but
------------------------
MHwindow MainWindow();
[...]
glutReshapeFunc ( MainWindow.reshape );
------------------------
don't work:
main.cpp argument of type `void (MHwindow:(int, int)' does not match
`void (*)(int, int)'
However, if in the client code I write:
------------------------
void reshape(int w, int h)
{
MainWindow.reshape(w,h);
}
[...]
glutReshapeFunc ( reshape );
------------------------
it work.
It's legal?
This things is very important for my project.
Thanks,
Manuel