RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
Anyone know of any good WIN API tutorials
 
Post new topic Reply to topic Goto page 1, 2  Next 
View previous topic - View next topic  
Author Message
Gardon
Scholar


Joined: 05 Feb 2006
Posts: 157

PostPosted: Thu Mar 02, 2006 2:42 am    Post subject: Anyone know of any good WIN API tutorials [quote]

Fuck SDL. God damnit I'm pissed. WIndows is my friend now.

Can anyone help me out and give me some good tuts that they know of, or perhaps a good book on the subject (and please don't say LaMothe, cause his shit's older than him)

jason
Back to top  
zenogais
Slightly Deformed Faerie Princess


Joined: 10 Jan 2006
Posts: 34

PostPosted: Thu Mar 02, 2006 2:55 am    Post subject: [quote]

Gardon: If you can't handle SDL, Win32 will slaughter you and then eat you for breakfast. Seriously. Also, LaMothe's "shit" may be ancient, but so is the Win32 API. If you really want something that makes the API slightly nicer to work with try WTL. If you want something really powerful, that makes Win32 dev a breeze try Win32Gui. Win32Gui is a wonderful API, but it's got a very steep learning curve, although looking at it the documentation has improved greatly. If you just want straight win32 api browse CodeProject.org stuff.

One last thing, I mean no disrespect with this, but please do your research before you ask a question next time. You'll quickly find out though that the Win32 API is a bitch for anything beyond the simple.
Back to top  
Gardon
Scholar


Joined: 05 Feb 2006
Posts: 157

PostPosted: Thu Mar 02, 2006 3:20 am    Post subject: [quote]

This input thing is driving me crazy. I figured I'd take the trouble of learning Win32 to get around this problem.

And for some totally unrelated matter, my program won't recognize my timer class, and i don't know why!

So, rather than punch through the damn wall, I figured I'd so something else... learn WIN32 lol

Jason
Back to top  
RuneLancer
Mage


Joined: 17 Jun 2005
Posts: 441

PostPosted: Thu Mar 02, 2006 5:11 am    Post subject: [quote]

Just sayin' this but.. it isn't the API that's going to save your project.

I'm not implying anything but... it can often take more than a few months sometimes to even scratch the surface of an API. Programming isn't as simple a concept to grasp as, say, linear algebra. Changing the API you're using just means you're practically back at square one on the learning scale, and no further along...

Learn design patterns and algorithms; they're the bottleneck in your learning right now it seems, not the api. Mind, I just came back from a friend's right now and I'm not in a very legal state of mind, so don't take this too personal. But it seems like the problem isn't so much the API you're using as it is your understanding of its workings...
_________________
Endless Saga
An OpenGL RPG in the making. Now with new hosting!

Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Thu Mar 02, 2006 6:55 am    Post subject: [quote]

SDL doesn't feature a very clean interface, and its underlying code is a horrendous mess. But I'm not quite sure what you're trying to do here, Gardon...if your problem is input, the Windows API is ultra-simple to use for just that, far easier than most other APIs actually. Of course, it depends on what kind of input you want and if you're using just the GDI or are using some sort of alternate library (DirectX, Open GL, etc). Keyboard can be handled through GeyKeyState (thread-specific) or GetAsyncKeyState (global), game controllers can be handled with joyGetPosEx, etc etc etc.

The Win32 API isn't as hard as some people make it out to be. Alternate APIs just tend to dumbify the whole process, hiding the details from you (sort of like using MacOS in the 68k days), making the Win32 API look daunting at first. It's really quite a simple thing to use once you get going, and its learning curve isn't steep whatsoever as long as you can think procedurally and not have your panties in the OOP shredder the whole time. What IS hard is trying to tackle the DirectX API head-on, but that is not an intrinsic part of the Win32 API so it doesn't count.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
zenogais
Slightly Deformed Faerie Princess


Joined: 10 Jan 2006
Posts: 34

PostPosted: Thu Mar 02, 2006 1:32 pm    Post subject: [quote]

notdveidt: Ever tried to use MDI with the Win32 API? That's no fun. However I do agree with you that learning the basics of the Win32 API is benificial, especially if you decide to start writing more complex programs in other, more abstract APIs.

