OISB (new input binding/mapping library!)

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

I'm working on it again...

I updated my copy of OISB from your mercurial repository. You missed some necessary fixes:

Code: Select all

diff -r bf2af303811d -r a8036d384b1b include/OISBPropertySet.h
--- a/include/OISBPropertySet.h	Sun Mar 06 12:58:37 2011 +0100
+++ b/include/OISBPropertySet.h	Sun Mar 06 18:05:10 2011 +0200
@@ -57,9 +57,9 @@
              * @brief gets property of given name and the result is returned as given type
              */
             template<typename T>
-            inline typename T getProperty(const String& name) const
+            inline T getProperty(const String& name) const
             {
-                return fromString<typename T>(impl_getProperty(name));
+                return fromString<T>(impl_getProperty(name));
             }

             // stub method, compiler will pick this up if possible (it has priority over the templated variant)
diff -r bf2af303811d -r a8036d384b1b src/OISBAnalogAxisState.cpp
--- a/src/OISBAnalogAxisState.cpp	Sun Mar 06 12:58:37 2011 +0100
+++ b/src/OISBAnalogAxisState.cpp	Sun Mar 06 18:05:10 2011 +0200
@@ -23,6 +23,9 @@

 #include "OISBAnalogAxisState.h"

+#include <cmath>
+#include <limits>
+
 namespace OISB
 {
 	AnalogAxisState::AnalogAxisState(Device* parent, const String& name):
diff -r bf2af303811d -r a8036d384b1b src/OISBSystem.cpp
--- a/src/OISBSystem.cpp	Sun Mar 06 12:58:37 2011 +0100
+++ b/src/OISBSystem.cpp	Sun Mar 06 18:05:10 2011 +0200
@@ -24,7 +24,7 @@
 #include "OISBSystem.h"
 #include "OISBMouse.h"
 #include "OISBKeyboard.h"
-#include "OISBJoystick.h"
+#include "OISBJoyStick.h"
 #include "OISBActionSchema.h"
 #include "OISBAction.h"
 #include "OISBState.h"
@@ -42,6 +42,7 @@
 #include <strstream>
 #include <fstream>
 #include <iostream>
+#include <cstring>

 using namespace rapidxml;
All of the changes in that patch are necessary - without them the build will fail.



Also, the header file strstream is deprecated and we should use sstream.




And here are the 'simple' demo error messages:
oisb/demos/simple/OISBConsole.cpp: In function ‘void doStartup()’:
oisb/demos/simple/OISBConsole.cpp:269: warning: cannot pass objects of non-POD type ‘struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >’ through ‘...’; call will abort at runtime
oisb/demos/simple/OISBConsole.cpp: In function ‘void checkX11Events()’:
oisb/demos/simple/OISBConsole.cpp:296: error: ‘g_m’ was not declared in this scope
oisb/demos/simple/OISBConsole.cpp:298: error: expected initializer before ‘&’ token
oisb/demos/simple/OISBConsole.cpp:299: error: ‘ms’ was not declared in this scope
I didn't try to fix any of those - I just disabled it in the cmake file for now.
Last edited by reptor on Sun Mar 06, 2011 5:45 pm, edited 2 times in total.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: OISB (new input binding/mapping library!)

Post by jacmoe »

/* changed highlighting of diff from 'cpp' to 'diff'.. */
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

:) I was editing the post so your edit disappeared! But I changed it to 'diff'. That's nice.

By the way, I would have wanted to use "hg export tip" instead of "hg diff" but by using it there were so many changes to irrelevant sections of the files in the generated patch and the "hg export" command didn't seem to have the same "ignore white space changes" functionality that the "hg diff" command has. Annoying... the export command should also have an option to ignore changed line endings etc. Or is there a way to do it?

Are there mixed Windows and Unix line endings in the source files of OISB? Edit: In fact I have "remove trailing spaces" enabled in the editor I used. That could have caused it as well.
Last edited by reptor on Sun Mar 06, 2011 6:52 pm, edited 2 times in total.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: OISB (new input binding/mapping library!)

Post by tdev »

