Archived

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

Andre LaMothe Book and colour depth

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

As a relative newcomer and reader of Andre LaMothe''s book Tricks of the Windows Game Programming Gurus I''ve come across a problem which someone here may be able to help me with. The libraries that are provided with the book cover 8, 16 and 24-bit colour depth. My graphics card does not support the 24-bit mode (so the call to SetDisplayMode() fails) and the graphics applications that I have (Photoshop/Paint Shop Pro) do not support colour depths of 16-bit. This leaves me with just the 8-bit mode which is far from ideal in this day and age. Am I missing something? I''d rather concentrate on learning the ins-and-outs of DirectX and not have to write additional 32-bit functions...

Share this post


Link to post
Share on other sites
Most of todays graphics cards don''t support 24 bpp because this color depth doesn''t have an additional alpha channel presented. So they support 32 bpp that is more suitable for todays 3D applications. So if you haven''t a very old card it must support 32 bpp. BTW, what is your gfx card?

Share this post


Link to post
Share on other sites
quote:
Original post by QWERTY
Most of todays graphics cards don''t support 24 bpp because this color depth doesn''t have an additional alpha channel presented. So they support 32 bpp that is more suitable for todays 3D applications. So if you haven''t a very old card it must support 32 bpp. BTW, what is your gfx card?


Thanks for the quick reply :-)

I am using a Radeon 8500, so yes it does support 32 bpp. It''s just that TotWGPG only seems to cover 8, 16 and 24. I would make a guess that the latest release of the book provides libraries that cover 32 bpp but that doesn''t help me unless the libraries are in the public domain...

Share this post


Link to post
Share on other sites
I think, I THINK the 2nd edition of André''s book with the same title covers, among other formats(due to public demand), 32-bit conversions of his engine.

http://www.amazon.com/exec/obidos/ASIN/0672323699/qid=1037644707/sr=2-1/ref=sr_2_1/104-9384474-1655931

Did you recently buy this book? You should have gotten the 2nd edition, newly released.

Mail André @ ceo@xgames3d.com. He''ll reply in no-time!

/Sandman

Share this post


Link to post
Share on other sites
I''ve had the first edition of the book for some time now. However, I emailed Andre'' and he''s not bothered about people redistributing his libraries (see quote below) so has anyone got the second edition and can email them to me? Would be much appreciated...

"There is a ton of code available way better than mine, so I don''t really care if people share it, the book is why people buy it, not the code, so go ahead and ask around -- if you cant find it let me know and I might be able to upload it to an FTP server of yours...

Andre''"

Share this post


Link to post
Share on other sites
Paint Shop Pro supports all colour depths. Look in the colour menu. I''ve been using it since v4 and it''s my favourite image editor, and the features for colour depths have been there since I started. The likelyhood you have a version < 4 is almost nothing, so its definately there.

- Ashley Oliver
Lead Programmer, Interplanitary Productions

Share this post


Link to post
Share on other sites
I''m using PSP7 and under the Decrease Color Depth entry on the Colors menu there is a choice of 1 bit, 4 bit, 8 bit and 24 bit (32K and 64K colors).
Under Increase Color Depth there are entries for 4 bit, 8 bit and 24 bit.

Share this post


Link to post
Share on other sites
Mmm you''re right it does say that... however...

24-bit is normally associated with the 6.5M colours. The 32K and 64K colour modes I beleive can be saved as 16-bit formats. I know it is possible having done so before for my own game. Try using either 32K or 64K colour depths, and saving as a format which supports 16-bit modes (ie not JPEG - it doesnt), and try loading it in your program as a 16-bit image. Should work


- Ashley Oliver
Lead Programmer, Interplanitary Productions

Share this post


Link to post
Share on other sites
when people speak of a windows graphics card using 32 bit color, it does NOT mean 32 bits of data at all ... it means 24 bit color, store in 32 bits of space, for optimal access and manipulation by a 32 bit process architechture ...

there is no (2d) color depth in windows greater than 24 bits of actual data, nor is there one with alpha ...

now when using directx / opengl ... there are all sorts of formats, such as (RGBA): 8-8-8-0, 8-8-8-8, 10-10-10-2, 5-5-5-0, 5-6-5-0, 5-5-6-0, etc ... and DirectX 9.0 throws in all sorts for floating points depths such as: 16-16-16-16, 32-32-32-32

you should ALWAYS save your images in files as either 24 bit color (for most images), or 8 bit color (for images like fonts, or GUI elements) ...

and DirectX can load that 24 bit image file, into whatever color depth surface you create ...

Share this post


Link to post
Share on other sites
TOTWGPG comes with a bitmap loading function that loads 24 bit bitmaps onto 16 bit surfaces. You can also write your own, or use the LoadImage() function from the windows api, which will automatically convert the color depth (so you can easily load a bitmap of any color depth onto a surface of any depth). So I don''t really know what your problem is.

Share this post


Link to post
Share on other sites
Thanks Xai for pointing out the glaringly obvious (except to me ;o) ) point which I was failing to notice. I had it fixed in my head that if the bitmap was x-bits colour depth then the screen had to be x-bits too. Doh!
I''ll hide my shame by getting back to my demo with a sack on my head!

Share this post


Link to post
Share on other sites