Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have been programming for a year so far and I know 2 languages: C and C++. I've covered the basics, I've written functional windows programs, and I've written complicated bits of code. When I was using Turbo C for learning the C language I noticed a library called "Graphics.h". I've looked it up and I received amazing examples of graphics manipulation. My question is straightforward. How can I get started with learning graphics in C++? Is there a good tutorial that covers it all up?

share|improve this question

closed as off-topic by gnat, GlenH7, MichaelT, BЈовић, Dan Pichelman Jul 28 '13 at 12:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, GlenH7, MichaelT, BЈовић, Dan Pichelman
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
What kind of applications involving do you have in mind? A graphics library primarily designed for 2D looks very different from one designed for 3D. Also, it will be platform specific unless you use a cross-platform library. –  In silico Feb 12 '12 at 15:38
    
I'm talking generally, 2D graphics but I'm willing to learn both. –  Bugster Feb 12 '12 at 15:45
1  
Did you want to learn how to make a graphics library yourself such as drawing and filling shapes on a bitmap plane, or pointers to interesting libraries that are worth learning? –  JBRWilkinson Feb 12 '12 at 17:54

4 Answers 4

up vote 9 down vote accepted

Back in the graphics.h days each compiler had it's own limited graphics library.

Now you program to either DirectX (Microsoft) or OpenGL (everywhere). After a few years of being sidelined to high-end Unix cad OpenGL/OpenGLEs is making a big splash on mobile devices

For a list of books see http://stackoverflow.com/questions/5926357/c-opengl-books

One warning - there are a lot of 20year old out of date opengl tutroials on the web - start here An intro to modern OpenGL.

ps. Some of the maths of 3D graphics (matrix transformations etc) might be beyond what you have covered in school but it's very easy - you just have to sit down and work through it. But do go through all the math until you understand it, you will need it!

share|improve this answer
    
Thanks! That's what I'm looking for. –  Bugster Feb 13 '12 at 6:11
    
opengl-tutorial.org is also very good. –  M. Dudley Jul 31 '13 at 17:35

graphics.h isn't relevant to anything. It's been 10-15 years since that header was useful. The same for the Turbo C compiler.

You need to upgrade your compiler to, let's say, Visual Studio 2010 Express (free) for Windows. Then you can look at things like Direct2D and GDI+ for 2D graphics.

share|improve this answer
    
I don't think you have completely understood my question.. I have been using Turbo C for training in C, I don't use that anymore. Logically, if I made functional programs I used Visual studio 2010 (not the express version, the full one). Graphics.h was just a reference, not the question itself. I'm asking for a starting point for graphics in C++, perhaps some tutorials or articles, or a brief explanation of what I could search. –  Bugster Feb 12 '12 at 16:33
    
@ThePlan: "things like Direct2D and GDI+ for 2D graphics". –  DeadMG Feb 12 '12 at 18:03

Graphics typycally require some knowledge about platform specific interfaces, some general math, and eventually some typical pattern.

You can start from the Widows GDI (and GDI+) and from the X Window system (for Unix/Linux)

and move to 3d with openGL(every platform) or Direct3d(on Windows)

share|improve this answer

A simple graphics library is the Simple Fast Multimedia Library for C++ which is cross platform, modern and very easy.

SFML provides a simple interface to the various components of your PC, to ease the development of games and multimedia applications. It is composed of five modules: system, window, graphics, audio and network.

Discover their features more in detail in the tutorials and the API documentation...

With SFML, your application can compile and run out of the box on the most common operating systems: Windows, Linux, Mac OS X and soon Android & iOS.

Pre-compiled SDKs for your favorite OS are available on the download page...

SFML has official bindings for the C and .Net languages. And thanks to its active community, it is also available in many other languages such as Java, Ruby, Python, Go, and more.

Learn more about them on the bindings page...

Alternatively you could use OpenGl (I would prefer due to platform independence) or DirectX.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.