reptor wrote: And here are the 'simple' demo error messages:
oisb/demos/simple/OISBConsole.cpp: In function ‘void doStartup()’:
oisb/demos/simple/OISBConsole.cpp:269: warning: cannot pass objects of non-POD type ‘struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >’ through ‘...’; call will abort at runtime
oisb/demos/simple/OISBConsole.cpp: In function ‘void checkX11Events()’:
oisb/demos/simple/OISBConsole.cpp:296: error: ‘g_m’ was not declared in this scope
oisb/demos/simple/OISBConsole.cpp:298: error: expected initializer before ‘&’ token
oisb/demos/simple/OISBConsole.cpp:299: error: ‘ms’ was not declared in this scope
I didn't try to fix any of those - I just disabled it in the cmake file for now.
will try to fix the demo under linux this week :)
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

Great!



Edit: Some more information about the "Action schema 'Keyboard' not found" problem.

Code: Select all

Dumping all registered OISB devices:
** Device: 'Keyboard'
** - State: 0
** - State: 1
** - State: 2
** - State: 3
** - State: 4
** - State: 5
** - State: 6
** - State: 7
** - State: 8
** - State: 9
** - State: Alt_L
** - State: Alt_R
** - State: BackSpace
** - State: Caps_Lock
** - State: Control_L
** - State: Control_R
** - State: Delete
** - State: Down
** - State: End
** - State: Escape
** - State: F1
** - State: F10
** - State: F11
** - State: F12
** - State: F13
** - State: F14
** - State: F15
** - State: F2
** - State: F3
** - State: F4
** - State: F5
** - State: F6
** - State: F7
** - State: F8
** - State: F9
** - State: Home
** - State: Insert
** - State: KP_Add
** - State: KP_Begin
** - State: KP_Delete
** - State: KP_Divide
** - State: KP_Down
** - State: KP_End
** - State: KP_Enter
** - State: KP_Equal
** - State: KP_Home
** - State: KP_Insert
** - State: KP_Left
** - State: KP_Multiply
** - State: KP_Next
** - State: KP_Prior
** - State: KP_Right
** - State: KP_Subtract
** - State: KP_Up
** - State: Left
** - State: Menu
** - State: Next
** - State: Num_Lock
** - State: Pause
** - State: Print
** - State: Prior
** - State: Return
** - State: Right
** - State: Scroll_Lock
** - State: Shift_L
** - State: Shift_R
** - State: Super_L
** - State: Super_R
** - State: Tab
** - State: Unknown
** - State: Unknown (103)
** - State: Unknown (104)
** - State: Unknown (105)
** - State: Unknown (106)
** - State: Unknown (107)
** - State: Unknown (108)
** - State: Unknown (109)
** - State: Unknown (110)
** - State: Unknown (111)
** - State: Unknown (112)
** - State: Unknown (113)
** - State: Unknown (114)
** - State: Unknown (115)
** - State: Unknown (116)
** - State: Unknown (117)
** - State: Unknown (118)
** - State: Unknown (119)
** - State: Unknown (120)
** - State: Unknown (121)
** - State: Unknown (122)
** - State: Unknown (123)
** - State: Unknown (124)
** - State: Unknown (125)
** - State: Unknown (126)
** - State: Unknown (127)
** - State: Unknown (128)
** - State: Unknown (129)
** - State: Unknown (130)
** - State: Unknown (131)
** - State: Unknown (132)
** - State: Unknown (133)
** - State: Unknown (134)
** - State: Unknown (135)
** - State: Unknown (136)
** - State: Unknown (137)
** - State: Unknown (138)
** - State: Unknown (139)
** - State: Unknown (140)
** - State: Unknown (142)
** - State: Unknown (143)
** - State: Unknown (144)
** - State: Unknown (145)
** - State: Unknown (147)
** - State: Unknown (148)
** - State: Unknown (149)
** - State: Unknown (150)
** - State: Unknown (151)
** - State: Unknown (152)
** - State: Unknown (153)
** - State: Unknown (154)
** - State: Unknown (155)
** - State: Unknown (158)
** - State: Unknown (159)
** - State: Unknown (160)
** - State: Unknown (161)
** - State: Unknown (162)
** - State: Unknown (163)
** - State: Unknown (164)
** - State: Unknown (165)
** - State: Unknown (166)
** - State: Unknown (167)
** - State: Unknown (168)
** - State: Unknown (169)
** - State: Unknown (170)
** - State: Unknown (171)
** - State: Unknown (172)
** - State: Unknown (173)
** - State: Unknown (174)
** - State: Unknown (175)
** - State: Unknown (176)
** - State: Unknown (177)
** - State: Unknown (178)
** - State: Unknown (179)
** - State: Unknown (180)
** - State: Unknown (182)
** - State: Unknown (185)
** - State: Unknown (186)
** - State: Unknown (187)
** - State: Unknown (188)
** - State: Unknown (189)
** - State: Unknown (190)
** - State: Unknown (191)
** - State: Unknown (192)
** - State: Unknown (193)
** - State: Unknown (194)
** - State: Unknown (195)
** - State: Unknown (196)
** - State: Unknown (198)
** - State: Unknown (202)
** - State: Unknown (204)
** - State: Unknown (206)
** - State: Unknown (212)
** - State: Unknown (213)
** - State: Unknown (214)
** - State: Unknown (215)
** - State: Unknown (216)
** - State: Unknown (217)
** - State: Unknown (218)
** - State: Unknown (222)
** - State: Unknown (223)
** - State: Unknown (224)
** - State: Unknown (225)
** - State: Unknown (226)
** - State: Unknown (227)
** - State: Unknown (228)
** - State: Unknown (229)
** - State: Unknown (230)
** - State: Unknown (231)
** - State: Unknown (232)
** - State: Unknown (233)
** - State: Unknown (234)
** - State: Unknown (235)
** - State: Unknown (236)
** - State: Unknown (237)
** - State: Unknown (238)
** - State: Unknown (239)
** - State: Unknown (240)
** - State: Unknown (241)
** - State: Unknown (242)
** - State: Unknown (243)
** - State: Unknown (244)
** - State: Unknown (245)
** - State: Unknown (246)
** - State: Unknown (247)
** - State: Unknown (248)
** - State: Unknown (249)
** - State: Unknown (250)
** - State: Unknown (251)
** - State: Unknown (252)
** - State: Unknown (253)
** - State: Unknown (254)
** - State: Unknown (255)
** - State: Unknown (84)
** - State: Unknown (85)
** - State: Unknown (86)
** - State: Unknown (89)
** - State: Unknown (90)
** - State: Unknown (91)
** - State: Unknown (92)
** - State: Unknown (93)
** - State: Unknown (94)
** - State: Unknown (95)
** - State: Unknown (96)
** - State: Unknown (97)
** - State: Unknown (98)
** - State: Unknown (99)
** - State: Up
** - State: a
** - State: apostrophe
** - State: b
** - State: backslash
** - State: bracketleft
** - State: bracketright
** - State: c
** - State: colon
** - State: comma
** - State: d
** - State: e
** - State: equal
** - State: f
** - State: g
** - State: grave
** - State: h
** - State: i
** - State: j
** - State: k
** - State: l
** - State: m
** - State: minus
** - State: n
** - State: o
** - State: p
** - State: period
** - State: q
** - State: r
** - State: s
** - State: semicolon
** - State: slash
** - State: space
** - State: t
** - State: u
** - State: v
** - State: w
** - State: x
** - State: y
** - State: z
** End of device 'Keyboard'
** Device: 'Mouse'
** - State: Button 3
** - State: Button 4
** - State: Button 5
** - State: Button 6
** - State: Button 7
** - State: Left Button
** - State: Middle Button
** - State: Right Button
** - State: Wheel
** - State: X Axis
** - State: Y Axis
** End of device 'Mouse'
End of dump!
Dumping all registered OISB action schemas:
End of dump!