As for your input problem, looking over your API you're quite simply doing it wrong. You could probably do with a different way of dispatching messages too, which would of course mean rewriting certain pieces of your input class.
Back to top  
LeoDraco
Demon Hunter


Joined: 24 Jun 2003
Posts: 584
Location: Riverside, South Cali

PostPosted: Thu Mar 02, 2006 6:06 pm    Post subject: [quote]

zenogais wrote:
[...] learning the basics of the Win32 API is benificial, especially if you decide to start writing more complex programs in other, more abstract APIs.


Unless, of course, one were not to develop (personal) software for Ze Windows; you know: because some of us choose not to touch the silly thing, or prefer to allow our (games|software) to be used on as many systems as possible with the least amount of hassle.

Also, Hungarian Notation is evil.
_________________
"...LeoDraco is a pompus git..." -- Mandrake
Back to top  
zenogais
Slightly Deformed Faerie Princess


Joined: 10 Jan 2006
Posts: 34

PostPosted: Fri Mar 03, 2006 1:04 am    Post subject: [quote]

LeoDraco: Of course supporting as many platforms as possible is a good thing, but if you're just starting out it's also impracticle. I personally use both Windows and Mac OS X, and I usually tend to like deving on Mac better, but since ~95% of the world uses Windows it just seems like the more logical choice. Also, this thread was specifically targeted at the Win32 API - something I've tried to avoid touching as much as possible, however the occasional brush with it has been inevitable and also unpleasant.
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Fri Mar 03, 2006 1:14 am    Post subject: [quote]

Take what LeoDraco says with a grain of salt...the man is well-known to be an insane trombone player so you are forewarned. :) j/k of course...but seriously...that 'silly thing' is on the vast majority of user computers today, and you'd only be a GREAT fool to ignore such a staggering slap-in-the-face obvious detail.

zenogais: an MDI application in raw API isn't terribly difficult, just a lot of work. Realistically, it's impractical nowadays to do it (Visual Basic kicks ass for this and only anti-VB zealots deny it) but some people like to squeeze as much performance out of their app as possible and you can only do that if you code on the metal, which in this case would be using the API directly. Coding with the Win32 API is sorta like coding in assembly...it's low-level, it's very precise, it's efficient when done correctly, and apps tend to be a lot smaller than using some middleman library (because then you have the overhead of the library which introduces unnecessary bloat to your program).

Anyways, this could easily spiral into a OS war, an API war, or one of the other nine hundred pointless zealot/religious wars that coders are so well-known for, so I'll just leave it at this: if you want to learn the Win32 API, do it...you'll benefit from it greatly. If you don't, then you don't...plain and simple.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
Nephilim
Mage


Joined: 20 Jun 2002
Posts: 414

PostPosted: Fri Mar 03, 2006 3:48 am    Post subject: [quote]

Let me just pop in and say that those of us on the "path less travelled" OS'es would probably enjoy playing your game when it's done, so I'd encourage you to give SDL another go. While it's debatable that the Win32 API might assist you with your troubles, it is certainly un-beneficial for the 1 or 2 in 20 of us who would like to play your game but won't be able to simply because you choose a Windows-myopic API.

I suspect, as mentioned earlier, that abandoning SDL will not solve your problems - it will just shift them to a different API with which you have no experience. You will experience some trouble with any API until you (a) are familiar with the API, and (b) have good software engineering principles internalized.

But don't let that discourage you, though. There is nothing wrong with struggling with this stuff - you may not believe it, but you are learning why the various "best practices" and design patterns are the way they are, and when you have seen the difficulties you can run into, that just makes it that much easier for the light to click on when you're reading up on the solutions.

If I were you, I'd read up on some design patterns and look at some open source SDL games to see how they handle input. I imagine there are some SDL-specific forums somewhere where you could ask questions about specific technical frustrations with SDL - people have been down this SDL input road you're trying to follow before, so let them help you.

