How can i use mouse middle up-down button

I know GLUT_MIDDLE_BUTTON.

But i want to use up and down controls in mouse’s middle button

Do you mean the mouse wheel? There is glutMouseWheelFunc(), but the linked man page lists some caveats.
Mouse wheel motion should be reported as clicks of different buttons by glut. Have you tried simply printing the value of “button” that is passed to your glutMouseFunc() callback when you move the wheel?

Yes mouse wheel.I use dev-c++.And i take this linker error:


[Linker error] undefined reference to `glutMouseWheelFunc' 

Is this a std method for opengl?I looked glutMouseWheelFunc in internet.Needs openglut.h library.I tried with glut.h library.Which must i use lib for glutMouseWheelFunc in dev-c++?

You do have glutMouseWheelFunc with freeglut. The original glut did not support a mouse wheel, so be sure to link against freeglut and not venerable glut.

Is this a std method for opengl?

No, it is not part of OpenGL, it is part of glut, which is a library that makes writing simple, portable OpenGL programs relatively easy - probably it’s primary use is for learning OpenGL and/or writing tutorials though.
Anyway, there are a number of implementations of “glut”, openglut and freeglut are popular choices.
Some of these implementations add extra functionality, it’s quite possible that glutMouseWheelFunc() is such extra functionality that is not supported by the glut you have.

You have basically two options:

  • see if you can get things to work with glutMouseFunc() alone - have you tried what I suggested earlier?
  • download, build and install a different glut implementation

I can also recommend using http://www.glfw.org/ instead of glut. I think it is a more modern library than the glut family, and more flexible.