Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: OIS and VC6  (Read 1727 times)

sphinkie

  • Guest
OIS and VC6
« on: December 23, 2005, 04:01:31 PM »

Hello

I am adding OIS to my project and I am using Visual C++ 6.0.

Should I compile the OIS library in a separate library, and generate a DLL file (or a LIB ?),  and build a workspace,

or should I include all the sources files in my project ?

thanks
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
OIS and VC6
« Reply #1 on: December 23, 2005, 04:21:42 PM »

You will be fine including all sources in your app. License wise and functionality wise... As, OIS is intended to mainly be used as a compiled in static lib any way :D There should be no crazy VC6 errors, as OIS does not use any wierd template constucts either.
Logged

sphinkie

  • Guest
OIS and VC6
« Reply #2 on: December 24, 2005, 07:49:37 AM »

Thanks,

in fact, when compiling the ogre example, I got :
Code: [Select]

ActionConfig.cpp
E:\SDK\OIS\demos\ogre\ActionMap.h(48) : error C2562: '()' : 'void' function returning a value
        E:\SDK\OIS\demos\ogre\ActionMap.h(48) : see declaration of '()'
        E:\SDK\OIS\demos\ogre\ActionMap.h(48) : while compiling class-template member function 'void __thiscall OIS::memberBind<class ActionConfig,void,class OIS::ActionMapArg const &>::operator ()(const class OIS::ActionMapArg &) const'
ActionMap.cpp
E:\SDK\OIS\demos\ogre\ActionMap.h(69) : error C2562: 'callMethod' : 'void' function returning a value
        E:\SDK\OIS\demos\ogre\ActionMap.h(69) : see declaration of 'callMethod'
        E:\SDK\OIS\demos\ogre\ActionMap.h(69) : while compiling class-template member function 'void __thiscall OIS::Binder<void,class OIS::ActionMapArg const &>::callMethod(const class OIS::ActionMapArg &) const'
gui.cpp
Error executing cl.exe.
Logged

sphinkie

  • Guest
OIS and VC6
« Reply #3 on: December 24, 2005, 07:59:54 AM »

and (sorry), but I dont know enough to see the problem in :

Code: [Select]

returnT callMethod(Args args) const { return (*mObject)(args); }

or :
virtual returnT operator()(Args args) const {return (mObject->*mFunction)(args);}

Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
OIS and VC6
« Reply #4 on: December 25, 2005, 09:35:27 PM »

Sorry, I do not have a copy of VC6 laying around so I can not find a work around. However, that demo is not needed for you to use OIS. In fact, you can just remove ll that Action Config stuff from the demo and just look at how OIS is used and initialised in the demo.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
OIS and VC6
« Reply #5 on: December 26, 2005, 12:45:56 PM »

I just looked a little closer.. A quick fix you can make to get rid of that error is change:

typedef Binder<void, const ActionMapArg&> ActionBind;
to
typedef Binder<bool, const ActionMapArg&> ActionBind;

in ActionMap.h. And change all the callback method to return a bool value to. Or, edit the template classes in ActionMap.h to not return the returnT types (use void instead) and not to return any values. The error is caused because (apparently VC6 does not like) returning values when the type is supposed to be void return.
Logged

sphinkie

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
    • http://mapage.noos.fr/sphinx-games/index.html
OIS and VC6
« Reply #6 on: December 27, 2005, 01:47:16 PM »

Thanks.
I have implemented a boolean return value for handleJump, handleLook, handleMove, etc, and the compilation is now OK.

Code: [Select]

bool ActionConfig::handleJump( const OIS::ActionMapArg& arg )
{
   //do Fire
   return true;
}


(now I have some linking pb, but I'll try to fix them by myself before asking for help...) :wink:

//--------------------------------------------------------------------------------//
 On another hand, I have implemented the OIS files in my project (without using a binder), and I have got a good result in a short time  (joystick input) .
Thanks for your library!
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
OIS and VC6
« Reply #7 on: December 27, 2005, 04:38:23 PM »

Yeah, you really do not need the binder stuff unless you want to implement the Action Mapping stuff of the demo (though, I highly recommend using some sort of Action mapping.. as, there are many different joystick and keyboard layouts that allowing your user the option of configuring the actions themselves is so nice :D ).

Glad you got it working to btw :D
Logged