The initialisation code, initializeOISB(), was taken directly from the OISB 'ogre' demo. And so was the defineActions() function. So if it works for you then I don't think I have made a mistake in either one of those functions.

initializeOISB() function:

Code: Select all

void Graphics::initializeOISB()
{   
    // initialize OIS and OISB

    // Setup basic variables
    OIS::ParamList paramList;
    size_t windowHnd = 0;
    std::ostringstream windowHndStr;

    // Get window handle
    mWindow->getCustomAttribute("WINDOW", &windowHnd);

    // Fill parameter list
    windowHndStr << (unsigned int) windowHnd;
    paramList.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));

    // Create inputsystem
    new OISB::System();
    OISB::System::getSingleton().initialize(
        OIS::InputManager::createInputSystem(paramList));

    OISB::System::getSingleton().dumpDevices();
    OISB::System::getSingleton().dumpActionSchemas();

    defineActions();

    OISB::System::getSingleton().dumpActionSchemas();
}
you can see from that where I call dumpDevices() and also dumpActionSchemas(). Naturally there are no schemas as the defineActions() function is yet to be called at that point. But you can see that there is a device 'Keyboard'.


In defineActions(), when this code is called:

Code: Select all

void Graphics::defineActions() {

    mDefaultSchema = OISB::System::getSingleton().getDefaultActionSchemaAutoCreate();
    mExitAction = mDefaultSchema->createAction(OISB::AT_TRIGGER, "Exit");

    mExitAction->bind("Keyboard/Esc");   // <--- exception here!

    // snip - the rest of the function is the same as in demo and is irrelevant to the problem.

the "Action schema 'Keyboard' not found" exception is thrown at line "mExitAction->bind("Keyboard/Esc"); ".

So when the first 'bind' to 'Keyboard' is trying to be made, the exception happens. This is with the latest version (excluding revision 14!) of OISB from your mercurial repository plus with the changes in my previous post today.
Last edited by reptor on Sun Mar 06, 2011 10:06 pm, edited 1 time in total.
User avatar
kulik
Gremlin
Posts: 183
Joined: Sun May 01, 2005 2:00 pm
x 23

Re: OISB (new input binding/mapping library!)

Post by kulik »

:oops: Sorry for the inconvenience. Hopefully I've gotten it right this time :)
mpreisler on IRC | CEGUI team member, CEGUI Unified Editor developer, OISB founder
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

See my previous post, I added more information about the problem I am having.


I just got the latest copy from your repository and guess what, you left these out:

#include <cmath>
#include <limits>


from OISBAnalogAxisState.cpp :)



