Public Group

#### Archived

This topic is now archived and is closed to further replies.

# Move on to windows now??

This topic is 5625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m a newbie programmer and have been learning C++ for about 3-4 months now, and have made a few text games. I know that windows is the dominant platform to develop games for, so should I move onto windows programming straight away? ....or would it be better to learn more C++ in DOS, then when I''m competent in C++ move onto windows. I''ve checked out some windows source code and it looks pretty daunting to me, all the new weird names mean nothing to me.. Is learning windows programming best suited to experienced C++ programmers, or would newbies like me be able to grasp it? Any help would be nice (remember i''m a newbie!)

##### Share on other sites
MFC is a perfect example of how not to make an GUI API. You''ll have to purpasely over complicate your code to make GUI''s using Micorosfts API.

##### Share on other sites
Resist the erge to use MFC. It may look easy, but it will bite you in the arse every time. Pick up a good book on Win32 programming. Check out the latest copy of "Programming Windows: The Deffinitave Guide" or something like that by Charles Petzold. It takes a bit to get used to but it is an excellent skill to have. When you move on to OpenGL or DirectX to develop games, you will need to know, well should know anyways, how to create and manage a window. Cause you kinda need to have something to draw your graphics on

##### Share on other sites
Hehhe. Every newbie faces this dilemma. Continue in c/c++ or... win32?!

Well, I can tell you that you are going to *definatly* need a tone of c/c++ knowledge to be successfull. Unfortunatly, DOS is sooo boring nobody really wants to spend any time in it (myself included). That was one.. mistake, I guess you could say, that I made. I knew the basics, and decided to move on to windows and directx programming right away (well, after 5 or so months of c/c++ basics.) Anyway, in doing this you *can* manage somewhat, with the help of these forums. However, I never really learned good coding practices (besides the obvious naming conventions and the like), and optmization techniques, etc.

To me, Win32 is a good pick for programming in windows. It''s very simple once you read a good tutorial on it, and you basically never look back. However, I found it extremely intersting and spent some time using just a few of it''s many different functions. I learned this mostly from tutorials on the web. I found this was a good tutorial on Win32.

Anyway, before you move on to Win32 I suggest you know the following:

• Know what to put in header files and what to put in cpp files
• Know proper header structure so the compiler doesn''t have to do extra work
• Learn how to use precompiled headers properly.
• Know that you shouldn''t use a class to store three variables (a structure will do fine)
• Be able to use pointers in almost every possible way (something I didn''t do and probably still can''t do)
• Know that you are about to enter the mystical world of Win32

There''s probably more, but that''s all I can think of for now. I really hate saying this, because I have no idea who in their right mind could even attempt to stay in dos this long. Though, I must admit I would be much further along the learning curve if I had taken this advice I''ve just given you.

Hope you turn out {insert appropriate adjective here} like the rest of us! :D

¬_¬

##### Share on other sites
I have to say that i agree with Fuzztrek on this matter as knowing as much as possible about c/c++ will help a great deal with windows/direct x programming. I will have to admit though that i did exactly the same as Fuzztrek in that i tried to do windows/direct x programming before i really understood a lot of the basics of c/c++ programming and really ended up with a lot of problems trying to understand what was going on in a basic windows program. However i did go back and read up a lot on c programming and am now trying to do the same with c++ which i have found has given me a new understanding of what is happening in windows programs.
I am sure that if you take the plunge you might be facing some similar problems in that a lot of the windows data types will have names that won't mean much to you such as HANDLES, DWORD, WORD etc, however if you know basic c/c++ programming well enough you should work out that these are just datatypes like int, char etc but are made specifically for windows programming. I guess a simple way to describe any API would be to say that it is just a collection of data types and functions designed to be used within a specific framework but understanding what is used to build this framework is probably the key to learning how to use it properly.
One last thing, as Fuzztrek said pointers are a must and you should at least be comfortable in using and understanding what normal pointers do and how they can be used. I have also seen pointers to pointers used quite a lot in windows programming so this is another area that needs to be looked at as well as function pointers.

Fuzztrek, i feel from reading your post that you are at a similar level in terms of programming to me. I would be interested to know what kinds of programs you have created and what you are currently trying to learn.

[edited by - popcorn on December 7, 2002 11:02:34 PM]

##### Share on other sites
[mindless self-centered semi-rant]
I use C on my OS.
I despise Windows.
I wont use windows anymore when I port GCC and NASM to my OS.

I, unlike many, can stand independant from Microsoft...
[/mindless self-centered semi-rant]

[what actually comes out of my mouth]
Yeah, Windows is ok...
[/what actually comes out of my mouth]

Enter the Unspoken Realm

##### Share on other sites
quote:
Original post by popcorn
Fuzztrek, i feel from reading your post that you are at a similar level in terms of programming to me. I would be interested to know what kinds of programs you have created and what you are currently trying to learn.

I havn''t done very much so far, just fiddling with Direct3D. I''m optimizing a MD2 loader at the moment, and after that I''m going to try and impliment a view frustrum into my engine. I''m very interested in vertex shaders, however I''m going to try and learn more of the basics first

¬_¬

##### Share on other sites
I started out after console apps( I actually didn''t stay there long in C++, It just annoyed me to heck after being *FORCED* to use Pascal in a class I was taking. ) I danced around the internet for a while and came across four main graphical thingies(sry, I can''t think of the word) The WinAPI+MFC, OpenGL, DirectX and SDL. I looked at OpenGL and DirectX, and then I looked to SDL, and found it was simple enough that even someone from console-based programming would be comfortable using.

There is no extensive class declaring (think WinAPI), and It starts off with a few simple functions.

Okay, as you read this you may think this off topic, but stay with me. WinAPI is crazy to learn, and most likely you''ll just end up using a template. And from what I think you''ll try to do(read: a game), SDL is the quickest way to just give you a screen to work with and let you put pictures on it.

I was able to learn and write a simple game in less than a few days. (Most of the time was spent looking for the next set of tuts) If you''re looking for a GUI, I''ve actually managed to make a GUI with SDL that looks pretty lame, but it''s functional.

sites you should look at:
http://cone3D.gamedev.net - Click on the ''GFX with SDL'' on the sidebar
http://www.gamecoding.co.uk - Some good tuts there as well.

##### Share on other sites
quote:

Know that you shouldn''t use a class to store three variables (a structure will do fine)

Don''t mean to nitpick, but in C++, there is no difference between the keywords "struct" and "class", except that struct defaults to public. Thus the following two code examples are completely and exactly the same:
class threevars{public:    int var1;    int var2;    int var3;};struct threevars{    int var1;    int var2;    int var3;};

- Andy Oxfeld

##### Share on other sites
Andy,

You are absolutely correct.

On the other hand, there is kind of a standard convention that has been developed that goes something like this:

If you''re JUST working with data, make it a struct. If you''re going to add operations, etc... make it a class.

So in reality Struct and Class are different entities. A class is used statically, as an interface, and as a means to create objects.

Structs on the other hand are mostly just used as a way to group data. ( an instance of a struct is rarely called an object)

Best Regards,

Jeromy Walsh
Programmer
Liquid Entertainment
------------------------
"The question isn''t how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" -Boondock Saints

• 23
• 10
• 19
• 15
• 14