SDL - Alpha channel issues

Started by
50 comments, last by RuneLancer 20 years ago
I get anywhere from 40 to 50 FPS easily now. I still have some stuff to optimize, but I''ll worry about it later. It runs decently fast anyways. Unecessary premature optimization can kill a project.

I figured something was wrong when I realized I could have my text blinking fast enough to almost look 50% translucent (you know what I mean) if I made it blink every other frame. Then I realized, sheesh, 1/10th of a second sure is fast.
Advertisement
quote:Original post by C-Junkie
Eh, are you sure that works?

I''m willing to bet there are cases where it does not.

Instead,

if (m_pImage->format->Amask)

should be used. (its 0 when there is no alpha channel)

Cool, thanks C-J. I did test it, and it branched properly when I stepped through it loading a PNG file versus a BMP and JPG file, but I was never sure as to the exact value of alpha in the absence of an alpha channel. You do, so I''ll update my code.

Drew Sikora
Executive Producer
GameDev.net

This topic is closed to new replies.

Advertisement