Graphics How?

I know about the Windows GDI, OpenGL, and DirectX. I need to know which is easy to learn. Please if you could explain how they work and their differences. Thanks! I want to make a game
OpenGL is easier to learn than DirectX. If it's game development you're looking at you can scratch GDI. I recommend OpenGL. As far as an explanation on how they work, there are books devoted to this stuff. A simple paragraph won't suffice. Also, google OpenGL Vs DirectX for the great debate. In addition, take a look at Ogre3d. They have an excellent C++ Graphics Rendering API. You can also take a look at 2d APIs such as SDL and Allegro.

Hope this helps.
Windows GDI and GDI+ is only for simple graphics on the windows. You can't do much with that.
The 'real' graphics are achieved using OpenGL and DirectX. The result is really similar but I'd suggest you using OpenGL as it easier to use. With OpenGL you just call a function and you have the job done.
DirectX comes with Direct3D, DirectInput, DirectSound etc.
OpenGL is just a graphic library ( you can get user input with it ), for sounds you need OpenAL
Its a two dimensional game I want to make and I don't want to use librarys like allegro I want to learn how to do it myself thanks though and what is gdi +? Thanks!
GDI+ is like GDI but with a C++ interface ( with classes etc. )
For a game you shouldn't use GDI. If you need something easy try SDL. OpenGL and DirectX are both for 3D and 2D graphics
What do you mean you don't want to use libraries? You have no choice! For a 2d game you either use SDL or Allegro, preferrably SDL. C++ has no method of rendering graphics on its own. And just a note, Game Development companies use APIs, not to say they don't write some things from scratch. GDI is deprecated. GDI+ is its successor which is C++ based. GDI/+ does not have support for animations I believe... can't remember what the differences are.


... too slow at posting.
Last edited on
Wait what did they use to make the APIs They used c++ to make directX I think. There must be a way to use c++ to communicate with your graphics card and draw stuff onto the screen. And when I said that before I just meant I dont want to use allegro because I thought that it simplified stuff like the windows gdi and I wanted to learn it my self. sorry if I was unclear
Well, yeah, sure. You can directly interface with the hardware through the OS, but that has many disadvantages:
1. It's hardware-dependent.
2. It's OS-dependent.
3. It's reinventing the wheel, the engine, and half the chassis.

I'm looking for the codebase size of OpenGL, but I can't find it. I doubt it's smaller than half a million lines of code, though.
If you want to write a program that only runs on one individual's computer, you can use just C++ and avoid all libraries.

The point of a library is not to simplify stuff, but to abstract stuff.

For example, I'm using an old NVIDIA TNT2 card on a SyncMaster 753DF monitor with XP and Kubuntu. My wife is in the other room using a GeForce 6150SE on some generic Sony PnP flatscreen monitor with Vista.

I can use the SDL library to write an application that will work perfectly and identically on both systems. That is because the SDL DLLs handle the hardware and software differences between the two. If I were to just use C++, I'd have to go back 20 years to the days when games were distributed with a zillion graphics drivers -- each one written me in assembly. No thanks.


Further, you are being confusing.

In your first post, you stated that you knew about (or at least the existence of) three specific libraries: GDI, OpenGL, and DirectX; and you asked which you should use to most easily make a game.

In the second, you expressed confusion about GDI+ when a very elementary extrapolation, or for the -- forgive me -- less thoughtful, a simple google search, would have told you that GDI+ is GDI for C++.

In the last you complain that you don't want to use a library. This is at direct odds with your first post where you specifically stated "I need to know which [of the listed libraries] is easy to learn" and "I want to make a game".


Don't do it the hard way. Use a library.

For 2D stuff, I also heartily recommend SDL.
http://www.libsdl.org/ (documentation)
http://lazyfoo.net/SDL_tutorials/ (getting started)

For 3D stuff, I recommend OpenGL.
http://www.opengl.org/
http://www.mathies.com/glfaq/GLToolkitFAQ.html (OpenGL Toolkit FAQ)
http://sjbaker.org/steve/omniv/opengl_lighting.html (Basic OpenGL Lighting)
http://nehe.gamedev.net/ (NeHe Productions: start here)

Hope this helps.
I would look into programming games for DOS. Windows (and any other advanced operating system), does not allow direct access to hardware.
While SDL is good with 2D and OpenGL is good with 3D, it's hard for them to do each others jobs. SDL doesn't even have any 3D functions (I don't think), and OpenGL is hard to use for 2D, but it is possible. You can combine OpenGL and the SDL, but drawing 2D using SDL's image methods with OpenGL is INSANELY hard. There's a huge documentary on it on http://www.lazyfoo.net .
Topic archived. No new replies allowed.