Original Post
Hey - I hope this is the correct forum to post this on. GLUI is connected to OpenGl, so it seemed okay, but otherwise let me know. I'm developing a small game, and I've recently started adding a menu and HUD, but I keep running into a structuring problem. Let’s see if I can fraise this... The problem comes from the GLUI functions: glui = GLUI_Master.create_glui( "Menu", 0, 400, 50 ); GLUI_Rotation *rota = glui->add_rotation("Spin this", angles, 5, function); Where the "function" (last argument) has to be a pointer to a function. Now this works fine with all kinds of functions, as long as they are defined in a global scope, but I would like to structure my program, so the UI is a class. Changing the function to a member function: UI::function() gives compiler errors, so I guess what I'm looking for is some way to "wrap" the function into a pointer and then pass that. Have been looking at different materials, like: http://www.newty.de/fpt/callback.html But my problem is that I cant just change the function to accept a member function, since it is part of the GLUI library. And I refuse to believe that my UI has to be written in global scope =/ Anyone out there who have solved this problem? I think it is quite simple, I just haven’t found a solution for it. Thanks /kish