Fastest way to copy 16/256 colour BMP to desktop HDC

Started by
1 comment, last by Tybalt 21 years, 2 months ago
I have a bitmap in either 16 or 256 colours (e.g. retro emulator or whatever). I want this displayed on screen (i.e. a desktop of 16bpp or more) and scaled. Currently, I BitBlt to an HDC compatible with the display to convert it to the correct bit depth, then StretchBlt it to the paint DC to scale it up. Now, originally this worked fine and very fast, but then I updated my graphics card drivers (GeForce2MX) and it now runs quite slowly at large scales. It also runs slowly on other computers. So, what should I be doing to get this bitmap on screen quickly?
Advertisement
Is there no way?
How about using some other method?
StretchBlt can be slow as hell, _especially_ on modern hardware. It just doesn''t like it. Plus, StretchBlt uses nothing but floating point math. So, it ain''t good.

Try using an hardware accelerated API (DirectX, OpenGL) or wrapper thereof (GLUT, SDL) to handle the to-screen blit and stretching. You''ll have to (and you should) write the bitdepth converter yourself, but that won''t be too hard.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.

This topic is closed to new replies.

Advertisement