Jump to content
  • Advertisement


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


24 bit graphics question

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

Here''s a stupid question, so pardon me if I should know! Writing out 16 bit data (WORD) and 32 bit data (DWORD) to a surface is easy. But what do I use for 24 bit data? Do I need to use a DWORD, but bust it up into 3 bytes? Here''s what I do for 16 bits: *(WORD*) bDes = (WORD)color; Here''s what I do for 32 bits: *(DWORD*) bDes = (DWORD)color; For 24 bits: ???? Thanks for any tips you guys can provide... and again sorry if I''m just being retarded!

Share this post

Link to post
Share on other sites
Yeah its kinda tricky... maybe thats why some boards just skip 24bits and jump directly to 32bits

if are doing a Blit like ops try write a full DWORD row and then add an extra byte if req at the end.

If u do per pixel operations ... eh then read a dword mask its 4th byte do what ever u want on the rest of 3 bytes and the write a full DWORD back...cache can help u here but i think this i slow....


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!