Sign in to follow this  
street programmer

do i need windows programming.

Recommended Posts

I just finished learning cplusplus and oop programming and am planning on starting directx programming, but before that i had a few questions in mind: 1)do i need to know win32 programming (windows programming) to start directx programming? 2)If yes, does anyone know of some good books or tutorials to get into windows programming. I hope someone could give me a good and useful response, thank you. Ps: sorry about the (cplusplus) sign but my plus sign doesnt seem to work.

Share this post


Link to post
Share on other sites
You should probably learn the basics of windows programming - how to register a window class and instance it, how to set up a message loop, what kinds of things go into a message procedure. For tutorials and such, check out the links above titled "articles", "books", "for beginners" and so forth.

Share this post


Link to post
Share on other sites
Quote:
Original post by street programmer
1)do i need to know win32 programming (windows programming) to start directx programming?

You need to be familiar with Component Object Model (COM) programming, which is a construct created by Windows that exemplifies OOP. It is a standard that specifies how a group of objects can interact. Languages like C++ and JAVA naturally fit with this type of design well since it's basically just a set of rules that are based off a subset of object-orientated principles, ie., encapsulation and interfaces. DirectX is implemented as a COM API, so understanding COM is a natural first step to understanding DirectX (NOTE: The COM is merely how you interact with DirectX, and has little to do with how you use it, although such an understanding, IMO, does nothing but help you).

Do you need to know Win32 programming? In part, if only because COM is a Microsoft technology - although it's really platform independent - and as LessBread said, to know how to set up basic windows, get rendering contexts, etc., if you're programming for Windows. An alternative would be to use SDL, which is also platform independent and handles much of that "boilerplate" code for you. More information can be found at http://www.libsdl.org/index.php.

As for tutorials, I'm sure if you do a forum search here on GameDev you'll come up with a few help resources. As far as "expanding your horizons" I would personally recommend a few months worth of Windows programming studies, simply because it will allows you to be more versed in more programming systems and styles. If you just want to make games wth DirectX, look over COM design until you can grasp the essentials of how COM objects communicate with each other, grab a DirectX book and dive in.

Quote:
Ps: sorry about the (cplusplus) sign but my plus sign doesnt seem to work.

If you're referring to the preview mode trashing your + signs, it's a known bug and does not affect your post. Good luck and feel free to ask any questions you have about COM programming and DirectX and I'll be glad to assist you.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In my opinion its up to you how much you learn. My knowledge of the Win32 API is not at all good, i just made sure i understood all of the code that goes into registering and setting up a window, and then entering the message loop.

A more extensive knowledge definitely wouldnt hurt, but for me personally i doubt it would be too valuable. Id rather spend my time working on other things and other APIs :)

Good luck in whatever you choose to do :]

Share this post


Link to post
Share on other sites
I only know enough WIN32 API to set up a window for OpenGL and Keyboard input. I ditched the Keyboard input and am now using DirectInput for speed reasons. That's all the windows stuff that I know. I had a headstart into OpenGL programming, but when I try to make a level editor, I'll be behind so I'll have to learn it anyway. It's a matter of now or later, at least if I want to advance far into game programming.

Share this post


Link to post
Share on other sites
Don't go crazy learning the Win32 API, you'll just hate yourself afterwards. Learn enough to get a window up since you'll need that, but don't worry about actually being able to develop useful programs using it.

The Win32 API is ugly and a real pain to use. If you're going to be developing a program that uses nothing but the native windows GUI, you're better off doing it with a language like C# or VB. In C++, my advice would be to limit your Win32 education to just enough to get by. For game development you'll probably never need anything else. For non-game development you probably won't be doing much UI work in C++ anyway.

If you do decide that you want to use C++ for regular windows apps, MFC or managed C++ is the way to go.

Share this post


Link to post
Share on other sites
Quote:
Original post by Paradoxish
If you do decide that you want to use C++ for regular windows apps, MFC or managed C++ is the way to go.


Or take a look at Trolltechs QT. QT Designer really speeds up development of GUI applications and i really like the API.

For most tools though, your probably best just using C#. If you dont know it, then try and use it anyway, it doesnt take much learning ;)

Share this post


Link to post
Share on other sites
I was wondering if Charles Petzold's book Programming Windows is still useful. The latest edition came out in 1998 so I'm not sure if is still relevant to Win2000 and XP, or if there are other, more modern books out there? Thanks

Share this post


Link to post
Share on other sites
Petzold's book is still useful and still relevant vis-a-vis W2K & XP. The Win32 API is present in those operating systems - and actually works a whole lot better in them than it did in W98. With regard to learning the basics of windows - how to register a window class and instance it, how to set up a message loop, what kinds of things go into a message procedure - Petzold is the "gold standard".

Share this post


Link to post
Share on other sites
Quote:
Original post by Wetnap
I was wondering if Charles Petzold's book Programming Windows is still useful.


Definitely. Even if you're not going to be using the Win32 API much it's a good idea to have a really good reference/tutorial on hand and Petzold's book is more or less the king of that category.

Programming Windows was a godsend when I needed to design a simple windows wrapper for my framework.

Share this post


Link to post
Share on other sites
First, yeah, Petzold's book is still pretty much *the* Win32 reference book. [smile]

Quote:

I just finished learning cplusplus and oop programming and am planning on starting directx programming, but before that i had a few questions in mind:

I don't think anyone has commented on this yet, but no you haven't. You have not finished learning C++. You might have finished a book on C++, but that just means you've finished learning the syntax. That doesn't mean you can program in C++ (or program at all). That'd be like saying you can drive just because you've seen a car.
If you have prior programming experience, you might be able to move on to DX/Win32, but otherwise, please dont. All you'll achieve is to get yourself frustrated, and maybe convince yourself that programming wasn't for you after all.

There's a reason people usually say to start out making console-based games until you're sick of it, and are writing text-based games in your sleep. [wink]
If you don't have any *actual* programming experience, I'd strongly recommend doing that.

Disclaimer:
Of course, I don't actually know anything about your situation. For all I know, you might have meant that you've programmed for the last 30 years, and have actually achieved perfection in C++, but it sounds more like a "I finished my tutorial/book on C++, but haven't programmed anything with it" to me. Apologies if I'm wrong. :)

In any case, don't let what I'm saying discourage you. I'm just pointing out that if you're at the level where you believe it's possible to finish learning stuff like C++ or OOP, you're only just getting started. :)

[Edited by - Spoonbender on October 22, 2005 5:29:14 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Sava
Or take a look at Trolltechs QT. QT Designer really speeds up development of GUI applications and i really like the API.

It also costs a left arm, a first born child and the scalp of five relatives. Win32, warts and all, is free. Even for commercial purposes. Further, QT apps can often end up looking not-quite-native, and the workflow involves a number of external steps to allow QT insert all sorts of hackery and workarounds. QT < Win32 < MFC ~ WTL < Windows Forms. IMO.

I'm not defending Win32. I'm dissing QT.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this