PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: VirtualController.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLINPUT_VIRTUALCONTROLLER_H__ 00024 #define __PLINPUT_VIRTUALCONTROLLER_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLInput/Input/Controller.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLInput { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Virtual input controller 00046 * 00047 * @remarks 00048 * A virtual input controller is a controller that is used to map real input devices to virtual controls. 00049 * Usually, you have one virtual input controller for your application, or in rare occasions more than one, 00050 * e.g. one for every window or player. The virtual controller connects itself to the physical input devices, 00051 * a virtual function can be used to alter this behavior in derived classes. The virtual controller should 00052 * then be connected to the controllers of input-enabled objects, such as scene nodes or modifiers. 00053 */ 00054 class VirtualController : public Controller { 00055 00056 00057 //[-------------------------------------------------------] 00058 //[ Class definition ] 00059 //[-------------------------------------------------------] 00060 pl_class(PLINPUT_RTTI_EXPORT, VirtualController, "PLInput", PLInput::Controller, "Virtual input controller base class") 00061 pl_class_end 00062 00063 00064 //[-------------------------------------------------------] 00065 //[ Public functions ] 00066 //[-------------------------------------------------------] 00067 public: 00068 /** 00069 * @brief 00070 * Constructor 00071 * 00072 * @param[in] sName 00073 * Controller name 00074 * @param[in] sDescription 00075 * Controller description 00076 */ 00077 PLINPUT_API VirtualController(const PLCore::String &sName, const PLCore::String &sDescription); 00078 00079 /** 00080 * @brief 00081 * Destructor 00082 */ 00083 PLINPUT_API virtual ~VirtualController(); 00084 00085 00086 //[-------------------------------------------------------] 00087 //[ Public virtual VirtualController functions ] 00088 //[-------------------------------------------------------] 00089 public: 00090 /** 00091 * @brief 00092 * Connect virtual controller to physical devices 00093 * 00094 * @remarks 00095 * This function shall enumerate the available devices and connect 00096 * itself to the proper controls of those input devices. Override 00097 * this function in derived classes to alter it's behavior or to 00098 * support your own type of virtual controllers 00099 */ 00100 PLINPUT_API virtual void ConnectToDevices(); 00101 00102 00103 }; 00104 00105 00106 //[-------------------------------------------------------] 00107 //[ Namespace ] 00108 //[-------------------------------------------------------] 00109 } // PLInput 00110 00111 00112 #endif // __PLINPUT_VIRTUALCONTROLLER_H__
|