Edit:

I just tested a new build with revision 14 of OISB with the two includes inserted into OISBAnalogAxisState.cpp, and I get the same exception "Action schema 'Keyboard' not found".

Can you confirm that the OISB 'ogre' demo actually works? Because I took the code pretty much unmodified out of it. That doesn't mean it's not my project wrong though, but I really can't see how I could have caused this problem as my project has very little OISB-related code and I only really modified it regarding 'run' and I edited out the CEGUI-related code but I can't see those being a problem and the execution doesn't reach those places at all. I will probably build the OISB 'ogre' demo as the next step in trying to figure this problem out.

I'll take another look at this some time but for today I have to stop.
Last edited by reptor on Sun Mar 06, 2011 10:27 pm, edited 1 time in total.
User avatar
kulik
Gremlin
Posts: 183
Joined: Sun May 01, 2005 2:00 pm
x 23

Re: OISB (new input binding/mapping library!)

Post by kulik »

Your escape state is called "Keyboard/Escape", not "Keyboard/Esc". If you use "Keyboard/Escape" as the bindable name, it should look it up no problem. However I think we should be more robust when dealing with these situations and I have to figure out a way to standardise names of states (Esc and Escape are clearly different between Windows and Linux). Perhaps I will manually create a table of strings to solve this instead of relying on the OS to tell me the name.

Furthermore I have discovered a bug regarding this that I fixed in the last push.

Boy, do I suck at reading :lol: The two headers are in the cpp file now.
mpreisler on IRC | CEGUI team member, CEGUI Unified Editor developer, OISB founder
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

Aha! So it's something very simple. I'll try that right away. Well there it is right in the list... Escape, not Esc :D

Yeah, the names are a problem obviously if they are not the same across platforms! Well at least that should be easy to fix.

It also looks like 'Ctrl' won't work either as I have 'Control_L' and 'Control_R'...

I hope the names don't change when going between keyboard layouts. That would be a huge problem.



Edit: It doesn't recognise the upper case characters Q, A, D and so on either. I changed all of them to lower-case and now it works. I got my program to run now and I can control the camera. Woo! Nice. The view is shaking a bit though.

Thanks!

I'll stop for the day.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: OISB (new input binding/mapping library!)

Post by tdev »

just merged some linux compilation fixes, tested under latest Gentoo. At least the demo compiles now, worked on console, thus was unable to test it properly ;)

