Input and games.

Todd Showalter todd at electronjump.com
Sat Apr 20 19:39:14 PDT 2013


On Sat, Apr 20, 2013 at 10:31 PM, Todd Showalter <todd at electronjump.com> wrote:

    I hate it when I fat-finger send.

    The data just needs to be something like:

typedef struct
{
   float x;
   float y;
} VEC2;

typedef struct
{
  VEC2 l_stick;
  VEC2 r_stick;
  float    l_shoulder;
  float    r_shoulder;
  uint64_t  buttons;
} GAMEPAD_DATA;

    That's a complete controller state in 32 bytes.  The analog values
in actual hardware are usually actually returned as unsigned byte
values, but from a protocol point of view converting each stick axis
to the range [-1.0f .. 1.0f] and the triggers to [0.0f .. 1.0f] is
saner.  If Wayland just delivers that data it will cover most needs.

                                          Todd.

--
 Todd Showalter, President,
 Electron Jump Games, Inc.


More information about the wayland-devel mailing list