Jump to content
  • Advertisement
Sign in to follow this  
johndirect

D3DFORMAT

This topic is 3789 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

When I create a device, there is a parameter to specify the back buffer format in the D3DPRESENT_PARAMETERS. Similarly, when I create a texture, there is an option of specifying the format. Question 1: Do these 2 formats need to match? Question 2: For the FOURCC formats, in the documentation, I see that I can specify only either ('M','E','T','I') ('G','R','G','B'), ('R','G','B','G') ('U','Y','V','Y'). How can I specify other formats such as I420, YV12, YVU9 etc. Thanks

Share this post


Link to post
Share on other sites
Advertisement
1: They don't. Texture sampler converts texture format to floating point and later in pipeline it's converted to the format of whatever surface you are rendering to. If you aren't using shaders, exactly the same things happen automatically.

2: Use FOURCC macro, exactly like in examples you've mentioned.

Share this post


Link to post
Share on other sites
While the formats often don't have to match, there are certain cards which may be more strict than others. Technically you're supposed to use "CheckDeviceFormat" to ensure the format is available for the use you want, when using a certain backbuffer type. It's possible the card won't allow a YUV texture with an RGB backbuffer. Some cards only support YUV for DirectDraw overlays.

As I've never tried using any obscure formats I can't really comment on how widespread support for them is.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!