Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Creating 2 X connections..  (Read 1152 times)

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Creating 2 X connections..
« on: October 15, 2005, 07:03:17 AM »

Ok, currently I have been only creating one connection to the XWindow for events... Though, this has proved difficult in my seperation of devices... Where each device requires you to call capture (ie. mouse->capture() keyboard->capture()).. Now, with one conenction both keyboard & mouse  events are recieved from the same event loop capture, this messes up mouse relative values (movements from last capture call) - as it is captured, then recaptured again. I tried some hackish frame counter... but, now that I think of it.. two connections would easily resolve this.. Now, I do not know much of X.. BUt I do not think 3 connections will hurt performance noticeably (main app - eg Ogre window, Mouse, and keyboard), so this is the way I am going to go right now.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Creating 2 X connections..
« Reply #1 on: October 15, 2005, 05:38:26 PM »

Ok, this idea worked good.. Makes the updating code less hacky, and consistant with the Win32 counterpart...

I was also able to get mouse working ok.. Though, it does not grab the mouse cursor, so, when the mouse leaves the window, no more mouse input yet.

[Fixed]Also, need to invert the rel X and Y values, as they are inconsistant with Win32 values (opposite).

[Fixed]Also need to make sure button mask is correct, the Button1 seems swapped with Button2 right now.

Also got Both Ogre demos compilable with CEGUI 0.4.0 & CEGUi head. Just build, and copy to ogre samples/common/bin directory (on linux). Need to work on keyChar inputs for CEGUI (only inject 'a' at the moment :)
Logged