Cross-platform input handling api options?

Started by
9 comments, last by trexmaster78 16 years, 9 months ago
hi, Basically the jist is: I'm doing a school project, can't release the source code, the school is privately owned and therefore a for-profit business and therefore lots of free licenses otherwise available to me are now not. Project is using opengl, fmod, and i need to handle input on multiple platforms (linux & windows). i'd be ok with using windows' messaging system for handling input there, but i have no idea what to do with linux. My teacher already said no to SDL, but i think this is because she doesnt actually know much/anything about programming (e.g. what an api is) so i need some other options... I could also handle some native input handling stuff for linux/x11 and just programming 2 input handlers based on platform, but i dont know if that's possible with an opengl app? I've also heard GLUT can handle input... but that glut is kind of frowned upon? not sure why that is, but does it still hold true if it's only use is input handling? anyways, as is probably apparent i have no previous experience in the matter aside from sdl, so the more options the better. thanks
Advertisement
Well it would be wise to explain to your teacher that SDL is the only option.... Well Allegro might be. But if not, SDL. The wisdom is that SDL is an API just like OGL and FMOD. So if she has no problem with those two then she can without worry use SDL. Plus they integrate pretty painlessly.

Beginner in Game Development?  Read here. And read here.

 

Quote:
Basically the jist is: I'm doing a school project, can't release the source code, the school is privately owned and therefore a for-profit business and therefore lots of free licenses otherwise available to me are now not.

Would that not imply that Fmod is out aswell?
Quote:# Yes that's right, if your product is not intended to make any money, and is not charged for in any way, then you may use FMOD in it for FREE!
# Many people use it for free until their commercial product is about to be published. This is a great way to evaluate FMOD and see if it suits your needs without any obligations.
# If you want to use it in a commercial product, then please see below for pricing and conditions.


Quote:My teacher already said no to SDL..

Maybe you should tell you teacher they are a fool, although I do not think this will go down so well :) Ask them for the reasons why SDL can not be used and then tell them they are wrong.
Quote:Original post by c0uchm0nster
Basically the jist is: I'm doing a school project, can't release the source code, the school is privately owned and therefore a for-profit business and therefore lots of free licenses otherwise available to me are now not.

Say what? No popular open source licenses prohibit you from using them at a "for-profit business". Unless your school is planning on selling your game, there's no problem with you using OSS.
Thanks for the replies, although that's kind of what I was afraid of. The reason fmod is allowed is because the school bought a license... the reason (at least the one I was given) we can't use anything else (specifically sdl) is that
Quote:No other APIs should be used - the point is for you to learn how to code these things yourselves


I'm kind of wary about starting an argument about the rules of the class before the semester even starts with this new teacher. I'm also worried that her response will just be don't make it cross platform. Perhaps if I had some examples that SDL (or other directinput alternatives) are used in the market (like for the UT series, or id games) that would convince her, unfortunately I don't know how to get info on stuff like this (without scouring through the q3 source code).

Anyways, if anyone else has some suggestions or anything they think would be helpful I'd greatly appreciate it.

edit - in response to sneftel, I was under the impression that there are situations where oss licenses require you to make your source available upon request, something which I'm also not allowed to do (it's a pretty crappy situation)... I know stuff licensed under the LGPL doesn't require this but i guess i just explained the situation unclearly, thanks for pointing that out.
Basically all that you have to do to use an LGPL-licensed library is to run-time link to the library so that users may replace it with future versions if they want to (yeah right, like end users know how to, let alone care!).

If you want a list of applications that use SDL, well, SDL's website does have such a list. But it's long and most of the programs are Joe-Schmoe games. But SDL's front page also says, "It is used by MPEG playback software, emulators, and many popular games, including the award winning Linux port of "Civilization: Call To Power." "
X11 isn't that difficult to do...in fact, your example of using the q3 code works perfectly - it uses the Win32 API on Windows and X11 on Linux, so you can see the overlap as they both implement the same API to the engine. The NeHe basecode (both old and the new c++) could also be a useful resource.


Having to implement both will also give you an appreciation for why SDL is often a better option. If you have lots of time, perhaps you can implement X11, Win32, and SDL and compare the relative code sizes to prove your point. [wink]
Quote:Original post by c0uchm0nster
Quote:No other APIs should be used - the point is for you to learn how to code these things yourselves


Just out of curiosity, do you have a list of "authorized" APIs ? Just curious to see if this is plainly teacher stupidity or stuborness...

The list of "authorized" api's i was given was directx, opengl, and fmod... directx was also described as a graphics library so i'm pretty sure it's not stuborness. however to be fair i also wouldnt call my teacher stupid, so much as ignorant - as she's not a game developer.

unfortunately i'm having trouble figuring out how to do input with x11 and it's next to impossible to google for so i may have to just use directinput or windows message handling and Wine it... or i could just make input handling for windows and sdl for linux and keep the sdl build separate / not turn it in, but that'd be unfortunate
Well, there is OIS which basically is X11 event handling under Linux. It works on Windows and Mac OSX. The license is extremely liberal being zlib/libpng. So, you could take source code from it and do what you want, only requirement is that you keep the copyright information in the source code, and modified versions are clearly marked as such. Or, you could just use it as an example of a clean way to handle X11 messages in your own app ;-)

Here

This topic is closed to new replies.

Advertisement