OpenGL Context Appearing at Incorrect Location

I’m really not sure if this is a Windows-specific problem, or specific to a version of OpenGL, or even OpenGL at all, but I am fairly sure it is. Anyway, here goes…

So I’ve got a Windows program, written in C (I’m pretty new to that), that makes a window with an OpenGL context. On two of my computers, it works correctly. On the other one, it doesn’t, and the problem is the same on a few friends’ computers.

The OpenGL context covers most of the title bar. It’s apparently being shown at (0,0) relative to the window itself rather than relative to the client area. Moving or resizing the window changes nothing. The code can be found here:

http://dpmm.110mb.com/temp/GenGineSrc.zip

I hope someone comes along and says, “Oh, you left out a 0,” or something along those lines. :stuck_out_tongue:

In your resize function, call glViewport. That might fix the problem.
This is most likely a driver problem. Are you using some integrated intel chipset?
What OS, video card, driver are you using?

Okay, problem solved. 'Twas not an OpenGL problem. My apologies.

Turns out I was using GetWindowDC when I should have been using GetDC. It still doesn’t make sense that it woks differently on different copies of Windows, but at least it’s no longer an issue. Also, the resizing function works correctly. :slight_smile: Thanks for the effort.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.