I want to study the WIndows API, need help.
Members - Reputation: 100
Posted 16 January 2011 - 02:19 AM
I don't understand how to create ANYTHING except an empty window within the Windows API. It's been hard to break into this.
Also, is the Windows API hard to port to other platforms such as Linux or Mac OS X?
Should I use OpenGL or the Windows API to create a 2d game? I know OpenGL is used for heavy 3d graphics, but it seems to hard for me. Is the Windows API better?
Members - Reputation: 3555
Posted 16 January 2011 - 02:46 AM
There are also multi-platform GUI creators. I believe one is called QT, but I have no experience with them.
Members - Reputation: 1136
Crossbones+ - Reputation: 10111
Posted 16 January 2011 - 06:36 AM
The one thing that might trip you up is that the Windows API is a procedural C-based API - no classes here! If you come from an OOP background this may be a little strange for you to get used to, so you're probably better off using a wrapper library. Some good suggestions upthread, but I'd like to add that you should think a little about your objective here. Do you want to specifically learn and use the Windows API or do you want to write programs to get stuff done? If the latter, then maybe going for something like Winforms is more suitable for your requirement.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Members - Reputation: 685
Posted 16 January 2011 - 11:28 AM
Now look the bottom this page to see a example of a very small pure win32 api program. If you are fine with the idea of writing this kind of code, this is the way to go.
But if you come from a OO world, you should probably go with a OO framwork like wxWidgets or QT.
If you do want to use the win32 api, you NEED the 'Programming windows 5th edition' by Charles Petzold. And you need your favorite search engine to find documentation on the win32 api. Often you will be browsing in the msdn documentation.
Hope this helps,
"Dude, the world is only limited by your imagination" - Me
GDNet+ - Reputation: 10718
Posted 16 January 2011 - 12:32 PM
EDIT: Oops, missed the above post. So, I'd second the vote for Petzold.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.
You don't forget how to play when you grow old; you grow old when you forget how to play.
Members - Reputation: 3555
Posted 16 January 2011 - 12:55 PM
You should use something like wxWidgets or Windows Forms. Than you can easily layout any custom form you like, and simply add the code that runs when those buttons are clicked, or something is entered into a control. With WinForms, a lot of things that took paragraphs of code with the regular API have been condensed down to a single function call.
There is also a program called ResEd that can make some Windows Resource scripts for you, but you still have to use the Windows API to use them. http://radasm.cherrytree.at/resed/