Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 33161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:52:37+00:00 2026-05-10T13:52:37+00:00

I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom

  • 0

I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom in and out of a scene? How do I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:52:37+00:00Added an answer on May 10, 2026 at 1:52 pm

    Note that venerable Nate Robin’s GLUT library doesn’t support the scrollwheel. But, later implementations of GLUT like FreeGLUT do.

    Using the scroll wheel in FreeGLUT is dead simple. Here is how:

    Declare a callback function that shall be called whenever the scroll wheel is scrolled. This is the prototype:

    void mouseWheel(int, int, int, int); 

    Register the callback with the (Free)GLUT function glutMouseWheelFunc().

    glutMouseWheelFunc(mouseWheel); 

    Define the callback function. The second parameter gives the direction of the scroll. Values of +1 is forward, -1 is backward.

    void mouseWheel(int button, int dir, int x, int y) {     if (dir > 0)     {         // Zoom in     }     else     {         // Zoom out     }      return; } 

    That’s it!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I want to use the mouse to scroll the window when it gets
I have table with few rows, after use hover mouse over row I want
I want to use a button which when the mouse enters the button a
I know that I can use a Mouse callback function for when a user
i have one image and i want that when i will home mouse on
I have a usercontrol that I want to use as a ListBoxItem. <ListBox.ItemTemplate> <DataTemplate>
I'm working on a project that requires an interactive map. I want to use
I would like to get current mouse position but I don't want to use:
I would like to get current mouse position but I don't want to use:
I want to use Mono to allow my C# program (currently WPF but will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.