Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fast BitBlits. Which library to use?

Started by computerphysicslab Jan 14, 2010 at 9:37 AM 3 replies 800+ views
Original Post
computerphysicslab
computerphysicslab
Hi all, the 2D game I am currently developing uses a lot of raster bitmaps, some of the very big. It is based on a scrolling window that shows a landmark in the background. The background must scroll too. So I need a fast way to refresh the background in every frame. Is it advisable to use some kind of BitBlit function to draw the background every frame? Is there any way faster to do this kind of panning of the screen? I have been googling searching for graphic libraries that let me do that fast. The game is meant to run under Windows. I have heard that DirectX could accelerate the BitBlit function by hardware, and even will let me rotate easily the other raster graphics of the game. Is that correct? Are there any better alternatives? Thanks in advance.
Fiddler
Fiddler
Modern GPUs don't even contain 2d blitters anymore. 2d acceleration is provided through the 3d engine, so yes, using Direct3D or OpenGL would allow you to pan large backgrounds quickly (in the order of thousands of fps).
[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]
signal_
signal_
You didn't say which language you are using, but if you're using something like C++ I'd recommend: SFML. It comes with hardware acceleration right out of the box.

SFML lists its graphics features as:
Quote:
* Interfaces very easily with OpenGL (see OpenGL samples)
* Modern effects available and hardware-accelerated : alpha-blending, rotations, shaders, ...
* Manages memory efficiently, so that you don't have to worry about resources lifetime or storage ; you can even load your graphical resources before any window is created
* Can load and save standard image formats : bmp, dds, jpg, png, tga, psd
* Can load all graphics resources directly from files in memory
* Can use views like in a 3D scene, to zoom / translate / rotate the whole world
* Uses a simplified shader language for adding real-time post-effects
* Easy manipulation of graphical text through bitmap fonts
* Supports unicode characters
* Can load standard font file formats : ttf, cff, pcf, fnt, bdf, pfr, sfnt, type 1, type 42


It is also available in many other languages too. If you're using C# I prolly would recommend XNA.

These recommendations allow for economical blitting, but do not over complicate things for developing a 2D game.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.