Game Programming and Development Tools

C++ – BenjaminBenz

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
I have a book that deals with Basic C++. Anyone feel led to tell me how to do more than Home inventory and calculators? I would also like to know where to get Graphics design programs etc. Legally. Free legally. Is that possible. Talk to me.

------------------
:-)Boss Benz:-)

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
What do you mean by graphics design ? A paint package ? CAD ?

Which C++ book do you have ?

The C++ language covers things like containers and streams, but does nothing graphics or UI based. In order to learn how to program for Windows/OSX/etc., you need to use an API provided by the OS you are using.

What sort of thing do you hope to write ? How basic is the book ? Do you know what an ostringstream is ? How about this : vector < pair < int, string > >::iterator ? The best book on C++ IMO is the one written by Bjarne Stroustrup, if you don't have it, you should.

If you can give me a better idea of where you are and where you're hoping to go, I'd be glad to offer some more advice. I'd also recommend a site like www.codeproject.com, which is orders of magnitude more lively than this one (130,000 members, hundreds of posts a day ), and full of C++ examples and heaps of people who will love to help you.

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
Thanx! I have only basic knowledge of C++. More specifically I know only sckeleton stuff. I know enough to make the computer do something and I have a growing knowledge of the implements of a program. I hope to create games and general use stuff. What's that book by Bjarne Strostroup called? The only program (besides "Hello World") is a math machine that can multiply divide add and subtract. It's pretty basic. The bookj I have is called: C++ A Dialogue by Stephen Heller.

------------------
:-)Boss Benz:-)

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
The C++ Programming Language is Bjarnes main book ( he created the language BTW ). He also has several others. Design and Evolution of C++ is indispensable later on, but not needed right away.

The book you have appears to no longer be in print. Was it written before 1996 ? If so, it is out of date.

Games are probably the most demanding thing to write. I'd recommend doing some simple graphics based stuff first. You've not said what platform you're on, I am assuming PC. Tricks of the Windows Game Programming Gurus by Andre Lemothe is a good book to get you going on a lot of this stuff. As for C++, you should know at least how to use the C++ container classes, how to write a class structure, how to read and write data to/from disk, etc. before you start work on Quake V :0) The Stroustrup book will certainly show you all that. There are many other features in C++ such as templates and namespaces that you don't *have* to be totally familiar with. The beauty of C++ is that it is a good learning language if taught right, but is also able to continue to meet your needs as you learn and look for more complex features.

rijel

Member

Posts: 14
From:
Registered: 11-18-2002
Have you gone to http://www.cprogramming.com/ ? They have tutorials that go farther then "hello world!" and for graphics theres plenty of options for that, but i'm learning OpenGL and it neat. http://nehe.gamedev.net/ . http://www.freeprogrammingresources.com/cppgraph.html . Both are great sites.
BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
Yes I'm on the Windows XP home platform on a HP pavilion. The Book I have was published in march 2002. I'd like to grab a CAD if I could. The best thing I have for graphics is Microsoft Paint (which has come with computers since the age of dinosaurs). The book which I have teaches enough to get started ( basics like header files, basic operations and commands, declarations) but not enough to really get into the full capabilities of C++, and I don't really know how much that is. The main reason why I chose this book and language was because it included a compiler (the Borland Command Line Compiler 5.5).

------------------
:-)Boss Benz:-)

BluePaladin

Member

Posts: 110
From: Tennessee, USA
Registered: 12-27-2002
Greetings.

This is my basic guide I give to get to game programming, just because I did it the wrong way and had to go back:

Use C++ if you can, but study it in this way:

First, learn the basics. Ivor Horton has a great Visual C++ book. I read the first half of it all the way up to before it starts MFC programming.

He covers things like:

Datatypes
Loops and Conditionals
Object Oriented programming
string manipulation, plus alot more of the basics.

Do yourself a favor and do NOT touch WIN32 programming until you understand the basics of C++. I hit a brick wall because I tried to skate forward and had to go back.

Then, after you feel ok with the basics of C++, learn the basics of Win32 programming. A good book for it, but it's a monster, is Programming Windows by Charles Petzold. A great site to get you started is http://www.winprog.org. Click on tutorials and he goes thru window basics.

Then, it's on to DirectX or OpenGL. Whichever you prefer. Both are good choices and perform well. DirectX is specific to windows, OpenGL is not. I personally chose DirectX because I know Microsoft. I use their commerce products for a living. That's the only reason why. A good book for DirectX is Programming Role Playing Games in DirectX.

