0
  1. My game is in window mode which allows users to resize the game window almost freely, which means the the ratio of the width/height, and the size of the window can be arbitrary (though the window has largest and smallest restrictions)

  2. To make the render result be displayed nicely, a same size d3d device would be preferred to create (thus the back-buffer pixel can be matched with the screen pixel and we could get a ratio right and clear image)

  3. Though I can get the Caps and the supported enumerated resolution list, I am not sure if a windowed resolution can be accepted by d3d system. (e.g. we have 1024x768 /800x600 in the Caps, but we need to create 1000x700 back-buffer)

My question is, how can I make sure if a certain resolution can be created and what's the practical way to handle the problem.

Thank you very much!

karlzhang
  • 1
  • 1

1 Answers1

0

In windowed mode you can create any resolution swap chain (subject to some maximum size constraints which will be greater than any supported screen resolution). It's only in full screen mode that you are constrained to creating swap chains of sizes that are on the enumerated resolution list.

mattnewport
  • 13,728
  • 2
  • 35
  • 39
  • " (subject to some maximum size constraints which will be greater than any supported screen resolution)." Do you mean I should keep the width smaller than the largest width, and height smaller than the largest height, even the largest width and height are not in a pair (1024x768, 1000x800, so I get 1024x800?)? It's weird. I'd checked the DXUT and other code pieces and it seems people just believe that the device can be always "reset" and no error will happen. Is this a specification for Direct3D driver/card manufacturer I wonder? – karlzhang Jun 24 '13 at 04:23
  • In windowed mode you should be able to create a swapchain at least as large as the current screen resolution. In full screen mode just create a swapchain with the same resolution as the display resolution you select. If you change screen mode you can resize your swapchain. – mattnewport Jun 26 '13 at 20:49