Jump to content
  • Advertisement
Sign in to follow this  
redragonman

Beginning in C++

This topic is 4741 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

Hey, Awile ago I started programming in C++. Other than html it is the only language I can do anything in. I am lost because I can make text based games in dos but, I mean really, Who can truthfully say that the most fun game they ever played was text based? I want to make a 2d non-text based game for Windos-XP. My book dosn't tell me how. I was wondering if anyone could PLEASE point me in the right direction or give me some advice. It would be appreciated. Thanks in advance for any advice given. (helpful or otherwise)

Share this post


Link to post
Share on other sites
Advertisement
I've heard some good things about Allegro and SDL. Microsoft's GDI+ might also be something to check out. Other options would be to use MS's original GDI, which is getting kinda old and ugly, or the more complicated options of using Direct3D or OpenGL. Whatever you choose though, it'll almost definitely be some library of some form or another that you'll need to download and learn to use.

Share this post


Link to post
Share on other sites
It's all well and good to try and be helpful to this person and answer the question, but I think you guys are just giving him ammo to shoot himself with. redragonman, it doesn't sound like you are quite ready to take that big leap yet, and I would suggest that you spend a little bit more time on text based programs. Tic tac toe is often suggested, and you could try making the very best text based tic tac toe game that you can, for example. If you jump right into graphics programming armed with only, as you described, text based games and html experience, you could be in for a lot of discouragement. It takes time and effort to become a good programmer, what's the rush? I tried to rush myself long ago, and I quit programming for a lot of years because it was so discouraging.

Share this post


Link to post
Share on other sites
Heheheh, the first project I ever did in c++ was a graphics engine. It was also my second, third, fourth and now fifth project as I started from scratch, each time applying things I'd learnt, and using my (massive) mistakes from the previous incarnations to teach me.

2D games are a lot simpler than 3D ones, so you might want to do a bit of reading, and then give it a go. I suggest starting off with the Windows GDI+, mainly because there is a lot of literature, and it's not overly complex to get a window up and running and ready to bitblt to. After that, things will get a little more tricky, but you'll never progress unless challenge yourself.

Share this post


Link to post
Share on other sites
it takes a LOT of time to be a good programmer ... no matter when or where you start ...

however, I also think most people who talk about things being too difficult for starting are basing that on the order they learned in. The truth is, you can start with any technology, language or API and not counting certain bad decisions that every language and api has, they are all hard to learn initially, and yet not to hard to learn if you want to.

The only things I think are important for starting are: 1) give yourself enough time, and realize that most project's will not be as grand as you plan. 2) control the number of things you are biting off at one time and take pleasure in the small victories along the way.

It is perfectly acceptable to begin your very first programming with C++ and OpenGL if that's what you want to do ... and if you do, you will be way ahead of the average learning programming when it comes to 3D graphics programming for 1 year programmers. But you will probably be equally weak when it comes to file i/o, basic class and interface design, etc. Because you learn what you attempt (and usually fail at). So if your off trying to get a ball bouncing on the screen, you will ... and reasonably fast I'm sure ... it's really only a few months harder than doing a text based quiz program that reads from a file. But in the end, you will need to do both to know how to program anything usefull. And more.

If starting with C++ and OpenGL I highly highly recommend the first 4 NEHE lessons, and download the code that uses GLUT. GLUT is slightly easier the first few weeks than SDL. After you do the first 2-3 programs with GLUT, move on to something else if you want (SDL, pure OpenGL, DirectX, whatever) ...

or my recommendation, take a few weeks of to do 1-2 non-graphic programs (using cout and cin, or printf and very simple file i/o). C++ file i/o is hard to get right the first few times ... but it doesn't stay that way.

good luck.

Share this post


Link to post
Share on other sites
You MUST understand pretty much all the basic syntax of C++, especially templates and inheritance, as well as the STL containers, before moving on to graphics. You must crawl before you walk, young one. I took about 2 years before doing ANYTHING with graphics. The meat of most games can be done, and is tested in, a text-based environment. If you REALLY feel you are ready to start doing graphics programming, try theForger's Win32 API tutorial, where you will learn to use graphical controls and display bitmaps, a part of the graphical functionality Windows provides (which I assume you are developing for).

If you get confused by that, then keep making text-based games until you aren't anymore :)

Good luck.

Share this post


Link to post
Share on other sites
If you want another option for when you get "further" into coding is to use a pre-built game engine like irrlicht Its open source plus can allow 3D and 2D creation of games; I find it rather nice and it has a well written SDK.

Also, a less idealistic attempt to make a 2D game would be to use DirectDraw even though its discontinued, you can still continue to use it with the DirectX SDK, I wrote my first 2D game in DirectDraw.

Share this post


Link to post
Share on other sites
Actually MUD's are text based and seem to be gaining popularity although you'll need to learn some networking programming for that.
The reason your book doesn't explain 2D programming is because as has already been posted by other's there are like 100+ different ways to make 2D games in windows.
If you want to make 2D game that will run under linux,macs also lookup SDL or ALLEGRO.
If you are just concerned with windows and want the highest performance learn directx.
You could also just use GDI under windows since some people will tell you it's easier than learning directx but I've used them all and by far the easiest to get started with is allegro.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!