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

DirectDraw (24/32 bit) tutorial?

Started by Fyyar Mar 12, 2003 at 4:20 AM 7 replies 500+ views
Original Post
Fyyar
Fyyar
I''m looking for a DirectDraw tutorial which covers 24- and/or 32-bit graphics. 8-bit is easy to find, but thats not what I need or want. Links anyone? Pleeeeassseee! Regards / Fyyar
Kippesoep
Kippesoep
First, ask yourself: what''s the difference between 8bit and 24/32bit?
Then, think of the answer: very little.
To elaborate: there''s no palette anymore (so, get rid of everything related to palettes). Since you won''t be drawing colours as palette indices anymore, you''re going to specify the full red/green/blue components (each ranging from 0..255).

Then, the only thing that changes is how to plot a pixel, for which there''s an article right here on gamedev, at http://www.gamedev.net/reference/articles/article588.asp.

Note that, although all cards support 8bit mode, many cards don''t support 24bpp mode (and the ones that do tend not to support 32bpp mode), so you''re gonna have to check that the mode you''re setting is actually available.

Kippesoep
Fyyar
Fyyar
I guess you''re right, the difference isn''t big. But 8bit means only 256 colors. That isn''t enough for me. Anyways, thanks for the input
granat
granat
You could by a book if you can afford it.

"Teach yourself DirectX7 in 24 hours" for example.
-------------Ban KalvinB !
Kippesoep
Kippesoep
quote:
Original post by Fyyar
I guess you''re right, the difference isn''t big. But 8bit means only 256 colors.


My point isn''t that the visual impact isn''t worth it, it''s that there''s almost zero difference when programming. Especially if you only use blits anyway...

Kippesoep
Fyyar
Fyyar
Oh, sorry! :D Well actually, the blits were the things I was wondering about how to do. No difference you say? Excellent.. What about clearing surfaces? I assume there''s a better way than plotting thousands of black pixels all over the surface.
granat
granat
There is.
-------------Ban KalvinB !
Illumini
Illumini
To clear a surface simply set the properties a DDBLTFX structure with the correct info to perform a fill. I know its in one of the more comprehensive tuts here at gamedev. Then perform a blt on the surface passing null as the source and dest rect and pass the bltfx struct as the last arguement which you''d usually set to null for normal blting.
Cybertron
Cybertron
8 BIT IS HORRIBLE NEVER USE IT ITS THE 21st CENTURY ALREADY

The only difference is how large each pixel is. 32 bits is preferable because the CPU is 32 bits. Instead of writing single bytes for a color you write DWORDs where the color components are encoded.

Basically all you need to know is how RGB colors are encoded (and how DD uses it), which is stupidly simple

There are a few articles on gamedev, im sure you can get it working

Topic Locked

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

Sign in to reply to this topic.