http://code.google.com/p/oisb/source/de ... 4572164fc2#
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

It's not working for me...

Code: Select all

-snip-

Linking CXX static library liboisb.a
[ 94%] Built target oisb
Scanning dependencies of target oisb_console
[100%] Building CXX object CMakeFiles/oisb_console.dir/demos/simple/OISBConsole.o
Linking CXX executable oisb_console
CMakeFiles/oisb_console.dir/demos/simple/OISBConsole.o: In function `checkX11Events()':
OISBConsole.cpp:(.text+0x59): undefined reference to `XPending'
OISBConsole.cpp:(.text+0x75): undefined reference to `XNextEvent'
CMakeFiles/oisb_console.dir/demos/simple/OISBConsole.o: In function `doStartup()':
OISBConsole.cpp:(.text+0x211): undefined reference to `XOpenDisplay'
OISBConsole.cpp:(.text+0x286): undefined reference to `XCreateSimpleWindow'
OISBConsole.cpp:(.text+0x2a8): undefined reference to `XMapWindow'
OISBConsole.cpp:(.text+0x2cc): undefined reference to `XSelectInput'
OISBConsole.cpp:(.text+0x2f3): undefined reference to `XNextEvent'
CMakeFiles/oisb_console.dir/demos/simple/OISBConsole.o: In function `main':
OISBConsole.cpp:(.text+0x1ab6): undefined reference to `XDestroyWindow'
OISBConsole.cpp:(.text+0x1ac3): undefined reference to `XCloseDisplay'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::_initialize()':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:196: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:201: undefined reference to `XOpenDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:205: undefined reference to `XSelectInput'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:209: undefined reference to `XGrabKeyboard'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::capture()':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:284: undefined reference to `XPending'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:286: undefined reference to `XNextEvent'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::_isKeyRepeat(_XEvent&)':
/home/vader/programming/libs/ois/ois/trunk/src/../includes/linux/LinuxKeyboard.h:64: undefined reference to `XPending'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::capture()':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:326: undefined reference to `XLookupString'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:306: undefined reference to `XLookupString'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:295: undefined reference to `XLookupString'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:351: undefined reference to `XGrabKeyboard'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::_isKeyRepeat(_XEvent&)':
/home/vader/programming/libs/ois/ois/trunk/src/../includes/linux/LinuxKeyboard.h:68: undefined reference to `XPeekEvent'
/home/vader/programming/libs/ois/ois/trunk/src/../includes/linux/LinuxKeyboard.h:71: undefined reference to `XNextEvent'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::capture()':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:341: undefined reference to `XUngrabKeyboard'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `OIS::LinuxKeyboard::getAsString(OIS::KeyCode)':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:417: undefined reference to `XKeysymToString'
/usr/local/lib/libOIS.a(LinuxKeyboard.o): In function `~LinuxKeyboard':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:222: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:220: undefined reference to `XUngrabKeyboard'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:222: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:220: undefined reference to `XUngrabKeyboard'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:222: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxKeyboard.cpp:220: undefined reference to `XUngrabKeyboard'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `OIS::LinuxMouse::hide(bool)':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:269: undefined reference to `XDefineCursor'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `OIS::LinuxMouse::grab(bool)':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:260: undefined reference to `XGrabPointer'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `OIS::LinuxMouse::_processXEvents()':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:160: undefined reference to `XPending'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:162: undefined reference to `XNextEvent'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:160: undefined reference to `XPending'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:208: undefined reference to `XWarpPointer'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `OIS::LinuxMouse::_initialize()':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:56: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:61: undefined reference to `XOpenDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:65: undefined reference to `XSelectInput'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:69: undefined reference to `XWarpPointer'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:78: undefined reference to `XAllocNamedColor'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:79: undefined reference to `XCreateBitmapFromData'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:80: undefined reference to `XCreatePixmapCursor'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `~LinuxMouse':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:95: undefined reference to `XFreeCursor'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:96: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:95: undefined reference to `XFreeCursor'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:96: undefined reference to `XCloseDisplay'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:95: undefined reference to `XFreeCursor'
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:96: undefined reference to `XCloseDisplay'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `OIS::LinuxMouse::hide(bool)':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:271: undefined reference to `XUndefineCursor'
/usr/local/lib/libOIS.a(LinuxMouse.o): In function `OIS::LinuxMouse::grab(bool)':
/home/vader/programming/libs/ois/ois/trunk/src/./linux/LinuxMouse.cpp:262: undefined reference to `XUngrabPointer'
collect2: ld returned 1 exit status
make[2]: *** [oisb_console] Virhe 1
make[1]: *** [CMakeFiles/oisb_console.dir/all] Virhe 2
make: *** [all] Virhe 2
I downloaded a fresh copy from the mercurial repository, just set build type to 'Release' in ccmake, and then c, e, g, make, and that's what I get as output. The library is created but as you can see it fails on the demo. I think it's just about not linking the demo to the required X libs.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: OISB (new input binding/mapping library!)

