Skip to main content
GameDev.net gamedev.net
🔒 Locked

Menu

Started by Zen721 May 1, 2006 at 6:12 AM 3 replies 1.4k views
Original Post
Zen721
Zen721
Anyone knows how to make this: When i Click on Quad with texture it will be do some instructions (in OpenGL with glut) Maybe some tutorials ... Please reply.
rip-off
rip-off
The first result from google "glut mouse handling" : here.

Combine that with simple square collision detection.

Zen721
Zen721
I will try it later because i m going to make some songs in my studio
But thanks
It should help me like I see
Zen721
Zen721
I dont know where is a problem i made a class where i declareted function for
glutMouseFunc
When i call it i have error

error C2664: 'glutMouseFunc' : cannot convert parameter 1 from 'void (int,int,int,int)' to 'void (__cdecl *)(int,int,int,int)'

but when i make it not in class but structural everything is OK


rip-off
rip-off
Let us see your code.

You may have to write your function like so:


extern "C" myMouseFunc( /* params */ )
{
// stuff
}

glutMouseFunc( &myMouseFunc );

Edit:

Quote:

but when i make it not in class but structural everything is OK


Yes, functions in classes are very different to normal functions, the "this" pointer needs to be passed, and how it is passed can vary with compiler.

Topic Locked

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

Sign in to reply to this topic.