Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,075 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,586 people online right now. Registration is fast and FREE... Join Now!




Moving on to advanced topics

 
Reply to this topicStart new topic

Moving on to advanced topics, Worked through a book..

KPthunder
12 Apr, 2008 - 09:10 PM
Post #1

New D.I.C Head
*

Joined: 12 Apr, 2008
Posts: 1


My Contributions
Hey, everybody! I stumbled upon this site looking for c++ cheat sheets and the one offered here is killer, so I decided to join the community.

I worked through Michael Dawson's Book, Beginning C++ Through Game Programming Second Edition, and I have some questions.

First off, I want to start making my own projects, but I don't want to be limited to the console. VC++ Express looks nice, but I feel it's a little complicated for projects of my type. I learned a little about WX widgets and I was wondering if somebody could point me in a good direction for learning it along with a simple editor for making UIs with it.

Also, besides non-console applications, I wanted to make some non-console games. Pong seems like a good place to start, and if anybody could point me in the direction of a good c++ tutorial for non-console games that would be great.

Other questions:
If I do end up using VC++ Express (or even VS 2008) can I use WX widgets? And is the code portable?
Right now I use Dev-C++. It lacks some features (like parentheses highlighting, and the indenting can be weird sometimes) and I was wondering about other IDEs (I'm on windows vista). So far I've seen VC++ Express and Code::Blocks, but I haven't gotten too far into using them.
I kind of missed the point of enumerators while reading the book. Can somebody explain them to me and their usage?

Thanks, everybody. I'm looking forward to being an active member in these forums.

User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Moving On To Advanced Topics
12 Apr, 2008 - 09:24 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
Well, I should warn you that C++ tends to have a higher learning curve toward graphics than other languages. People like to jump right into GUI and graphics programs and tend to get frustrated by all the knowledge that they don't have that is used in these environments....

it really is better to begin with console stuff in C++ and then work up from there.

Course that is not how I did it... I went strait for the graphics at first. smile.gif

unfortunately I don't really know many good beginners resources for graphics. I do recommend cplusplus.com and cprogramming.com as they will help you understand the language. MSDN is an indispensable resource. You will want to look at GDK and GDK+.

Hopefully others will have a little better advice.
User is offlineProfile CardPM
+Quote Post

KYA
RE: Moving On To Advanced Topics
12 Apr, 2008 - 10:15 PM
Post #3

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 4,783



Thanked: 91 times
Dream Kudos: 1200
My Contributions
I'd work on console stuff first. Graphics with C/C++ is not as easy as with java. (imho) You'd have to use Allegro, DirectX, or even your own graphics library (there are others so don't yell at me Tom tongue.gif)

Enumeration is a way to define a number as a variable for easier code readability (among other things). Example:

cpp

#include <iostream>
int main() {
enum Days {SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY};

//Now SUNDAY = 0, MONDAY = 1, etc...

Days today; //defining a variable based on the above enumeration
today = MONDAY;

if(today == Sunday || today == Saturday)
std::cout << "Hooray! The weekend!\n";
else
std:cout << "Crap back to work\n";

return 0;
}


Enuming is a nice way to define code to be more readable. It's the same as declaring a const.

cpp

const int SUNDAY = 0;


Same idea applies here, but the first code piece is better.
User is online!Profile CardPM
+Quote Post

skaoth
RE: Moving On To Advanced Topics
12 Apr, 2008 - 11:07 PM
Post #4

D.I.C Regular
Group Icon

Joined: 7 Nov, 2007
Posts: 342



Thanked: 10 times
Dream Kudos: 100
My Contributions
Lets not forget good ol win32. For a game like pong theres no need to get fancy. MFC might also be an option.

I remember writing Tetris with MFC back in 2k. Thats of course if KPthunder wants to stay on the windows platform
User is online!Profile CardPM
+Quote Post

NickDMax
RE: Moving On To Advanced Topics
13 Apr, 2008 - 05:01 AM
Post #5

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
Enumerations are actually much much more fun than their const cousins.

The first part of my tutorial Data Modeling For Games in C shows them in action in C. In C they are pretty much just name constants but you can see their potential since you can use them with typedef to define a type (which in C is really just and int).

In C++ things change though. In C++ you can make them into their own type and therefore you can create operators for them!! for example if you created an enumeration for the days of the week, you can make a increment operator (++) that moves the value to the next day of the week. smile.gif This is mighty handy.

Enumerations are also very valuable in template meta programming since they automatically "count" things.

If you follow the links at the end of my tutorial Dan Saks does a really good job of explaining the power of enumerations.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 07:22PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month