How to do Widescreen?

Started by
3 comments, last by briandra3 18 years, 8 months ago
Hi, I am wondering how to program DirectX to check for and use a widescreen display mode... I can't find any details on it. I'm using DirectX 9.0 C December 2004 edition. Is it simply a matter of enumerating display modes that are 16:9? Do I have to upgrade to a newer DirectX SDK? Thanks, Brian
Advertisement
Try to set your projection matrix using something like this:

float fAspect = Width / Height;
int screentype = (widescreen) ? 2 : 4;

D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/screentype, fAspect, minZ, maxZ );


I don’t know if this is the suggested way, but it seems to work.

Quad
3DMUVE is an amateur game development team, and the designer and developer of a new gaming technology “MUVE” for the gaming industry.
Yes; just find the display modes that have roughly the ratio you want. Then set the projection matrix to the same X/Y ratio as the actual display mode.

Note that many "widescreen" displays are really about 16:10 rather than 16:9. There's also the "tallscreen" mode of 1280x1024, which is about 5:4 instead of 4:3.
enum Bool { True, False, FileNotFound };
Yes, your monitor will provide it's supported resolutions to Windows, and your display driver will provide that list minus the resolutions your card doesn't support to you. If you can set your desktop resolution to a widescreen resolution you should be able to use the same resolution from D3D.

And adjust your projection parameters as QuadMV suggests.
Wow, quick responses!

Thanks a ton, I'll try it out.

This topic is closed to new replies.

Advertisement