[SDL] Problem with SDL on Win32

Florian 'Proff' Schulze florian.proff.schulze at gmx.net
Sat Apr 22 12:34:19 PDT 2000


Remember 16bpp color is the same (on the surface) as a Uint16, so you
can compare it to a Uin16 value.  However in the book, "Real Time
Stragegy Game Programming using MS DX6" there is a great example of how
to compress 16bpp sprite.  This method has a great feature of
compressing out transparent parts of the image.

				-fjr

Kovacs wrote:
> 
> Yes, this sounds the most reasonable solution. But how can i use per-pixel
> alpha transparency (i'm using 16bpp)? There was one message about it, but
> i could not clearly understand.
> 
>         Kovacs
> 
> On 10 Apr 2000 vining at pacificcoast.net wrote:
> 
> >
> > >   What is the big need for ttf in SDL? I mean if its a game or something
> > >that needs performance bitmaps fonts should be used.
> >
> > Bitmap fonts don't scale worth beans. That said, using TTFs each time aren't the right way to go.
> >
> > Here's the real best way to go, IMO, and an example of how I feel C++ and classes should be used. More on this sort of ranting
> > later, as if you haven't heard enough!
> >
> > Create a CFont object. When it initializes, have it choose a font, and a point size. This font's constructor then renders letters using
> > SDL_ttf (or whatever) for each letter in the font that you'll actually end up using (for easy use, always store your font
> > characters internally in some sort of useful format, like ASCII characters). Store 'em with alpha values, like Bill suggests, the
> > smart fellow that he is. Then, your code for rendering would be called something like:
> >
> > myFont->printf(0,0,"Mord wuz here\n");
> >
> > which just goes through and blasts down the bitmaps. Then, if you need another font, allocate another CFont object. Best of both
> > worlds.
> >
> > Nichol
> >



More information about the SDL mailing list