Archived

This topic is now archived and is closed to further replies.

16-bit graphics in DirectX 8.1?

This topic is 5001 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 working in DirectX 8.1, I usually set up my truecolor graphics data by declaring a structure like this: typedef struct _TRUECOLTAG{ unsigned char blue; unsigned char green; unsigned char red; unsigned char alpha; } TRUE_COL_TYPE; I then use this stucture to define the various texture resources with D3DFMT_A8R8G8B8 format. But if someone using my application is using a 16-bit video chipset, this seems to cause the application to choke and crash. How do I detect whether the video chipset on a system is limited to 16-bit? For 16-bit systems, can I use the same data structure? Which D3DFMT do I use to create the textures?

Share this post


Link to post
Share on other sites
You''ll need to check the device caps of the resolution you want with the pixel format.

If you run the Sample Browser (in the Start Menu under your SDK installation) you''ll see all the various Display Modes of your cards. You''ll have to get your program to check to make sure you can run in the format.

For 16 bit, you want to specify
A1R5G5B5 or R5G6B5

Enjoy.

Share this post


Link to post
Share on other sites
You cannot use 32-bit pixels directly if the surface is in 16-bit format.
However, the conversion step is pretty simple, involving mainly a few bit shifts. Search for this in Google for more info

-Nik

Share this post


Link to post
Share on other sites
Quoting from MSDN,

All formats are listed from left to right, most significant bit (MSB) to least significant bit (LSB). For example, D3DFORMAT_ARGB is ordered from the MSB channel A (alpha), to the LSB channel B (blue). When traversing surface data, the data is stored in memory from LSB to MSB, which means that the channel order in memory is from LSB (blue) to MSB (alpha).

-Nik

EDIT: Source of the quote. Contains generally useful info for playing with the pixel formats

[edited by - Nik02 on April 5, 2004 6:16:10 AM]

Share this post


Link to post
Share on other sites