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 6647997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:36:14+00:00 2026-05-26T00:36:14+00:00

Good Afternoon, So I’m working with C++ (Visual Studios C++ 2010 to be exact)

  • 0

Good Afternoon,

So I’m working with C++ (Visual Studios C++ 2010 to be exact) and am working on a seemingly easy task;

Draw a picture onto the middle of the window. If you readjust the window size, the picture/bitmap will be redrawn into the middle of the newly sized window.

I figure to get the middle of the window, I should find its rightmost and bottommost bits, then divide each by 2, but I don’t know how to get the window length and height.

I currently have

centrewidth = glutGetWindow().Size.Width;
centreheight = glutGetWindow().Size.Height;

Yet for both I’m getting errors on glutGetWindow, saying “Error: Expression must have class type”. I’m certain once I get this, it will be no problem, but this is causing a lot of trouble for me. Any advice is greatly appreciated. Thanks!

  • 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. Editorial Team
    Editorial Team
    2026-05-26T00:36:15+00:00Added an answer on May 26, 2026 at 12:36 am

    glutGetWindow doesn’t return object of any class type. It’s signature is this:

    int glutGetWindow(void);
    

    And you need is this (see doc):

    int glutGet(GLenum eWhat);
    

    Example,

    int width = glutGet(GLUT_WINDOW_WIDTH); //Width in pixels of the current window.
    int height = glutGet(GLUT_WINDOW_HEIGHT); //Height in pixels of the current window.
    

    Have a look at the doc to know what states you can get using this function.

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

Sidebar

Related Questions

Good afternoon In Visual Studio 2010 I am able to add to my solution
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good afternoon, I'm working on a project for my company to run an update
Good afternoon, I'm having a problem with a section of code I'm working on
Good afternoon in my timezone. I am working with JavaMail api with exJello Provider.
Good afternoon, I have a web query in Excel 2002 going against a web
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt
Good afternoon, I am currently in the very early phase of a new project
Good afternoon, I have a quick 'top level' question regarding the usage of Facebook
Good Afternoon, A customer has provided me with a spreadsheet file his team uses

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.