Take the time to read and learn, and you will find that the time investment will more than pay off when it starts saving you frustrations like you're experiencing now. And if you get too frustrated with your input engine, don't give up! Just shelve it for a while and work on something else, such as the map drawing engine, a conversation tree engine, or even your game graphics, and come back to it later when you feel up for it. Eventually, you'll be able to get it - it just takes some patience with the learning curve.
_________________
Visit the Sacraments web site to play the game and read articles about its development.
Back to top  
LeoDraco
Demon Hunter


Joined: 24 Jun 2003
Posts: 584
Location: Riverside, South Cali

PostPosted: Fri Mar 03, 2006 9:14 am    Post subject: [quote]

zenogais wrote:
LeoDraco: Of course supporting as many platforms as possible is a good thing, but if you're just starting out it's also impracticle.


Granted; however, if one were to stick to a strictly generic API (such as SDL or GLUT) and language supported standards, porting between different platforms should be a relative snap. For instance, an incarnation of gcc exists on pratically every OS out there, for practically every architecture out there; assuming you write code that compiles on gcc, you could pretty much compile and run a generic, non-OS specific API laced application on any system that supports it, rather than on only a single, target architecture (however large it might be).

Quote:
I personally use both Windows and Mac OS X, and I usually tend to like deving on Mac better, but since ~95% of the world uses Windows it just seems like the more logical choice.


From a business standpoint --- where the ultimate goal is to have an uber-market share and an optimal profit margin --- that makes sense; however, for a personal project that, realistically, will never see any money, that's backasswards. I also find arguments that suggest that since a majority holds an absolute to be self-evident, all others must capitulate to their whimsy to be highly suspect, especially when the market in question was saturated with a given product --- e.g. Windows --- by suspicious business practices, FUD, and complete and utter ignorance.

Quote:
Also, this thread was specifically targeted at the Win32 API - something I've tried to avoid touching as much as possible, however the occasional brush with it has been inevitable and also unpleasant.


I'll grant that as being true, and for that, I shall apologize for the expression of those heinous, niche-minority OSS sentiments. However, I do object that going from the abstract to the concrete --- rather than the opposite direction --- is fundamentally beneficial to every programmer the world over; sure, it would expose him to a different model of the process he is attempting to tackle, but so would switching APIs at the current level of abstraction that he is programming in.

nodtveidt wrote:
Take what LeoDraco says with a grain of salt...the man is well-known to be an insane trombone player so you are forewarned. :) j/k of course...but seriously...that 'silly thing' is on the vast majority of user computers today, and you'd only be a GREAT fool to ignore such a staggering slap-in-the-face obvious detail.


Again, going along with closed source, proprietary, authoritarian dictates is beneficial how? I code in .NET (VB, even) for work, and while not the same as the exact problem domain presented here, it is fully and fundamentally the exact same breed of pigeon as is the underlying Win32 API: something that is (if one were to disregard that messy IEEE standard for .NET 2.0) proprietary and closed (from a design perspective) to everyone save those whom created it. Contrary to cooking, where multiple chefs spoil the soup, the field of programming is one which only increases its level of excellence as more people come into the design and development phase of a piece of software.

However, as you point out, the age-old maxim does apply: "you can tell a bigot, but you cannot tell him much;" a holy war here about, while surely a spark for forum activity, really would not accomplish much: the "GREAT fool"'s shall not be moved from what is --- to them --- absolute truth.
_________________
"...LeoDraco is a pompus git..." -- Mandrake
Back to top  
DrunkenCoder
Demon Hunter


Joined: 29 May 2002
Posts: 559

PostPosted: Fri Mar 03, 2006 12:04 pm    Post subject: [quote]

Im quite ready to file this under "PEBCAK" but exactly what part of SDL input handling is giving you a headache?

There's good samples on the SDL homepage and loads of tutorials, SDL is probably the easiest most clean way to quickly get basic input and rendering going, and it's crossplatform.
_________________
If there's life after death there is no death, if there's no death we never live. | ENTP
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Fri Mar 03, 2006 12:26 pm    Post subject: [quote]

LeoDraco wrote:
Again, going along with closed source, proprietary, authoritarian dictates is beneficial how?

*sigh* I wanted to avoid this, but seeing as how you just don't *get it*, I guess I have to explain.

