c++
c++
I'm interested in learning C++ in order to start writing games.
Now, I know there's probably easier ways of writing games than getting into C++, but the portability and universality of the language appeals- since once I get to grips with it, I should be able to use it on other platforms.
Anyway, a friend of mine recommended C++ for dummies which I've bought and bundled with it, it has a copy of Bloodshed Dev-C.
My questions are- is Bloodshed Dev-C any good, should I use it- does anyone recommend anything different, preferably a free program, but i'm not averse to spending money on something if i'm going to use it.
Also, what else does anyone recommend- any other books or courses??
The C++ for dummies seems fairly comprehensive, but doesn't seem to include anything in the way of games programming.
Incidentally, I'm very new to C++, but in the past I've written games in Amos, Basic and 6502 and Z80 machine code, so I understand the principles of programming, but I've no real knowledge of C++ and its particularites.
Cheers for any help or advice.
Now, I know there's probably easier ways of writing games than getting into C++, but the portability and universality of the language appeals- since once I get to grips with it, I should be able to use it on other platforms.
Anyway, a friend of mine recommended C++ for dummies which I've bought and bundled with it, it has a copy of Bloodshed Dev-C.
My questions are- is Bloodshed Dev-C any good, should I use it- does anyone recommend anything different, preferably a free program, but i'm not averse to spending money on something if i'm going to use it.
Also, what else does anyone recommend- any other books or courses??
The C++ for dummies seems fairly comprehensive, but doesn't seem to include anything in the way of games programming.
Incidentally, I'm very new to C++, but in the past I've written games in Amos, Basic and 6502 and Z80 machine code, so I understand the principles of programming, but I've no real knowledge of C++ and its particularites.
Cheers for any help or advice.
hoots mon- crivvens, help ma boab
-
Pixel_Outlaw
- Posts: 2646
- Joined: Sun Mar 26, 2006 3:27 am
I have tinkered around in C++ casually but the thing to remember is that you will need to use some libraries to get graphics and sound up and running. Since cross platform compatibility appeals to you you might want to use something like Allegro. Make sure you really know a good chunk of the language before thinking about using libraries because they will probably demand you know how to use the basic structures of C++. I believe that "Sams Teach Yourself Game Programming in 24 hours" is a good book and focuses on C++. If I recall they use DirectX for graphics later on in the book. It's funny, almost every book will say that C++ is the industry standard yet most of the people I talk to use C. For now, just worry about understanding those Cat classes that live inside the dosbox and print *meow* to the screen. 

Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
No, this game is not Space Invaders.
-
Necronopticous
- Posts: 2129
- Joined: Sat Sep 29, 2007 8:50 pm
- Location: Baltimore
Re: c++
Good one.NAVVARR wrote:[...] C++ [...] portability [...]
Re: c++
C++ is very portable depending on how you write your code and what libraries you use.Necronopticous wrote:Good one.NAVVARR wrote:[...] C++ [...] portability [...]
Bloodshed's IDE is simple but very effective and good for beginners, you should probably make sure you get the latest version off their website though. When you're a little more comfortable you might want to move onto something with more features like Visual Studio or just use command-line tools if that's your fancy.
I don't know much about the dummies book. Any book will do if you're willing enough to learn and fill in the gaps yourself, but I would recommend Accelerated C++ (Koenig, Moo) for a beginner - it takes a very practical approach to get you familiar with both the language and the STL.
That book doesn't cover games programming, though. There is a set of decent SDL tutorials at http://lazyfoo.net/SDL_tutorials/index.php - SDL being a simple, cross-platform library for sound, window management, basic 2D graphics, input, etc. Everything you need for a simple game. Fill in the rest of your knowledge with stuff from gamedev or shmupdev.
I am learning C++ in college right now. I'm using MS Visual Studio as my IDE. Once I become very comfortable with using external libs, I'll begin doing my future game projects in C++, abandoning the rapid-application-development environments like Multimedia Fusion and Game Maker altogether. Those kinds of programs usually end up producing games that are high in CPU usage, since they are actually packed with the source code and an interpreter, rather than compiled into a standard Windows executable.
The age of Alluro and JudgeSpear is over.
Re: c++
C++ can be fairly portable, but it is extremely easy to write non-portable code without realizing it (similar in principle to C, but to a greater extent). A lot of compilers retain historical extensions and quirks that shouldn't be relied upon. Aside from that, the C++ standard is phenomenally complex and various issues are not well-defined. That said, there's pretty much no other language with its combination of modern features and industry support.Danbo Daxter wrote:C++ is very portable depending on how you write your code and what libraries you use.Necronopticous wrote:Good one.NAVVARR wrote:[...] C++ [...] portability [...]
Re: c++
I feel that C++ is a great compromise between portability and speed. I've done a lot of projects in Allegro and a few in SDL, and I've never had to change more than a couple minor lines to get something to run on a different platform.
If you want to standardize on a compiler, GCC is a great choice as it's available for nearly every platform including Windows, and is the stock compiler on both Mac and Linux.
If you want to standardize on a compiler, GCC is a great choice as it's available for nearly every platform including Windows, and is the stock compiler on both Mac and Linux.
Humans, think about what you have done
Re: c++
At the moment C++ hates me. i've had two previous goes at learning it with no joy whatsoever and eventually i discovered that the problem was the books; the most recent attempt, using CodeBlocks for the IDE, MinGW as a compiler and Allegro to do graphic-y things has worked out far better and in the last two days i've "learnt" enough C++ to get stuff moving around for what'll be a hideously simple arena shooter... now if only i could stop the damned thing flickering occasionally!
Re: c++
Wow, what kind of flicker is it? Maybe we could helpTMR wrote:now if only i could stop the damned thing flickering occasionally!
Humans, think about what you have done
Re: c++
That's the thing, i've got two days of working with C++ so i'm not sure how to even describe it! =-) At the moment i'm drawing to a back buffer and blitting it over to the front but i suspect the clear/draw/blit cycle is taking too long despite only managing a couple of hundred sprites (my BlitzMax code uses more than that for the particle effects!). The flickering i was experiencing seems to be down to the "tutorial" on triple buffering i read that didn't entirely explain how to get Allegro to write to a buffer that wasn't the current foreground, currently i'm double buffering and the flicker is gone but it drops frames.louisg wrote:Wow, what kind of flicker is it? Maybe we could helpTMR wrote:now if only i could stop the damned thing flickering occasionally!
i'll work it out sooner or later, though...
-
null1024
- Posts: 3823
- Joined: Sat Dec 15, 2007 8:52 pm
- Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
- Contact:
Re: c++
And this is where I come in and say go to Java. It has extremely good built in drawing libraries, drastically simplifying everything. I gave up on trying to learn C/C++.
[I'm only half kidding, and in slightly related news, 1 internet tutorial on Java games programming on the internet taught me more than a 90 day course on Java. I have the strangest feeling that the course was designed to weed out the idiots who took it, so that when who's left gets to the next course, we can get real work done.]
[I'm only half kidding, and in slightly related news, 1 internet tutorial on Java games programming on the internet taught me more than a 90 day course on Java. I have the strangest feeling that the course was designed to weed out the idiots who took it, so that when who's left gets to the next course, we can get real work done.]
Come check out my website, I guess. Random stuff I've worked on over the last two decades.
Re: c++
Well, Allegro makes C++ relatively easy, the only issue i'm having is documentation really; once i wade through the guide on the official website and then look at actual examples in the forum (usually broken and asking for help) i can get my head around it. Part of my flickering problem for example was a documentation issue, there's nothing i can see saying to load graphics into the VRAM in order to speed up blits but now i've done that it's significantly more efficient.null1024 wrote:And this is where I come in and say go to Java. It has extremely good built in drawing libraries, drastically simplifying everything. I gave up on trying to learn C/C++.
Still dropping the odd frame right now though, i'm guessing because the vsync() doesn't always catch 'em all perhaps...?
Re: c++
If you're gonna develop it in C++ (a smart idea if you know the ins and outs of c++) I find either using SDL or DirectX to be most hassle free.
There's some good SDL tutorials around by some guy called lazyfoo, but not many tutorials for using the D3DXSprite interface with Direct3D... using D3D obviously makes it windows only (Wine excluded) and leads to a bit of nasty boilerplate code, but the sprite interface itself is easy to use and you get nice things like full hardware acceleration and alpha blending.
There's some good SDL tutorials around by some guy called lazyfoo, but not many tutorials for using the D3DXSprite interface with Direct3D... using D3D obviously makes it windows only (Wine excluded) and leads to a bit of nasty boilerplate code, but the sprite interface itself is easy to use and you get nice things like full hardware acceleration and alpha blending.
Re: c++
Yeah, SDL is very clean. It's also probably a bit more pro than Allegro in some ways, like not being based around a set-interval timer. It's easier to get up and running fast with Allegro though.. I still use it a lot just because it's less hassle.
Humans, think about what you have done
Re: c++
That's what i've found generally, yeah - after getting used to the quirks of C++ compared to other languages (i'm used to Blitz 2D and then BlitzMax where sin and cos work in degrees rather than radians) my likkle game is close to complete on the code front.louisg wrote:It's easier to get up and running fast with Allegro though.. I still use it a lot just because it's less hassle.
-
- Posts: 2
- Joined: Wed Aug 26, 2009 1:59 pm
Re: c++
Hi
If you want to learn C++ then you should have good skill in C Language and there are many eBooks on internet. You can easily download it, if you don't want to spend your money.
If you want to learn C++ then you should have good skill in C Language and there are many eBooks on internet. You can easily download it, if you don't want to spend your money.
Re: c++
It does not matter, which programming language you use, you will be up your neck in math.
People please post resources and ideas for making it easier for programming, in general. Also Assembler is far more faster, while C+ is considered a low-level language, Assembler has many resources as well. Again it does not matter, you will need to know math.
Allegro is what makes Mugen, Mugen. You can go back as far as when Mugen first appeared. Originally it was going to be a shooter, but they decided a fighter was much easier.
Then of course is the guy who made, "Chorno Trigger" for the X-box, before it was shotdown, by Square ( who practically killed off the Magus on the NDS ). Search him, maybe he has resources, to use, since he told his story of learning programming. Also on the x-box that was shotdown is a project known as Burning Angels, which is a shooter.
Do not limit yourself to direct X, but also try OpenGL and using resources. Keep in mind their are many platforms to program for. The idea of getting into deep programming, is to save resources and the reprogram it for another machine. Which looks good on paper but is really alot more difficult then it sounds.
Their are many source codes, flying around for many games. Take Pac-man or even Donkey Kong, right now. It helps to read the source codes of other games, but the compliers are differnt. Do not always turn to Visual Basic 2005 ( last to compile a normal exe ), thier are tons of compliers. Some emulators like Meka also mention the use of various compliers. Their are even official compliers floating around, and people have them. It wont hurt to spend some money as well, it sucks but a man has gotta do what a man gotta do.
People please post resources and ideas for making it easier for programming, in general. Also Assembler is far more faster, while C+ is considered a low-level language, Assembler has many resources as well. Again it does not matter, you will need to know math.
Allegro is what makes Mugen, Mugen. You can go back as far as when Mugen first appeared. Originally it was going to be a shooter, but they decided a fighter was much easier.
Then of course is the guy who made, "Chorno Trigger" for the X-box, before it was shotdown, by Square ( who practically killed off the Magus on the NDS ). Search him, maybe he has resources, to use, since he told his story of learning programming. Also on the x-box that was shotdown is a project known as Burning Angels, which is a shooter.
Do not limit yourself to direct X, but also try OpenGL and using resources. Keep in mind their are many platforms to program for. The idea of getting into deep programming, is to save resources and the reprogram it for another machine. Which looks good on paper but is really alot more difficult then it sounds.
Their are many source codes, flying around for many games. Take Pac-man or even Donkey Kong, right now. It helps to read the source codes of other games, but the compliers are differnt. Do not always turn to Visual Basic 2005 ( last to compile a normal exe ), thier are tons of compliers. Some emulators like Meka also mention the use of various compliers. Their are even official compliers floating around, and people have them. It wont hurt to spend some money as well, it sucks but a man has gotta do what a man gotta do.