Jump to content
  • Advertisement
Sign in to follow this  
dev_n00b

a game with graphics?

This topic is 3656 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
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.

Share this post


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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!