Skip to main content
gamedev.net
🔒 Locked

Problem with glutDisplayFunc

Started by nethackpro Jun 9, 2010 at 4:53 PM 1 replies 2.1k views
Original Post
nethackpro
nethackpro
Wasn't sure if this belongs here or in the OpenGL section so sorry if it's in the wrong board.

The following line is giving me an error
glutDisplayFunc(Render);


That line of code is in the contructor for a class I created call Display. Render is a member function of Display. But when I try to compile it gives me this error
Quote:
error C3867: 'Display::Render': function call missing argument list; use '&Display::Render' to create a pointer to member


When I try changing it to
glutDisplayFunc(&Display::Render);


it gives me the error
Quote:
error C2664: 'glutDisplayFunc' : cannot convert parameter 1 from 'void (__thiscall Display::* )(void)' to 'void (__cdecl *)(void)'


Is there a way to do this without removing my Render function from the Display class like it was before?
nethackpro
nethackpro
Thank you. The solution in case anyone else has this problem is to make the member function static.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.