Post by tdev »

reptor wrote:It's not working for me...

I downloaded a fresh copy from the mercurial repository, just set build type to 'Release' in ccmake, and then c, e, g, make, and that's what I get as output. The library is created but as you can see it fails on the demo. I think it's just about not linking the demo to the required X libs.
ok, i will test tomorrow on a linux desktop so i can see. What linux distribution did you use?
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

Debian 5.0.8.
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Re: OISB (new input binding/mapping library!)

Post by reptor »

There is another problem on Linux in that the file rapidxml.hpp is not getting installed.

I missed this problem in my earlier reports as I had just copied the file over to my project's include directory and forgot it.
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: OISB (new input binding/mapping library!)

Post by tdev »

thanks for reporting, will investigate this.

for easier planning, we now deployed a redmine and hudson instance: http://redmine.rigsofrods.com/projects/oisb
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 217

Re: OISB (new input binding/mapping library!)

Post by scrawl »

Is the "remap controls" functionality still being worked on?

We would really like to use oisb for our game project, but we need to provide the user the ability to bind his own keys or joystick, and I fear I don't understand your source enough to implement this myself :(
User avatar
kulik
Gremlin
Posts: 183
Joined: Sun May 01, 2005 2:00 pm
x 23

Re: OISB (new input binding/mapping library!)

Post by kulik »

I unfortunately don't have the manpower right now :-( However I am willing to help anyone wanting to implement the remapping GUI. I suggest to do it in Qt.

Anybody feel free to PM me if you are interested.
mpreisler on IRC | CEGUI team member, CEGUI Unified Editor developer, OISB founder
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: OISB (new input binding/mapping library!)

Post by Klaim »

Hi,

I wanted to say that this library is really interesting and if I can find time to work a bit on it when I get back to my games code, I think I might help. I will not be until next year I think but still, I'm looking at this lib (and ogre procedural too, both very cool).

From the demos, the functionnalities seems to work correctly and as I wanted to do something similar in a game but wasn't sure how to proceeed, I now have a good overview of how input mapping/binding can be implemented.

Also, I have some questions and suggestion:

