window size vs d3d resolution?

Started by
2 comments, last by cozzie 10 years, 3 months ago

Just wondering.

I've noticed that when I create a window with for example 1280x768 pixels and the graphics card doesn't support this mode, and say I create my d3d (9) device with resolution 1024x768. Guess what; the window is still 1280x720 pixels and is completely filled with rendered pixels.

How does direct3d handle this?

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement

If the swap chain size doesn't match the window's client area size then the windowing system will try to scale the backbuffer image to fit the window. Depending on the OS version and the user's settings this may be a very poor quality scale (nearest neighbor) so it's generally not a good idea. The device only cares about display resolution in fullscreen mode, so there's generally not any restriction on what backbuffer size you can use for windowed mode.

Thanks, then I'll have to rethink my initialization code. Now I first create the window and then check if the requested resolution for my d3d app (engine demo) is supported by the graphics card. Another option might be to resize the window after the resoution is confirmed, first try though messed up the resulting image, I'll get into this. Thanks

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Problem solved. I had troubles when retrieving screenwidth/height for defining HUD item positions.

I know save the window width/height when in windowed mode, and return those in my GetScreenWidth/Height functions when windowed = true

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement