You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a window using the Win32 API, it assumes you're giving the width / height including border sizes. This means when you create a window, it ends up being off by a few pixels or so.
The above is a screenshot of the static_triangle sample. The size here is: 624x441 not the expected 640x480.
Found the solution via this stack overflow answer:
You are right, the borders are not taken into account by the 640x480 given to CreateWindow. In this case though, that was actually my intent. I have tried this library on virtual Windows XP machines with 640x480 resolution. In this setup the window should not be larger than the screen, I actually really mean a 640x480 window, not client here. For this basic example the thing to show is how to get a triangle up on the screen. It is not intended to show inane Windows API quirks. They annoy me, I know about them, but this is not the place for them I think.
But thanks for the suggestion. I guess a way to solve this is to have multiple tutorials/examples, going from small-scale to large. We could have a nice tutorial with all these real-world problems that someone will face trying to create a real desktop 3D application, concentrating on one topic at a time. Unfortunately this is very time consuming and the thing I do not have right now is time...
The problem
When you create a window using the Win32 API, it assumes you're giving the width / height including border sizes. This means when you create a window, it ends up being off by a few pixels or so.
The above is a screenshot of the static_triangle sample. The size here is: 624x441 not the expected 640x480.
Found the solution via this stack overflow answer:
The solution
Examples should be updated to make this API call so that the client window size is correct.
If we do that, then the window will be correct.
Size of this image is 640x480
The text was updated successfully, but these errors were encountered: