Sign in to follow this  

a game with graphics?

This topic is 3369 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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++.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by beun
Try using an existing engine like Irrlicht, Ogre

I suggest you the same...Irrlicht and Ogre3D are very good GRAPHICS engine.
Start with Irrlicht: it's very easy to use.
Then pass to Ogre. Ogre is similiar to irrlicht but it's harder the it...But wow You will get very impressive result.

Share this post


Link to post
Share on other sites
I've heard of irrlicht before but I can't find any online tutorial that teach you how to use it. I can't figure stuff out stuff like that by myself. I also thought that most games are made with C++, so I don't want to learn C#.

what I really wanted was a tutorial about how to use stuff like irrlicht and stuff......

Share this post


Link to post
Share on other sites
Quote:
Original post by beun
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.

Really!? I heard that VBOs are better and faster but i didn't realise it was that necessary to use them. Mind you, i am currently making a 2D game so rendering speed is not as much an issue as it would be for a 3D game.
Still, glBegin/glEnd is a good start. It really depends on how far you want to go, i.e. if you want to create a 3D game with lighting, shadows and advanced stuff like that.

Share this post


Link to post
Share on other sites
Quote:
Original post by XTAL256
Quote:
Original post by beun
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.

Really!? I heard that VBOs are better and faster but i didn't realise it was that necessary to use them. Mind you, i am currently making a 2D game so rendering speed is not as much an issue as it would be for a 3D game.
Still, glBegin/glEnd is a good start. It really depends on how far you want to go, i.e. if you want to create a 3D game with lighting, shadows and advanced stuff like that.


glBegin/End is a fantastic learning tool, and good for simple 2D things. A complex 3D scene would grind to a halt without some vertex array method though.

Share this post


Link to post
Share on other sites

This topic is 3369 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this