Hardware cursor + CEGUI + OIS?

lmx13

03-06-2011 19:11:00

Hi there!

Would be kind if you explain me how to deal with the followin situation (hope you understand, i kno my english sux)

Yeah, i did search the forums, but i did not find something specific to my problem. most ppl are just okay with the mouse trapped into the game window.

  1. I am currently programming a game with python-ogre but i got stuck with the mouse.[/*:m]
  2. I am using OIS (buffered input) and injecting the events into CEGUI.[/*:m]
  3. I also used "DISCL_FOREGROUND" and "DISCL_NONEXCLUSIVE" to use the "hardware" cursor (i HATE it when the mouse is slow whenever the framerate drops)[/*:m]
  4. I am currently only testing with windowed mode.[/*:m]
  5. I am injecting the mouse position via def mouseMoved (self, evt): self.system.injectMousePosition(evt.get_state().X.abs, evt.get_state().Y.abs) into cegui[/*:m][/list:u]

    Problem is:
    i can hide/not show the cegui cursor, but i still trails the "real" mouse with a small lag.
    but i want the cursor to be REALTIME -.-

    What i would really want:
    1. mosue can leave window with no problem[/*:m]
    2. mouse is realtime[/*:m]
    3. mouse looks the way cegui defines inside the window[/*:m][/list:u]

      What can i do (is that even possible)?

Mohican

04-06-2011 16:31:57

Regarding leaving the window, Ogre will not allow you to do that (AFAIK).
You would need to find a way to fix this in the Ogre the C++ code

dermont

04-06-2011 19:31:50

Hi there!

Would be kind if you explain me how to deal with the followin situation (hope you understand, i kno my english sux)

Yeah, i did search the forums, but i did not find something specific to my problem. most ppl are just okay with the mouse trapped into the game window.

  1. I am currently programming a game with python-ogre but i got stuck with the mouse.[/*:m]
  2. I am using OIS (buffered input) and injecting the events into CEGUI.[/*:m]
  3. I also used "DISCL_FOREGROUND" and "DISCL_NONEXCLUSIVE" to use the "hardware" cursor (i HATE it when the mouse is slow whenever the framerate drops)[/*:m]
  4. I am currently only testing with windowed mode.[/*:m]
  5. I am injecting the mouse position via def mouseMoved (self, evt): self.system.injectMousePosition(evt.get_state().X.abs, evt.get_state().Y.abs) into cegui[/*:m][/list:u]

    Problem is:
    i can hide/not show the cegui cursor, but i still trails the "real" mouse with a small lag.
    but i want the cursor to be REALTIME -.-

    What i would really want:
    1. mosue can leave window with no problem[/*:m]
    2. mouse is realtime[/*:m]
    3. mouse looks the way cegui defines inside the window[/*:m][/list:u]

      What can i do (is that even possible)?

Hopefully I'm understanding your question correctly, you have already set OIS NONEXCLUSIVE and are trying to switch between the CEUI cursor in windowed mode and the hardware cursor when leaving the render window.

If so the following links may be help:
http://flip.netzbeben.de/2009/01/switch ... owed-mode/
http://nullege.com/codes/show/src%40v%4 ... sor/python

For python-ogre a simple test would be (though I don't think this would resolve your mouse slow down when the frame rate drops).


def mouseMoved( self, evt ):
#CEGUI.System.getSingleton().injectMouseMove( arg.get_state().X.rel, arg.get_state().Y.rel )
CEGUI.System.getSingleton().injectMousePosition(evt.get_state().X.abs, evt.get_state().Y.abs)
self.cursorDisplayCount = ctypes.windll.user32.ShowCursor(0)

return True