thx for help forth, but it have not help
after define function trapezy i got error:
error C2664: ‘add_button’ : cannot convert parameter 3 from ‘void (void)’ to ‘void (__cdecl *)(int)’
but I’ve red in some doc. that in add_button shub be parameter GLUI_Update_CB and now it works. all corect function:
glui->add_button("TEST",0,(GLUI_Update_CB)trapezy);
[\CODE]
I'm beginner i VC and OpenGL and I have no idea what for is that parameter.
bye and thanks a lot
If that is true than GLUI_Update_CB is a typedef for “void (__cdecl *)(int)” - this is the type of functions whitch your buttons can use as a callback functions. So your trapezy function should be declared as
void __cdecl trapezy (int some_var);
Where some_var is… Well, read the documentation you have to find out what the parameter of the callback means. Usually it is the id number of event (button’s press, release, focus, blur, or whatever) or something like that, but once again - read the documents.
It seems for me that you are writing the application based only on the examples. It is a good way to start fast, but the documentation is your best friend - you gonna have to learn it by heart to avoid that kind of problems.