DirectDraw Overview

paras_it
paras_it used Ask the Experts™
on
Hi !

Can Anybody tell me about using DirectDraw from groundup ?

Plz mail me at paras_it@yahoo.com
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I recommend using SDL instead; it is a portable wrapper around native graphics libraries, which means that it internally uses DirectX on Windows, but doesn't bug you with the horrible API that DirectX exposes. It's much easier to use, and still performs at about the same level. There's also many nice examples and tutorials. http://www.libsdl.org

But since both use the same concepts, I can give you a brief overview.

The most important concept to understand is that of a surface. Surface is a term which more or less means an image kept in memory. There is a primary surface, which represents what the user sees on the screen, and the programmer will likely also create many other surfaces to hold things like sprites and so on.

Surfaces come as either software or hardware surfaces, where the latter are accelerated by the graphic card but are only available in full-screen mode. They also support double-buffering, which means that you update the screen on a hidden copy of the primary surface (called the "back buffer") and copy that to the screen in one fell swoop to minimize flicker.

Surfaces have the capability for fast "blits", which is a term used to describe the copying of one surface onto the other. So, for instance, if you have a surface that contains the player sprite, you would at every frame "blit" this surface onto the back buffer in the correct position; then you do the same with every "enemy" sprite, and when you are done, you copy the back buffer to the screen -- and you have animation!

I hope this gave you some basic insight,
Clemens

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial