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!
glutGetWindowdoesn’t return object of any class type. It’s signature is this:And you need is this (see doc):
Example,
Have a look at the doc to know what states you can get using this function.