00001 /* 00002 This source file is part of OgreHaptics 00003 (a library for wrapping haptics devices for use with the open-source 00004 graphics engine OGRE, http://www.ogre3d.org) 00005 00006 Copyright (c) 2006 - 2008 Jorrit de Vries 00007 Also see acknowledgements in Readme.html 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public License 00011 as published by the Free Software Foundation; either version 2.1 00012 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the 00021 Free Software Foundation, Inc., 00022 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 #ifndef _OgreHapticsRenderSystem_H__ 00025 #define _OgreHapticsRenderSystem_H__ 00026 00027 #include "OgreHapticsPrerequisites.h" 00028 #include "OgreHapticsCommon.h" 00029 00030 namespace OgreHaptics { 00031 00049 class _OgreHapticsExport RenderSystem 00050 { 00051 public: 00053 RenderSystem(); 00055 virtual ~RenderSystem(); 00056 00058 virtual const String& getName(void) const = 0; 00059 00061 virtual const String& getDefaultDeviceInitName(void) const = 0; 00082 virtual const DeviceInfoList& getAvailableNamedDevices(void) = 0; 00089 virtual unsigned int getNumConnectedDevices(void) = 0; 00090 00121 Device* _createDevice(const String& name, System* system, 00122 const DeviceInitInfo& info); 00123 00124 Device* _createDevice(const String& name, unsigned int index, 00125 System* system, DeviceInitInfo& info); 00130 void _destroyDevice(Device* device); 00131 00149 virtual bool setOption(const String& key, const void* value); 00162 virtual bool getOption(const String& key, void* value); 00163 00192 virtual void startScheduler(unsigned long rate = 1000, bool autoEnableDevices = true) = 0; 00204 virtual void stopScheduler(bool autoDisableDevices = true) = 0; 00209 bool isSchedulerStarted(void) const { return mIsSchedulerStarted; } 00218 unsigned long getSetSchedulerRate(void) const { return mSetSchedulerRate; } 00219 00221 Timer* getTimer(void) const { return mTimer; } 00222 00238 virtual void _scheduleSynchronousCallback(SchedulerCallback callback, 00239 void* params) = 0; 00253 virtual short _scheduleAsynchronousCallback(SchedulerCallback callback, 00254 void* params) = 0; 00261 virtual void _unscheduleAsynchronousCallback(short id) = 0; 00262 00264 virtual String getErrorDescription(long errorNumber) const = 0; 00265 protected: 00268 static short msNextAsynchronousCallbackID; 00269 00271 Timer* mTimer; 00273 bool mIsSchedulerStarted; 00275 unsigned long mSetSchedulerRate; 00277 bool mAvailableDevicesDirty; 00279 DeviceInfoList mAvailableDevices; 00282 DeviceMap mDevices; 00283 00285 virtual Device* createDeviceImpl(const String& name, 00286 const DeviceInitInfo& initInfo) = 0; 00288 virtual Device* createDeviceImpl(const String& name, unsigned int index, 00289 const DeviceInitInfo& initInfo) = 0; 00292 virtual String getInitNameByIndex(unsigned int index) = 0; 00294 virtual void initConfigOptions(DeviceInitInfo& info) = 0; 00295 00296 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 00297 OGREHAPTICS_MUTEX(mThreadAffinityMaskMutex) 00300 DWORD mThreadAffinityMask; 00303 virtual void _notifyThreadAffinityChanged(void) = 0; 00304 #endif 00305 }; 00306 00307 } 00308 00309 #endif
Last modified Tue Jan 6 22:31:25 2009