00001 /* 00002 $Id: inputbutton_basic.h,v 1.1 2001/03/06 15:09:10 mbn Exp $ 00003 00004 ------------------------------------------------------------------------ 00005 ClanLib, the platform independent game SDK. 00006 00007 This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE 00008 version 2. See COPYING for details. 00009 00010 For a total list of contributers see CREDITS. 00011 00012 ------------------------------------------------------------------------ 00013 */ 00014 00016 00017 #ifndef header_inputbutton_basic 00018 #define header_inputbutton_basic 00019 00020 #include "../Input/inputbutton.h" 00021 00022 class CL_InputButton_Basic : public CL_InputButton 00023 //: CL_InputButton interface used to ease manual implementation of a input 00024 //: button. 00025 { 00026 protected: 00027 bool state; 00028 00029 public: 00030 CL_InputButton_Basic() 00031 { 00032 state = false; 00033 } 00034 //: Constructs an input button defaulting to not being pressed (false). 00035 00036 CL_InputButton_Basic(bool state) 00037 { 00038 this->state = state; 00039 } 00040 //: Constructs an input button defaulting to 'state'. 00041 00042 virtual ~CL_InputButton_Basic() {;} 00043 00044 virtual bool is_pressed() 00045 { 00046 return state; 00047 } 00048 //: Returns true if the button is pressed. 00050 00051 void set_state(bool state) 00052 { 00053 this->state = state; 00054 } 00055 //: Changes the current button state. If 'state' is true, the button will be 00056 //: up, otherwise down. 00058 }; 00059 00060 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001