pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/input joystick_button.cxx,NONE,1.1 jo


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/input joystick_button.cxx,NONE,1.1 joystick_button.hxx,NONE,1.1
Date: 4 Jul 2002 12:03:50 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/input
In directory dark:/tmp/cvs-serv28385

Added Files:
        joystick_button.cxx joystick_button.hxx 
Log Message:
concrete button class mapping joystick buttons


--- NEW FILE: joystick_button.cxx ---
//  $Id: joystick_button.cxx,v 1.1 2002/07/04 12:03:47 torangan Exp $
// 
//  Pingus - A free Lemmings clone
//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include <ClanLib/Display/Input/input.h>
#include <ClanLib/Display/Input/inputdevice.h>
#include <ClanLib/Display/Input/inputbutton.h>
#include "joystick_button.hxx"

namespace Input {

  JoystickButton::JoystickButton(int id_, int button_) : id(id_), 
button(button_) { }

  void
  JoystickButton::update(float)
  {
  }
  
  bool
  JoystickButton::is_pressed()
  {
    return CL_Input::joysticks[id]->get_button(button)->is_pressed();
  }
  
}

/* EOF */

--- NEW FILE: joystick_button.hxx ---
//  $Id: joystick_button.hxx,v 1.1 2002/07/04 12:03:47 torangan Exp $
// 
//  Pingus - A free Lemmings clone
//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_INPUT_JOYSTICK_BUTTON_HXX
#define HEADER_PINGUS_INPUT_JOYSTICK_BUTTON_HXX

#include "button.hxx"

namespace Input {

  class JoystickButton : Button {
  
    private:
      int id;
      int button;
      
    public:
    
      JoystickButton(int id_, int button_);
    
      virtual bool is_pressed ();
      virtual void update (float);
  };
}

#endif

/* EOF */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]