PEBL
2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
sdl/PlatformJoystick.h
Go to the documentation of this file.
1
//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3
// Name: src/devices/PlatformJoystick.h
4
// Purpose: Class for handling Joysticks with SDL
5
// Author: Shane T. Mueller, Ph.D.
6
// Copyright: (c) 2011 Shane T. Mueller <smueller@obereed.net>
7
// License: GPL 2
8
//
9
//
10
//
11
// This file is part of the PEBL project.
12
//
13
// PEBL is free software; you can redistribute it and/or modify
14
// it under the terms of the GNU General Public License as published by
15
// the Free Software Foundation; either version 2 of the License, or
16
// (at your option) any later version.
17
//
18
// PEBL is distributed in the hope that it will be useful,
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
// GNU General Public License for more details.
22
//
23
// You should have received a copy of the GNU General Public License
24
// along with PEBL; if not, write to the Free Software
25
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
#ifndef __PLATFORMJOYSTICK_H__
28
#define __PLATFORMJOYSTICK_H__
29
30
31
#include "../../devices/PJoystick.h"
32
#include <fstream>
33
#include <string>
34
35
#include "SDL.h"
36
37
class
PlatformJoystick
:
public
PJoystick
38
{
39
40
public
:
41
42
44
PlatformJoystick
(
int
i);
45
PlatformJoystick
(
const
PlatformJoystick
& js);
47
virtual
~PlatformJoystick
();
48
49
50
virtual
signed
int
GetHatState
(
unsigned
int
hat);
51
virtual
Variant
GetBallState
(
unsigned
int
ball);
52
virtual
signed
int
GetAxisState
(
unsigned
int
axis);
53
virtual
signed
int
GetButtonState
(
unsigned
int
button);
54
55
56
57
58
protected
:
59
60
//Inheritable printing Method.
61
virtual
std::ostream&
SendToStream
(std::ostream& out)
const
;
62
63
64
65
private
:
66
67
SDL_Joystick * mJoystick;
68
int
mIndex;
69
70
};
71
72
73
74
#endif
PJoystick
Definition
PJoystick.h:41
PlatformJoystick
Definition
sdl/PlatformJoystick.h:38
PlatformJoystick::~PlatformJoystick
virtual ~PlatformJoystick()
The Standard destructor.
Definition
sdl/PlatformJoystick.cpp:73
PlatformJoystick::GetButtonState
virtual signed int GetButtonState(unsigned int button)
Definition
sdl/PlatformJoystick.cpp:136
PlatformJoystick::GetBallState
virtual Variant GetBallState(unsigned int ball)
Definition
sdl/PlatformJoystick.cpp:97
PlatformJoystick::PlatformJoystick
PlatformJoystick()
Definition
validator/PlatformJoystick.cpp:4
PlatformJoystick::SendToStream
virtual std::ostream & SendToStream(std::ostream &out) const
Definition
validator/PlatformJoystick.cpp:13
PlatformJoystick::GetHatState
virtual signed int GetHatState(unsigned int hat)
Definition
sdl/PlatformJoystick.cpp:81
PlatformJoystick::GetAxisState
virtual signed int GetAxisState(unsigned int axis)
Definition
sdl/PlatformJoystick.cpp:122
Variant
Definition
Variant.h:67
src
platforms
sdl
PlatformJoystick.h
Generated by
1.9.8