1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

Pandora Pandora + SDL: Nubs vs touchscreen

Discussion in 'C /C ++' started by graupelschauer, Dec 25, 2012.

  1. graupelschauer

    graupelschauer Member

    Joined:
    Jun 24, 2010
    Messages:
    110
    Hi

    I've posted this on the german boards already but did not find a solution yet. I useSDL as framework for my game. The game should be played with the stylus but can also be played with the nubs. The problem is: Mixing both input types results in an ugly cursor offset. I draw the cursor myself at the current mouse position. Does anyone know how to solve this problem?SDLcannot distinguish between both input types it seems.
     
    Tags:
  2. crow_riot

    crow_riot Well-Known Member

    Joined:
    Sep 21, 2009
    Messages:
    1,763
    Location:
    .at
    if i dont misubderstand you ... i think you need to set the nubs to joystickmode?
     
  3. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,477
    Location:
    France, near Lyon
    Another problem is, if you hide the cursor on SDL on X11, it automaticaly switch to Relative Mode, and so it drift on Touchscreen.

    You can either try to set this environnement variable : SDL_MOUSE_RELATIVE=0

    or follow this guide : http://blogs.distant-earth.com/wp/?p=293
     
  4. graupelschauer

    graupelschauer Member

    Joined:
    Jun 24, 2010
    Messages:
    110
    Ah ok thanks, I will try that the next days and see if it helps. I will tell you how it works out  :)
     
    Last edited by a moderator: Dec 25, 2012
  5. graupelschauer

    graupelschauer Member

    Joined:
    Jun 24, 2010
    Messages:
    110
    Hi, I had time to test that and you are right it works. One small drawback is that the app freezes when I call SDL_FreeCursor at the end but if don't free the resources it works :)
     
  6. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,477
    Location:
    France, near Lyon
    I assume you have followed the blog with the empty cursor. So a simple export SDL_MOUSE_RELATIVE="0" or something like that is not enough ?

    About the freeze, maybe you have to restore default cursor before release the empty one ?
     
    Last edited by a moderator: Dec 28, 2012
  7. graupelschauer

    graupelschauer Member

    Joined:
    Jun 24, 2010
    Messages:
    110
    Yes I tried the workaround in the blog. I like that solution most so I didn't try the export, maybe I'll give it a shot later.

    @freeze: I tried that, too but without success. It works on windows but freezes on the pandora.
     
  8. graupelschauer

    graupelschauer Member

    Joined:
    Jun 24, 2010
    Messages:
    110
    The export works, too. I'll use that instead of the invisible cursor.
     

Share This Page

Loading...