[SDL] SDL_OPENGLBLIT and alpha
Matt Johnson
mjohnson at shortgrass.net
Mon Mar 5 11:47:17 PST 2001
Ok, Im not sufficiently satisfied with this solution. Now I dont care about
the extra work required, I just want to do it the right way.
It would seem the appropiate way of blitting a large 2d "skin" over a 3d
game is to simply render the 2d bitmap to a surface, and to splice up that
surface into the largest 2^N texture size possible (i.e. 16x16 or 128x128)
for each portion and texture map each of those portions into a quad.. Now,
I'd assume (hope) there is no distortion when having a bunch of images
spliced up and adjacent (square) quads. Assuming each quad hasnt been
resized, rotated, or scaled and at the exact same thing as the original
bitmap, is this a reasonable assumption to make that there will indeed no
distortion? (kind of like designing a webpage by breaking a large image into
a lot of smaller ones).
The reason of splicing it up,of course, is texture size limit.. Apparently
you cant have textures larger than 128x128 with a Voodoo3, or certain ratios
like 1:8 (16x128)? What are the implications of having lots of little
textures that arent even updated that often? Are there any example programs
that utilize some sort of HUD or something? I cant find any on Nehe,
Gamedev or Flipcode. I also heard something about overlays but I'm at a loss
when it comes to exactly what those are.
Thanks
Matt
> >Curious, why would I do this? If I'm trying to blit an image onto the
> >SDL_OPENGLBLIT screen surface, why would blitting a rectangle help? I'd
need
> >to blit the image itself at that opacity. I mean, I can see how this
might
> >work for a HUD, where I am supposed to blit a solid color at some
> >transparency. But.. if I wanted the whole image be translucent..
>
> oops, won't work unless you blit with SDL_SRCALPHA, sorry. No you probably
> have to do it manually or load the image from a file with an appropriately
> set alpha channel
More information about the SDL
mailing list