1. Someone already said this but it looks like very old-school C++. I see a lot of functions accepting pointers while they shouldn't allow it.
2. It lacks tests, for sure, but I think it lacks assertions more.
3. Does the library already implements the action sequences or is there still a very basic implementation, like said in the initial post?
4. Why does OISB::System() requires OIS::InputManager() instance while it can be accessed as a "singleton" (it's not really a singleton as it have to be explicitely created/destructed - and that is GOOD)? It would be more safe to always use the "singleton" access as it always checks that the pointer instance is not-null.
5. Usage of value 0 is, I think, bad practice, so maybe using nullptr (with a provided code-implementation for non-c++0x compilers) would be a good idea? It would alslo help reading the code :

Code: Select all

mMyObject( 0 ) // is it  pointer or an int or something that builds with a pointer or an int? 
mMyObject( nullptr ) // it's a pointer obviously! or something that builds with a pointer at least
I didn't look at everything so those are little remarks that don't impact on the overhall design of the library.

I thought that maybe I could clone the repo and fix all this and then propose the changes.

One last thing : I would suggest to use the issues system in google hosting instead of redmine OR removing it and add a link in the goole hosting page. That way people know where you will be looking at for potential issues.
User avatar
kulik
Gremlin
Posts: 183
Joined: Sun May 01, 2005 2:00 pm
x 23

Re: OISB (new input binding/mapping library!)

Post by kulik »

Tests, assertions and refactoring were on my plan so if you make efforts in these directions I would be interested to merge them into upstream. If I see you are pushing the project in the right direction I can give you commit rights. I also admit that there are places where pointers are used but references should have been used. These can be changed of course.

As for the nullptr, I use 0 everywhere and I am not aware of C++0x nullptr. I will check that out but right now I don't think making OISB C++0x only is a good idea.

OISB::System takes OIS::InputManager by design, it takes it and wraps it. Sure I could have just used the singleton but I felt this was self documenting and the right thing to do.
mpreisler on IRC | CEGUI team member, CEGUI Unified Editor developer, OISB founder
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: OISB (new input binding/mapping library!)

Post by Klaim »

As for the nullptr, I use 0 everywhere and I am not aware of C++0x nullptr. I will check that out but right now I don't think making OISB C++0x only is a good idea.
I'm not suggesting to use C++0x features, I suggest to use a safer replacement for 0 for null and C++0x propose one. It is easy to simulate, that's why i think you could probably use it safely.
Just add some macro around this code to make sure it's used only if nullptr isn't already implemented :

Code: Select all

/************************************/
// C++0x features emulation
#if __cplusplus <= 199711L // <= C++03
               
        //nullptr definition: (see C++0x)
        // from http://stackoverflow.com/questions/2419800/can-nullptr-be-emulated-in-gcc
        const                        // this is a const object...
        class {
        public:
                template<class T>          // convertible to any type
                operator T*() const      // of null non-member
                { return 0; }            // pointer...
                template<class C, class T> // or any type of null
                operator T C::*() const  // member pointer...
                { return 0; }
        private:
                void operator&() const;    // whose address can't be taken
        } nullptr = {};              // and whose name is nullptr

#endif
User avatar
kulik
Gremlin
Posts: 183
Joined: Sun May 01, 2005 2:00 pm
x 23

Re: OISB (new input binding/mapping library!)

Post by kulik »

In that case this can go in as well, I like this change.
mpreisler on IRC | CEGUI team member, CEGUI Unified Editor developer, OISB founder
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: OISB (new input binding/mapping library!)

Post by jacmoe »

Klaim wrote:I'm not suggesting to use C++0x features, I suggest to use a safer replacement for 0 for null and C++0x propose one. It is easy to simulate, that's why i think you could probably use it safely.
Totally ridiculous.
What's so wrong with setting a pointer to 0 ?
The nullptr emulation is just gross - it makes me shiver to even think about it.
It's great that c++11 has nullptr, but - as you said in the C++0x topic - we can't really use the new c++ just yet.
It's up to you, of course.
OISB can always be forked. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: OISB (new input binding/mapping library!)

Post by Klaim »

Totally ridiculous.
That's far from being respectful.
What's so wrong with setting a pointer to 0 ?
Are you serious? For the same reasons nullptr have been added to the language.
The nullptr emulation is just gross - it makes me shiver to even think about it.
That's why it's just an emulation and not the standard implementation (that is a language feature, not library code). That have nothing to do with the purpose it achieves.

It's great that c++11 has nullptr, but - as you said in the C++0x topic - we can't really use the new c++ just yet.
Again it's just about using something else than 0, that -among other things- don't make code very clear. I just propose a simple (copy-paste with link to the source in comment) emulation of the feature that just is safer than 0 or NULL.
That's just a suggestion, obviously. Even using NULL is safer and help reading the code faster than 0 with pointers.
It's up to you, of course.
OISB can always be forked.
I already said that in my first post here.
Do you really think that this kind of comments encourage contributions?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: OISB (new input binding/mapping library!)

Post by jacmoe »

I just think it's weird to go nuts over it all of a sudden.
It's great that the nullptr has arrived, but that doesn't mean that there's anything wrong with setting pointer to zero (0).
I am intelligent enough to know what it means.
And I know that you are too.
After all, that's what we've been doing until now. And most of us will keep doing until c++11 becomes mainstream.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: OISB (new input binding/mapping library!)

Post by jacmoe »

Sorry for the rude grumpiness - having a bad hair day. My Linux installation just decided to fold up and die, so I am spending an inordinate amount of time copying my home partition to Windows.
Really great that you are thinking of contributing to OISB which is a cool project, especially since Kulik doesn't have time to tend to it nowadays. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.