Fastest way to copy 16/256 colour BMP to desktop HDC
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?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement