|
|
#1 (permalink) |
|
500+ Posts????
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
|
Alright, I'm getting started in the whole C++ thing, though I never wanted to. I have programming experience, but its mostly just in scripting languages and online programming (Java, PHP, etc). I also know VB (6.0 and .Net). I understand the syntax of C++ and have written some very basic and dull programs (all those dumb little computing things that run in a DOS prompt window...yipee).
Anyway, I'm trying to get my computer setup to start working with C++ and DirectX game programming. This is where I get lost. I need to install the Windows Platform SDK (to develop 32 bit windows applications...apparently). So! There are a few options on the site, but I don't know which applies to me. Do I need the AMD64, the ia64 or the x86 SDK? And what do any of those mean anyway? See, I'm a very visual person, so the straight, obscure syntax world of C++ has always confused me. I don't get polymorphism or dynamic memory. Namespaces annoy the crap out of me and I don't fully understand their usefullness unless you're switching namespaces for different phases of the game (start menu, main game, combat, etc) and then, couldn't you just use the same namespace? Cuz from what I can tell, all they do is allow you to use repeating variable names (or variable "identifiers" as the arrogant tutorial writers seem to call them). I mainly just don't get the landscape of a C++ program. For instance, the Header files. Aren't they the same as the source code file? Just groups of functions that you call when their needed? And, if so, couldn't you just create those in the main code? Granted, this makes the code not very portable, but am I misunderstanding their purpose? So, if anyone has some advice for me, I'd really appreciate it. And if possible, try to just help me understand, don't just post links to C++ tutorials. I'm fairly certain I've read them all (not literally) and they either assume you already know C or C++ or you know nothing. I'm somewhere in the middle and can't find anything useful. So, help? Or, if you want to save me the trouble and volunteer as a coder for me, that'd work too :smile:
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats." ~ Howard Aiken |
|
|
|
|
#2 (permalink) |
|
McFox Sandwich
Join Date: Jul 2006
Posts: 463
Reputation: 10
|
Well first I say use OpenGL. Its better and works with all O.S.'s as DirectX only works with windows. - correct me if Im wrong-
For the "using name space" that saves you from using that same name again like this. Code:
using namespace std;
int main ()
cout <<"Hi"; /* That is where std will come in.
sorry this is a little sloppy and incomplete */
Code:
int main () std::cout <<"this is more annoying"; |
|
|
|
|
#3 (permalink) | |
|
Crumbly, but Good
|
Quote:
As for the Windows SDK, yes you do need it, especially if you want DX applications. Basically, if you're under a 32-bit processor, then you probably want the x86 version. If you've got a 64-bit, you need to know whether it's Intel or AMC and download the appropriate version. Header files are damn useful, becuase you can choose to include them in multiple files, so that you don't have to keep re-writing the same code over and over again. (E.G. defining types, prototypes, global variables) Soo, yeah. Don't jump to DX right away, try learning some Win32... which I leanred from here: http://www.winprog.org/tutorial/
__________________
|
|
|
|
|
|
#4 (permalink) |
|
500+ Posts????
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
|
Thanks for the great replies. I understand the reason to use OpenGL. The reason I was looking at DX is because it handles everything (input, sound, etc) instead of just graphics, and it would be faster to learn that (I assume) than OpenGL, plus other libraries for the other aspects.
I have studied OpenGL a bit. I have the books Beginning C++ Game Programming and Beginning OpenGL. I understodd the basics of it, but it doesn't seem to sink in (as soon as I close the book, I'm lost again). Still, I've just discovered ClanLib, which is a library specifically designed for creating games in C++ and it uses OpenGL, so I may be using that, which will help with my OpenGL as well. But ClanLib also has functions for animation, sound, input, font handling, networking, etc. Still, I know most of this is over my head, but it looks like as good a place to start as any. My biggest issue, it seems, is the basic landscape of C++. I understand the code. I understand writing header files that can be included, etc. But I don't understand simple things like where these files physically go. Do they need to be open in the dev environment when you compile the code or will the include <filename.h> line automatically search the projects root folder? Like ClanLib, I downloaded it and extracted the files into folders on my desktop. Now, I'm looking at the stack of files in one hand and my Dev-C++ folder in the other, wondering where to put everything to make it work. In fact, I can't run a single one of those files without getting the "Directory does not exist" error. I've installed the x86 SDK, so thats one obstacle I'm over. I also installed VS 2005 Express, but I hate it, so I think I'm sticking with Dev-C++. Is that a wise choice or should I give VS another shot... I couldn't even figure out how to compile (though I only spent about 5 minutes looking). Again, thatnks for the replies guys, hopefully I'll be on my way soon. Oh, also, I'll be getting a shiny new comp with my tax returns and I'll be setting it up from the start to be a programming/gaming machine, so I may be asking for some more advice on simply the best setup later.
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats." ~ Howard Aiken |
|
|
|
|
#5 (permalink) |
|
McFox Sandwich
Join Date: Jul 2006
Posts: 463
Reputation: 10
|
Dev-C++ is awsome! I also suggest that when you learn a lesson, make a bunch of codes and go over what they do, ever if they are the same ones. Thats what I do.
When you compile a project you compile EVERYTHING in that project, so if the header file is in the project then it should compile
|
|
|
|
|
#6 (permalink) |
|
500+ Posts????
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
|
Alright, re-reading my C++ book, I've come to the realization that I'm just kicking a dead horse. While I do still need to fully grasp the concepts of dynamic memory and polymorphism, there's really very little about the basic code I don't know. So, it looks like I'm going to have to just take the plunge and try my hand and creating graphical games.
My game has also been pre-produced to death. Heck, I've designed web pages with neat little clickable flow charts and mouse over notes. All this, while waiting for a programmer to come along and decide that they wanted to work on the project with us. So, if I have to do this myself, I guess I have no choice. I still consider myself well within the realm of "beginner programmer", and yes, I'm about to begin work on an MMORPG. I know, this is the fool's hope and downfall of every would-be creator, but I've been dancing around it and making silly little calculation programs and indy games long enough. I finally got the core and display headers from ClanLib to work in Dev-C++ (though I haven't used any of their functions yet). And really, I don't know why I'm posting this little rant. Kinda intimidating standing on the brink I guess. You guys have been a lot of help. Thanks. I'm sure I'll be posting regularly as I stumble into the first few functions, so wish me luck. I'll see you soon. 2
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats." ~ Howard Aiken |
|
|
|
|
#7 (permalink) | |
|
Crumbly, but Good
|
Quote:
__________________
|
|
|
|
|
|
#8 (permalink) |
|
500+ Posts????
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
|
Whoa, apparently ol' Khanstruct has to slow down. I just found some open source code for a 3d RTS. Granted, while I could make more sense of it than I could have a year ago, I was entirely lost... and I think that was after the guys first "test" function. This just gets more depressing every minute.
Still! I did what anyone would do in my situation. I e-mailed the guy and asked if he wanted to code for me. :smile: Still, I noticed that his code seems to use scopes within scopes. Is that even possible? I wasn't aware that you could nest namespaces? Here's an example: void Tank::CIPosMgr::Create(Tank *Base) { CIPosMgr::Base = Base; } Now, from my vague understanding "::" is a scope that directs to a namespace. On top of all this, the code begins with "namespace IGAME" note; not "using namespace", just "namespace" Now granted, the code was a bit clunky and the game takes forever to load, and after playing it for 5 seconds I got a "s**t happens" error (without the censor-friendly astrisks), so maybe this guy isn't the best example, but could someone explain that little code bit for me. I'm guessing it means that there's a function called create (in this case, creating a tank at the location of a base) The Create function is being called from another function "CIPosMgr" (I'm assuming a position manager) and the position manager is being called from the tank... function? Why would there be a function called tank that returns void? Wouldn't tank be an object and the create function return a value? The base=base... I have no idea. My god this is discouraging. Granted, this just proves I'm nowhere near beginning my own game, but if someone could explain this bit for me, it may help give me some insight once again. Thanks
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats." ~ Howard Aiken Last edited by Khanstruct; 01-06-2007 at 08:00 AM. |
|
|
|
|
#9 (permalink) | |
|
Dante’s Inferno
|
Quote:
.
|
|
|
|
|
|
#10 (permalink) | |
|
Crumbly, but Good
|
Quote:
Basically, there's a class called tank. A class is kind of like a struct, except that it also has functions in it. Basically, the create function is returning void because it's modifying a value inside the class itself, no other information is needed, all that's being transfered is the address of Base to this tank's Base variable. Sorry, if I'm not being clear. But reading up on classes will definetly help you understand this example.
__________________
|
|
|
|
| Thread Tools | |
| Display Modes | |
|
|