whew! That's all I have to offer unless you have further questions. I hope this helps.

------------------
Much greatness is achieved thru faith and perseverance.

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
I already know a few things like: if, else, loop, while and all those operators/commands/procedures. (forgive my ignorance in terminology). I kinda get the idea with the #include<iostream>, <string> etc. Ich habe die Punkt when it comes to declaring strings, shorts, chars, booleans etc. I understand fully the ins and outs of cout<< "Hiyall!"<<endl;, cin>> string;. However after that my knowledge of C++ is embarassingly low. On the bright side: I have aqquired Borland's JBuilder and two books on Java, and Borland's C++Builder, and two books on C. I already have a book on C++ as has been mentioned. I haven't (on account of the lack of time) hardly started any of them except the C++ one. I thank everyone who is giving me a hand. (I feel like an ignoramus, and chances are that I'm not far off.)

------------------
:-)Boss Benz:-)

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
Now I hope when you used cout, endl, etc., you didn't have using namespace std; anywhere in your code.... :P

BlazeQ

Member

Posts: 260
From: USA
Registered: 05-11-2002
For free graphics programs, check here: http://www.creationindigital.com/resources/programs/free.php

------------------
I'm out of my mind... and into the mind of Christ -G.S. Megaphone

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
I did have using namespace std; in my code. The first few lines ran:

#include<iostream>

using namespace std;

Is that wrong, or what?

------------------
:-)Boss Benz:-)

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
Yes, it negates the whole point of having namespaces. You should put

using std::cout;
using std::cin;

etc. for whatever parts of std you use.

Also, don't overuse endl, especially where performance counts. It does a flush as well as a newline.

BKewl

Member

Posts: 144
From: St. Charles, MO, USA
Registered: 07-10-2002
quote:
Originally posted by Christian:
Yes, it negates the whole point of having namespaces. You should put

using std::cout;
using std::cin;

etc. for whatever parts of std you use.

Also, don't overuse endl, especially where performance counts. It does a flush as well as a newline.


Okay a while ago I stumbled on the info about endl, but I didn't realize that using namespace std; is bad. Where exactly do you find this kind of info, Christian? This is exactly the stuff that I can't seem to get: the idiosyncrasies of C++ that'll really take my coding to the next level.

rowanseymour

Member

Posts: 284
From: Belfast, Northern Ireland
Registered: 02-10-2001
I've written a lot of C++ and I've never needed to use namespaces. Am I doing something horribly wrong? And I still prefer stdio to iostream.

------------------
Rowan GODCENTRIC Christian Demoscene

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
BKewl - the reason for namespaces is to partition scopes. If you put using namespace std;, you negate that advantage. The reason you include, for example, iostream instead of iostream.h is that the .h was dropped for the standard, and a big part of that was wrapping everything in namespace std. If you put using namespace std;, you not only negate that, you cause potential for name clashes. As a rule, unless you know, now and always, what a using statement will pull into global scope, you should not use it. As to how I know, Bjarne Stroustrup's book 'The C++ Programming Language'. If you don't have it, you should buy it.

[edit]
The March issue of Windows Developers Mag will also run an article from me on a debugging framework I wrote which illustrates how to extend iostreams.
[/edit]

rowan - I'm afraid you're programming C with classes, stdio is a C library. iostreams is far better, because it is object oriented and highly extendable. You can define your own stream operators, your own streams and your own manipulators. I write quite a few articles at www.codeproject.com, including several on STL and iostreams if you're interested. I also wrote an article on namespaces for DDJ, but I must admit while they've said they still want to publish it, I have no idea when.

[This message has been edited by Christian (edited January 14, 2003).]

rowanseymour

Member

Posts: 284
From: Belfast, Northern Ireland
Registered: 02-10-2001
I would only bother with namespaces if I was working in collaboration with other coders.

I rarely use text mode streams so I don't need the overhead of <iostream> (which as far I can see are just C++ wrappers for stdio). fwrite() works fine for dumping binary objects.

I also like making variable argument list functions like:
MyMessageBox(LPCTSTR pszFormat, ...)
MyTextOut(HDC hDC, int x, int y, LPCTSTR pszFormat, ...)
and using _vsnprintf to format the output string.

