Skip to main content
GameDev.net gamedev.net
🔒 Locked

24 bit graphics question

Started by Buster Nov 3, 2000 at 4:22 PM 0 replies 500+ views
Original Post
Buster
Buster
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!
bogdanontanu
bogdanontanu
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....

Bogdan
obysoft

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.