Wrecked Games
September 05, 2010, 04:08:41 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: We're just that awesome.
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: Netbeans project for OIS  (Read 341 times)
Jay
Newbie
*
Posts: 4


View Profile
« on: April 12, 2010, 09:34:34 AM »

Good afternoon,

I'm in the process of building OIS in the Netbeans IDE. I was considering setting it up so the code for all the Operating systems was included in the one project. Since the IDE doesn't support including different code based on settings that means I'll have to wrap all the operating system specific code with something like:
 #ifdef OIS_WIN32_PLATFORM
etc.

Then you just choose your toolset and target and compile.

I'll also be testing it with my 64 bit Ubuntu Linux.

Is anyone interested in seeing this when it's done?
Logged
Jay
Newbie
*
Posts: 4


View Profile
« Reply #1 on: April 12, 2010, 11:12:37 AM »


I see that the windows code uses the directinput library. Out of curiosity why was that done? Wouldn't it be simpler (and much smaller) to get the mouse messages passed from windows?
 http://msdn.microsoft.com/en-us/library/ms645616%28VS.85%29.aspx

p.s.

I have the ois console running under windows (built entirely with mingw/gcc in the netbeans ide).
Logged
pjcast
Administrator
Veteran
*****
Posts: 2544



View Profile WWW
« Reply #2 on: April 13, 2010, 07:28:44 AM »

I wonder if the cmake patch floating around can generate netbeans project files automatically.

As for why not using Windows API directly. For one, it would mean stealing the winproc from the app, which may steal it back. Though, I've come across some hook procedures that could listen to messages without having to rely on subclassing a window. In regards to its simplicity, I can't say as I haven't worked on trying that yet. Though, the DirectInput version for mouse/keyboard is not all that difficult.

DirectInput for joysticks will always stick around. Though, XInput will be added for newer controllers as well.
Logged
Jay
Newbie
*
Posts: 4


View Profile
« Reply #3 on: April 13, 2010, 07:50:05 AM »

I wonder if the cmake patch floating around can generate netbeans project files automatically.

The project files were pretty trivial to create. I've finished the changes for windows and linux and tested the windows version. I don't have a mac to try them on but I supposed I could set up a vm and try it or borrow one from a friend.


As for why not using Windows API directly. For one, it would mean stealing the winproc from the app, which may steal it back. Though, I've come across some hook procedures that could listen to messages without having to rely on subclassing a window. In regards to its simplicity, I can't say as I haven't worked on trying that yet. Though, the DirectInput version for mouse/keyboard is not all that difficult.

DirectInput for joysticks will always stick around. Though, XInput will be added for newer controllers as well.

Thanks. I don't think hooking it would be difficult. I'm not sure if there's any way to do anything with all the extra buttons some controllers have though. I don't know if they have drivers that generate windows messages for new buttons or if they only work with directinput and just appear like a legacy device otherwise.

p.s.

Thanks for sharing OIS


Logged
pjcast
Administrator
Veteran
*****
Posts: 2544



View Profile WWW
« Reply #4 on: April 13, 2010, 05:15:32 PM »

XInput will only work with XInput devices & drivers. Also, joystick drivers will not generate window messages. Hence, DirectInput will continue to exist for a long time for the majority of joysticks out there.

Just hope that it's of use Smiley
Logged
Jay
Newbie
*
Posts: 4


View Profile
« Reply #5 on: April 14, 2010, 07:06:04 AM »

Yes, that was exactly what I needed. It would be nice to cut out a dependency but not at the cost of functionality that I need.

I'll package up the ois code and netbeans project for linux and windows and post it somewhere downloadable.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!