a game with graphics?

Started by
13 comments, last by deadstar 15 years, 7 months ago
I'm new here and I really need help.... I'm a beginner in C++, but I know basic C++ and im wondering if there is any good online tutorials or something that teaches you how to make a simple game with graphics. It needs to be in C++. I'm sorry if I'm posting in the wrong section or somebody already posted this. I'm new here.
Advertisement
If you want C++ and Graphics and Easy, your learning the wrong language sorry. There are a number of graphics API's that work well with C++; Direct3D, OpenGL, GDI, DarkGDK. None of these are really easy, and are usually even hard on Windows as chances are you will have to learn how to program with the basics of the win32 API. You may be better of with something like python.
http://nehe.gamedev.net/lesson.asp?index=01
I found plenty of good SDL tutorials, and SDL is both very popular leading to a lot of available support and also very portable as it abstracts away pretty much everything.

I definitely reccomend SDL if you're going the C++ route.
oh yah....
I forgot to tell you that I have tried openGl, allegro, and SDL. For some reason I can't install them properly and put them in the right folders and stuff.... except for allegro.

I'm hoping to someday be really good and maybe work for a game developing company. But now i just want to learn the basics. I don't use any language except for C++ because when I make something with python or something, I don't feel satisfied. The only time I feel satisfied is when i use C++.
http://lazyfoo.net/SDL_tutorials/index.php

Like Twincamtinman said, SDL is the way to go for begginers in the Graphics+C++ path. Lazy foo has tutorials, in order of complexity, that can show you how to make a decent game.
He also has the best tutorial out there on how to set up SDL, regardless of your IDE / Compiler. I guarantee that if you folow them step by step you will have SDL up and running, and usually it doesnt take more than 10 minutes.

You also might consider buying the "Focus on SDL" Book, wich is half about SDL, and the other half is a "how to make a game" walktrough, very simple, but yet interesting and complete.

Cheers.
Moved to For Beginners.
Quote:Original post by Googol PL3X
There are a number of graphics API's that work well with C++; Direct3D, OpenGL, GDI, DarkGDK. None of these are really easy,...

I beg to differ. About a year and a half ago I noticed an OpenGL sample program in Dev-C++. I compiled and ran it, it was just a simple program that drew a triangle or something, but in 10 minutes was modifying the code to do simple things like drawing lines and quads. By the end of the week i had figured out how to use textures and soon after i wrote a little program of my own.
Once you initialise OpenGL it's as easy as:
glBegin(GL_LINES);                         // Start drawing lines (or quads, etc)glColor3f(1, 0, 0);  glVertex2i(x1, y1);   // Set colour and draw vertexglColor3f(0, 1, 0);  glVertex2i(x2, y2);glEnd();                                   // End drawing

And you can go from there. Like Hodgman said, NeHe tutorials are pretty good.
[Window Detective] - Windows UI spy utility for programmers
By the way I'm really newbie in game programming, my aim is I can work as game developer in game company. by the way nice to meet you all.
Quote:I beg to differ. About a year and a half ago I noticed an OpenGL sample program in Dev-C++. I compiled and ran it, it was just a simple program that drew a triangle or something, but in 10 minutes was modifying the code to do simple things like drawing lines and quads. By the end of the week i had figured out how to use textures and soon after i wrote a little program of my own.
Once you initialise OpenGL it's as easy as:

glBegin(GL_LINES); // Start drawing lines (or quads, etc)
glColor3f(1, 0, 0); glVertex2i(x1, y1); // Set colour and draw vertex
glColor3f(0, 1, 0); glVertex2i(x2, y2);
glEnd(); // End drawing


And you can go from there. Like Hodgman said, NeHe tutorials are pretty good.


That's the perfect code if you're drawing ONE triangle in your program. If you want to render an entire scene, you really have to use Vertex Buffer Objects and other stuff that aren't "for beginners". glBegin/glEnd is called "intermediate mode", and is really slow.

To the OP: I suppose you want to write games, not game engines. Try using an existing engine like Irrlicht, Ogre (only graphics), ...
Or try XNA and C#. If you only know basic CPP, you're better of with C# to write a bigger application in my opinion.

This topic is closed to new replies.

Advertisement