Jump to content
  • Advertisement
Sign in to follow this  
RantCasey

OpenGL glutTimerFunc parameter issue

This topic is 3507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to build source code for a solar system. And I am getting a very strange error with glutTimerFunc. it doesnt like the 2nd parameter, thinks it has to convert it to an int of some sort. Im not very sure since I am very new to openGL. I know the paramters passed to gluttimerfunc is (time in millisecs, callback function, and an integer value passed to the call back function. the thing is i have no paramaters in my call back function so its very strange. Im just messing with people's demos and trying to change things around so I can learn openGL. here is the error: 1>c:\users\darren\documents\visual studio 2008\projects\sunday\sunday\main.cpp(118) : error C2664: 'glutTimerFunc' : cannot convert parameter 2 from 'void (__cdecl *)(void)' to 'void (__cdecl *)(int)' 1> None of the functions with this name in scope match the target type 1>c:\users\darren\documents\visual studio 2008\projects\sunday\sunday\main.cpp(134) : error C2664: 'glutTimerFunc' : cannot convert parameter 2 from 'void (__cdecl *)(void)' to 'void (__cdecl *)(int)' 1> None of the functions with this name in scope match the target type and my function animate() int animation(int x) { static float rotateY = 0.0f; Angle += 15.0; glutPostRedisplay(); MoveX +=1; MoveY +=1; glutPostRedisplay(); glRotatef(rotateY, 0.0f, 1.0f, 0.0f); // Rotate the curve around the Y-Axis rotateY += .5f; // Increase the current rotation glutTimerFunc(100, animation, 0); }

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!