Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Python wrapper for OIS!  (Read 3447 times)

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« on: December 07, 2005, 05:00:34 PM »

Not sure how many people read the front page headlines.. so, in case you missed it:

http://www.wreckedgames.com/Developers/39/pythonwrapper-for-ois
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #1 on: February 17, 2006, 10:56:23 AM »

Just want to post that the Python wrapper is compatiable with OIS 0.4.0 - though, there is an odd unresolved extranl for OIS_INFINITE.

The only major changes in Cvs is the removal of lookUpCharMapping and the other methods relating to setting the mapping. Instead, use the text member of keyEvent to get at the character.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #2 on: February 17, 2006, 02:50:16 PM »

Wow, I must congratulate cyberloon on a well done job on the python wrapper. i just (and I am a first time swig and python user) followed his readme file in the oisaddons/python module and had pyOIS up and running in a couple of hours. I had to install Swig, Python, and wxPython. I also had to edit the project files (as i have VC7.0 and they are 7.1, just had to change the XMl version from 8 to 7 and 7.1 to 7.0).

It was pretty easy building the wrapper after following the instructions (and setting Swig to my PATH). i ran across an issue or two that I fixed relatively simply. And, if anyone tries and has issues, just post here and I can walk you through it. I even built against Cvs head and it worked like a champ.
Logged

folkrock

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Python wrapper for OIS!
« Reply #3 on: April 01, 2006, 02:33:29 PM »

Has anyone had any luck compiling under ms vs 8. I get an error that it can't open libs.obj and i believe that it's looking for it in the Python24 directory. This is my first time working with ms vs 8 and I really could care less what I use to compile. If anyone knows an easy alternative, please let me know.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #4 on: April 01, 2006, 02:55:52 PM »

You will have to post specifically the error output. I don't know what libs.obj would be coming from. Is this error building OIS under VC8? Or the wrapper?
Logged

folkrock

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Python wrapper for OIS!
« Reply #5 on: April 01, 2006, 06:05:48 PM »

Sorry, I'm actually at work right now. The libs.obj error comes up when compiling the python wrapper. I'll get the error message when I get home tonight.
Logged

folkrock

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Python wrapper for OIS!
« Reply #6 on: April 01, 2006, 10:25:08 PM »

LINK : fatal error LNK1181: cannot open input file 'C:\Python24\libs.obj' ... sorry if this is an obvious oversight, it's been about a year from that last time I wrote anything.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #7 on: April 02, 2006, 09:00:39 AM »

Perhaps you need to add the python directory to your path? As in, I believe that is how you set it up anyway. You could also add the python lib's directory to your IDE's directories.
Logged

folkrock

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Python wrapper for OIS!
« Reply #8 on: April 02, 2006, 11:45:30 AM »

Maybe not that obvious :) . I have tried compiling with every variation of Python24/include, Python24/libs and Python24/Lib in their respective locations under Tools->Options->Projects...->VC++ Directories, even though the later doesn't contain any .lib files... but I tried it anyway. I've also have these enviroment variables setup.

OIS_PATH = C:\sourceforge\wgois\ois
PYTHON_INCLUDE = C:\Python24\include
PYTHON_LIB = C:\Python24\libs

There were a bunch of warning that came up during the conversion of the project from VC7 to VC8 eluding to the fact that code may have to be edited for it to compile under VC8. So I feel like it's time to leave good old MS VS behind and start using gcc/cygwin instead.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #9 on: April 02, 2006, 12:05:25 PM »

Well, I am reinstalling my OS here.. And, will try to compile the wrapper under VC8 soon. Although, I don't think any of the warnings about changin code (probably the depreciated warnings ? that MS tries to tie you to their nonstandard code).

Anyway, I wll attempt to give it a try in the next couple of days.
Logged

Biggles

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Python wrapper for OIS!
« Reply #10 on: June 11, 2006, 01:10:29 AM »

Any chance of someone distributing a precompiled version of this?  I'm still not too hot working with all the C++ stuff, but this sounds like an excellent library!

Sorry if this has been asked already.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #11 on: June 11, 2006, 09:00:21 AM »

I have had plans to distribute some binary versions of this. Though, I havn't been able to get around to it. If you could post a feature request on the OIS sourceforge tracker, so I dont forget about it (again).. and, perhaps you could e-mail the author of the bindigns, maybe he would be willing to distribute the binary ones (or email me them so I could upload them here).. He doesn't visit these forums from what I know.

Anyway, the best place for something like this is the feature request tracker, so it doesn't get burried in the forums :)
Logged

Biggles

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Python wrapper for OIS!
« Reply #12 on: July 18, 2006, 05:03:07 AM »

Hey, so is there now an precompiled binary available?  I noticed on the sourceforge page the feature request for it is now closed...  

Currently getting my head around pygame's systems, but would prefer not to have to!

Thanks in advance for any help!
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #13 on: July 18, 2006, 08:08:11 AM »

Yes, check the File's section on Sourceforge project page (or my Wiki on OIS) - and look at the Win32 OIS SDK download, you will find it (and a simple wxPython demo) there. There is no precompiled release for Linux (or other platforms) atm, as there is no build script for other platforms.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Python wrapper for OIS!
« Reply #14 on: July 18, 2006, 08:30:40 AM »

Quote from: "folkrock"
Maybe not that obvious :) . I have tried compiling with every variation of Python24/include, Python24/libs and Python24/Lib in their respective locations under Tools->Options->Projects...->VC++ Directories, even though the later doesn't contain any .lib files... but I tried it anyway. I've also have these enviroment variables setup.

OIS_PATH = C:\sourceforge\wgois\ois
PYTHON_INCLUDE = C:\Python24\include
PYTHON_LIB = C:\Python24\libs

There were a bunch of warning that came up during the conversion of the project from VC7 to VC8 eluding to the fact that code may have to be edited for it to compile under VC8. So I feel like it's time to leave good old MS VS behind and start using gcc/cygwin instead.


Just for future reference, this error is caused by setting the PYTHON_LIB wrong. I too first did as you, then I realized what it really should be set as:
PYTHIN_LIB=C:\Python2\libs\python24.lib

Notice, it should point directly to the python lib, not just the directory.

Now, if someone on Linux has time, I would love a patch for a Linux build system. However, if no one steps up, I might be inclined sometime down the road to do this, when I have time.
Logged