First of all, you're looking at the issue from a commercial point of view. That's kinda silly. Closed source, proprietary, authoritarian...so? It's also widespread, standard, well-documented, and accessible. The OSS world knows very little of these key features. Widespread? Yeah right. And don't bother naming isolated examples (like Apache). Standard? HAHAHAHA! About the only "standard" the OSS world knows and whines about is C++ compliance. Well-documented? Dream on...I've yet to see a properly written man page. Accessible? Only if you know about it.

Just because something is open source doesn't mean you can do anything with it. Sure, it gives you the *right* to do it, but the common computer user doesn't care about that...they care about the application *working*. They also don't care if it's proprietary or not...if it runs on their system, who gives a damn...that's their mindset. And let's face it...the common user uses Windows, not Linux or any other potential contender. If you want to go big in the computer world, you *have* to know Windows...or be one lucky SOB like Linus (don't count on it).

But the same issues also apply to the programmer, not just the end user. If you know that 95% of your users are going to be Windows users, do you invest the extra time in making your app run on alternate operating systems? I can hear it now...all the zealots saying "But but but if you write portable code then you don't have to worry about it!!!!!!1111111oneoneone". Sure, sure...and you also take a performance hit with all the middleman kludges you have to use just to make your generic, vanilla code run more than one platform. Sorry but no thanks...if I had to make a cross-platform product, I'd not do what all the lazy fscks do, which is to use these middleman libraries...I'd go as low as possible on each platform to get the best performance possible. And that is why learning the Windows API is beneficial...maximum performance on a Windows system. And that is absolute truth.

I don't mean to start a war over this (frankly I'd like to avoid it, as it accomplishes nothing) but since you took the offensive, I've got no choice but to respond in kind.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
DrunkenCoder
Demon Hunter


Joined: 29 May 2002
Posts: 559

PostPosted: Fri Mar 03, 2006 1:27 pm    Post subject: [quote]

nodtveidt wrote:
LeoDraco wrote:
Again, going along with closed source, proprietary, authoritarian dictates is beneficial how?

*sigh* I wanted to avoid this, but seeing as how you just don't *get it*, I guess I have to explain.


While I admire the effort of OSS.
Here's a good case point I recently needed to find a bugtracking solution for the firm where I work some diffrent options rose up let's take only two of them the propirtary FogBugz: http://www.fogcreek.com/FogBugz/ and the free Bugzilla:http://www.bugzilla.org/

Just take a quick peek at those pages, on of them offers me an instant tour showing features and actually gives me information the other, well... You judge.

OSS is notorisously bad in actually showing what problems the product solve and how it eases my pains. Im sure there's tons of great software outthere but noone is going to tell me about it and frankly I don't have the resources to actually install and try every damn piece of "free" software to see if it closly resembles usable for my purpose.

For the record we went with bugzilla and all code I don't write for cash is mostly released under BSD/MIT like licenes.
_________________
If there's life after death there is no death, if there's no death we never live. | ENTP
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Fri Mar 03, 2006 3:29 pm    Post subject: [quote]

I had tried to explain the major caveat with OSS somewhere but I'm not quite sure where...the main thrust of the point though is that there is a particular mindset that seperates commercial from independant, and that's "product" versus "project". The vast majority of OSS apps are headed and worked on by people with project mentality. Basically, what you end up with is a work-in-progress that is never finished...missing features that are "planned" but never make it in (and then the project usually gets dropped halfway through), a subpar interface, missing or utterly crap documentation, etc etc etc. And all under the guise of "work in progress"...aka a license to be a lazy fuck. :) Product mentality is altogether different...the idea is there, goals are set ahead of time, the project is organized ahead of time, everything is in place before the work begins and then the work does not stop until the product is ready for deployment or distribution. "Work in progress" is something the consumer never sees...they only see the finished product with all its features and documentation completed. Patches are not considered "work in progress", they're simply updates for an already finished product.

The number of OSS developers with project mentality is staggering, and only a few have any sense of product mentality (the Mozilla foundation is the only OSS group I can think of that actually has product mentality). That is one of the major reasons why OSS software will always take a back seat to closed-source proprietary software.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
Post new topic Reply to topic Page 1 of 2 All times are GMT
Goto page 1, 2  Next 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum