🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.shareware.programmer
Article #86

Re: 16-bit images : windows game programming for dummies

#86
From: Filip Joelsson
Date: Thu, 05 Aug 1999 00:00
33 lines
2343 bytes
Followups trimmed  a little.

This is what bigbinc said,
so don't come and sue ME for it!
}Oh yeah that's a great book.

Though it fails to mention some basic things.

<SNIP>
}NON-palletized (no palette)
}and second thing is that each pixel is a representation of a RGB value which
}means that for each display mode there are so many bits needed to hold a red
}value a green value and a blue value.  Direct X uses the term masking. 
}Red/green/blue mask.  So, a 16 bit image or display will have 5 bits for each
}color and the 16th bit set to zero.

On some cards only! I had a similar problem, because my Matrox card uses
another set of masks than the example in WGPFD did.

AFAIK There are two relatively easy ways to make sure the program works
in 16-bits mode with all graphics cards:

1. Ask DirectX what mode this card uses, and convert the bitmap by hand
to that format (once you've developed your tool for this you'll find it
useful - there was an article on Gamasutra, in May I think, about
converting bitmaps).

2. Use a windows-API command to load the bitmap, get a DC for the loaded
bitmap, and another for the DDraw surface that is to hold it - then use
the GDI blt to transfer the image, GDI will do the conversion.
Filip Joelsson

Depie outgoing mail...
Technical Details
Message-ID: <37a967cc.3533736@news1.tninet.se>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7o9sle$41$1@taliesin.netcom.net.uk> <7oa59o$t6s$1@nnrp1.deja.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10e433,7271cc3f603df36
X-Google-Attributes: gid10e433,public
X-Google-Thread: 11431d,7271cc3f603df36
X-Google-Attributes: gid11431d,public
X-Google-Thread: fdc2a,7271cc3f603df36
X-Google-Attributes: gidfdc2a,public
X-Google-Thread: 101278,7271cc3f603df36
X-Google-Attributes: gid101278,public
From: filip@applepie.blueturtle.a.se (Filip Joelsson)
Subject: Re: 16-bit images : windows game programming for dummies
Date: 1999/08/05
Message-ID: <37a967cc.3533736@news1.tninet.se>
X-Deja-AN: 509135415
References: <7o9sle$41$1@taliesin.netcom.net.uk> <7oa59o$t6s$1@nnrp1.deja.com>
X-Complaints-To: abuse@algo.net
X-Trace: cubacola.tninet.se 933850571 28528 195.163.243.184 (5 Aug 1999 10:56:11 GMT)
Organization: Telenordia
Reply-To: filip@applepie.blueturtle.a.se (Filip Joelsson)
NNTP-Posting-Date: 5 Aug 1999 10:56:11 GMT
Newsgroups: alt.comp.shareware.programmer,borland.public.cppbuilder.graphics,comp.graphics.algorithms,comp.os.ms-windows.programmer.graphics