Jump to content
  • Advertisement
Sign in to follow this  
Stasyan

Direct3D ViewPort problems

This topic is 4859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a following problem: I create a window say 800 by 600, then I create 2 viewports 400 by 600 and 400 by 600, and the viewports are not split the screen in two equal parts. Turns out that the viewports, even though have the dimensions of the half of the screen are bigger than the half of the screen. I added 10 pixels to x and y parameters of the viewport and could see the line on the left and top edges of the screen. But I had to substract 60 and 30 from Height and Width parameters of the viewport to see the line on the bottom and right sides of the screen. Does anyone have any idea what could be going ? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You have to account for the window "decorations" in the window size. An 800x600 window is 800x600 including the title bar, menu bar, and borders. You can use AdjustWindowRectEx() to adjust the window size so that the client area is 800x600.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!