Jump to content
  • Advertisement
Sign in to follow this  
programwizard

Questions from a noob

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I'm sort of new to programming, and I have a couple of questions... Are the win32 API and DirectX the same thing? If they're different, what are the differences? Do you need both for making Windows games, or just one? Also, in Cplusplus, is a "class" the same thing as an "object"? If they're different, what are the differences? Thanks for taking the time to read this!

Share this post


Link to post
Share on other sites
Advertisement
The Win32 API and DirectX aren't the same thing. Both are APIs (Application Programming Interface), which means they're basically a collection of existing code created to save you a lot of time and effort. You can see a basic definition here or a more detailed one here. If you want to learn about the Win32 in more detail, I quite like the tutorial here.

It'll probably be helpful for you to know at least the basics of the Win32 API to write games for windows, but you don't really need to learn it in too much detail. DirectX will vastly improve the quality of your games, but you could create games without using it at all if you learnt the Win32 API in more detail and used GDI for rendering. Some other alternative APIs include SDL, Allegro, and OpenGL.

Generally, "object" would be used to refer to a particular instance of a class. For example, say you had a class "student" - "Bob" (who is a student) might be an object based on that class.

Hope that helps you out. [smile]

Share this post


Link to post
Share on other sites
As a fellow that has been a beginner for a while now (IE lets say 5 years). Here are my recommendations:

- Learn the Win32 API (but don't go to deep)
- Learn how to create a window(s)
- Learn how to use windows messages
- Learn how to use the GDI (but don't wander too far into it .. you'll be using DirectX or OpenGL later on anyway)
- Look a bit at multithreating
(All the above is for C++, I have no idea how you would attempt it in C#)

- Play a bit with SDL (Although it is not compulsory it is easiest way to see some quick results)
- Make a simple game or demo with SDL (by now you will know if you still want to code games)

After the above, you can dive in a bit deeper IE DirectX (Read the DX forum FAQ, it's good!), OpenGL.

Share this post


Link to post
Share on other sites
My apologies to the previous poster who am about to contradict, but...

I would very strongly suggest not bothering to learn about the windows API, how to create a window, GDI or any of that for now. Get to grips with C++ as a language, get to the point where you can write console programs that take input from the user, process it, read and write files and are generally comfortable with the keywords and syntax.

Then move onto an API like SDL. With SDL you can create a window, load an image and draw it on screen in 20 lines of code. You'll get started so much quicker than having to trawl through hundreds of pages of windows API documentation looking up obscure flags for functions that you will only ever use once.

Alan

Share this post


Link to post
Share on other sites
Quote:
Original post by Alan Kemp
I would very strongly suggest not bothering to learn about the windows API, how to create a window, GDI or any of that for now.

Seconded.
Quote:

Get to grips with C++ as a language, get to the point where you can write console programs that take input from the user, process it, read and write files and are generally comfortable with the keywords and syntax.

I disagree with this [smile].
Whoever suggests "Learn C++ first" to someone who's new to programming must be some kind of misanthrope [smile]. C++ is not a good first programming language and that's not only my personal opinion. To rephrase your statement (which in principle is correct of course!): Learn whatever language you chose to learn and get comfortable with it by writing simple apps first.


And another tip - don't bother learning the name of each and every function you might need or want to use. Learn using (e.g. searching, reading and understanding) the docs instead. You don't have to know everything, but you should know what to look for and where to find it [wink].

HTH and good luck to you!
Pat.


Share this post


Link to post
Share on other sites
As for the c++, yeah I was working on the assumption that he knew c++. First learn the language you intend to code in. I prefer C++ but there are also other IE pascal is very nice language to learn programming concepts. VB is also an option.

Maybe SDL first would be faster solution, however I feel having a basic knowlegdge of how the windows API functions is essential to all coders (Windows coders anyway). That is why I suggested it first.

Share this post


Link to post
Share on other sites
Quote:
Original post by Talib
Maybe SDL first would be faster solution, however I feel having a basic knowlegdge of how the windows API functions is essential to all coders (Windows coders anyway). That is why I suggested it first.


I second that. At some point you are going to have to (or at least want to) learn the windows api (if you are developing for windows). You can hide from it for a while, but eventually you will have to learn it. And what the heck? Its not all that complicated, just get a book on the subject (recommended) or find a good tutorial and sit down and learn it. After you know how it works you then are set and can proceed masking out its complexity (via creating an include library, or just copying and pasting all that redundant code). IMHO the less ‘black boxes’ you have to deal with the better. My philosophy is that if you use it, you should understand it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!