How to do simple graphics in c++

Hi all,

I just started programming (for fun) and my ultimate goal is to be able to program simple games (tetris).

I was wondering how it would be possible to integrate graphics in my program. Ideally, I would be able to import some pictures and make the pictures move on the screen.

Is there a simple library I can use to do that?
http://www.libsdl.org

Very simple, very easy to get started. But also has ties to OpenGL, so you can use it when you move onto more advanced stuff as well.
On Windows, just use GDI or GDI+
Both are very different, though.

GDI and GDI+ are for the Windows application interface -- so you are dealing with windows elements and bitmaps. This is fine for writing simple games like cards, minesweeper, and even tetris.

SDL is for manipulating sprites -- and I think a little better suited for game programming. Don't forget the Lazy Foo' Productions tutorials:
http://lazyfoo.net/SDL_tutorials/

Hope this helps.
Also SDL is crossplatform.

No reason to restrain yourself to only 1 OS if you don't have to. Cure the "only code for Windows" disease by never getting sick in the first place.
Topic archived. No new replies allowed.