Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Polymorph2000

glut and classes

This topic is 5550 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'm currently using glut to create a simple OpenGL based program that uses a particle engine that I made. The problem is that I, like many other programmers, hate global variables. I am trying to create a class that encorporates my drawing, idle, and keyboard handling functions into one class. The problem happen when I try to assign a drawing function to glut. Below is roughly what the header looks like: //gldraw.h class GLDraw { public: GLDraw(int argc = 0, char** argv = nil); void InitTextures(); ~GLDraw(); GLvoid DrawGLScene(GLvoid); private: GLData settings; void SetupGL(); }; //gldraw.cpp //section of constructor typedef void (*pfunc)(); pfunc draw = DrawGLScene; glutDisplayFunc(draw); Error returned by compiler: Error : illegal implicit conversion from 'void (*)()' to 'void (*)()' gldrawfunctions.cpp line 48 pfunc draw = DrawGLScene; I am currently using Metrowerks 8.3, and I have no idea how to fix this problem. Any ideas on how to fix this would be greatly appreciated. [edited by - Polymorph2000 on May 6, 2003 1:40:52 AM]

Share this post


Link to post
Share on other sites
Advertisement
http://www.parashift.com/c++-faq-lite/pointers-to-members.html


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites

  • 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!