I think STL is usually total overkill (though I frequently make my own template classes). I've never used the 'string' class. I use a lot of DWORDS, UINTs and BOOLs, and I love hungarian notation.

I guess I learnt C++ the Microsoft way

------------------
Rowan GODCENTRIC Christian Demoscene

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
Fair enough. Sounds like the sort of stuff you write is very different to me ( lots of database stuff ), which is why I adore the STL for the function objects it gives me, and the interop between containers ( it's common for me to use vectors, lists and maps all at once ). If you're just dumping a binary object, then you need little more than to write it out and read it again, I agree. iostream is pretty costly to add to your project in terms of exe size, so it's better not to add it if you're not going to use it. :0)
BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
Well, I hate to be a traitor or anything, but since my last post I got a hold of a Java starter kit. Good stuff. It included the borland JBuilder 5 personal. Really good stuff. Well, let's face it: The book I have on C++ is inferior to most (if not all) of the others. Thanks to all of you who have helped me out! I really Am happy that I got a link to graphics stuff. If you wanna e-mail me, ask me through a forum and give your e-mail addy and I'll get to you!

------------------
:-)Boss Benz:-)

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
Java is pretty much the same as C#, and C# will soon offer directX, so if you want to shy away from C++ ( for whatever reason ), then C# is a better bet for games than Java. Of course, C++ beats them both. It just depends how good you want your games to be.

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
FYI, I'm a big fan of Java.

With JBuilder, designing a GUI should be easy. You should be able to get the personal edition of JBuilder 8 online for free - if your connection can handle the download.

Note that the personal edition of JBuilder is for personal use only - can't use it to design stuff you're going to sell.

I'm working on figuring out how to use BeanBuilder.

I've created graphical apps without these tools Java - it's not too hard to create a GUI for a program with just code - these tools just make things a bit easier.

Java supports OpenGL if you download Java3D or OpenGL for Java. No need to wait on C# to support DirectX . If you want 2D, the latest VM and SDK for Java already has support for hardware accelerated 2D - using DirectX when in Windows, of all things. I recommend getting the Media Framework for added functionality also. If you use Java, your software will run on Macs and on Linux machines also, without modification. As far as I know, C# only supports Windows.

Of course, C++ is the most popular language for programming games.

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
Yeah, I'm kinda confused with how to incorporate 3D graphics into my programs. I'm ten billion times better with Java than C++, and I like it because it's cross platform. Is C++ like the BEST game desing language or what? I've heard that Genus3 is pretty good. I'm not thinking to distribute my stuff just yet, I just wanna make it. For GUI design: I find that Microsoft Visual Basic is the best because you can creat X,Y coordinates for your buttons and stuff.

------------------
:-)Boss Benz:-)

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
quote:
Originally posted by BenjaminBenz:
Yeah, I'm kinda confused with how to incorporate 3D graphics into my programs. I'm ten billion times better with Java than C++, and I like it because it's cross platform. Is C++ like the BEST game desing language or what?

C++ is the most popular because it's low-level, and allows the game programmer to push the limits of the hardware. Games are pretty competitive.

quote:

I've heard that Genus3 is pretty good. I'm not thinking to distribute my stuff just yet, I just wanna make it. For GUI design: I find that Microsoft Visual Basic is the best because you can creat X,Y coordinates for your buttons and stuff.


Visual Basic is nice, but combining programming languages can be difficult. In any case, there exists GUI builders for every major language. Java has Beans (and JBuilder, but it costs $$ for anything other than personal use), and I think MSVC++ has some sort of GUI builder for C++. Make the GUI in the same language you make the program in.

I'm not sure what "Genus3" is - you have a tendency to misspell . . .

It's probably a type of Game toolkit, which isn't the same as a language.

If you want to do 3D, start simple - don't make a game at first, make a simple demo, such as a rotating cube.

I've found that the first few tutorials in NeHe are pretty simple. Try them first.
http://nehe.gamedev.net/

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
Genus3 is not a typo. I try not to mispell. Oh, well. Anyhow: I saw a little book on how to program in Genus 3. Maybe I was misled as to the nature of it. In any case. I'll have a look at that link. If you can find ANYTHING that is Visual for working with Java (also that isn't illegal to distribute your stuff) I am open for suggestion. I haven't used any GUI builders for Java, just VB. I find that code is the best way to get the results I want. I tried using, however with the layouts etc. that were generated it didn't work out right.

------------------
:-)Boss Benz:-)