x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
CEGUIWindowRendererModule.h - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\ogre\include\CEGUI\CEGUIWindowRendererModule.h
旋转
特效
属性
历史版本
/*********************************************************************** filename: CEGUIWindowRendererModule.h created: Fri Jan 13 2006 author: Paul D Turner
Tomas Lindquist Olsen
*************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. ***************************************************************************/ #ifndef _CEGUIWindowRendererModule_h_ #define _CEGUIWindowRendererModule_h_ #include "CEGUIExceptions.h" #include "CEGUIWindowRendererManager.h" #include "CEGUILogger.h" #if defined( __WIN32__ ) || defined( _WIN32 ) # ifdef CEGUIWRMODULE_EXPORTS # define CEGUIWRMODULE_API __declspec(dllexport) # else # define CEGUIWRMODULE_API __declspec(dllimport) # endif #else # define CEGUIWRMODULE_API #endif // declare module #define CEGUI_DECLARE_WR_MODULE( moduleName )\ \ class CEGUI::WindowRendererFactory;\ \ extern "C" CEGUIWRMODULE_API void registerFactory(const CEGUI::String& type_name);\ extern "C" CEGUIWRMODULE_API CEGUI::uint registerAllFactories(void);\ void doSafeFactoryRegistration(CEGUI::WindowRendererFactory* factory); // define factory #define CEGUI_DEFINE_WR_FACTORY( className )\ namespace CEGUI {\ class className ## WRFactory : public WindowRendererFactory\ {\ public:\ className ## WRFactory(void) : WindowRendererFactory(className::TypeName) { }\ WindowRenderer* create(void)\ { return new className(className::TypeName); }\ void destroy(WindowRenderer* wr)\ { delete wr; }\ };\ }\ static CEGUI::className ## WRFactory s_ ## className ## WRFactory; // start factory map #define CEGUI_START_WR_FACTORY_MAP( module )\ struct module ## WRMapEntry\ {\ const CEGUI::utf8* d_name;\ CEGUI::WindowRendererFactory* d_factory;\ };\ \ module ## WRMapEntry module ## WRFactoriesMap[] =\ {\ // end factory map #define CEGUI_END_WR_FACTORY_MAP {0,0}}; // map entry #define CEGUI_WR_FACTORY_MAP_ENTRY( class )\ {CEGUI::class::TypeName, &s_ ## class ## WRFactory}, // define module #define CEGUI_DEFINE_WR_MODULE( module )\ extern "C" void registerFactory(const CEGUI::String& type_name)\ {\ module ## WRMapEntry* entry = module ## WRFactoriesMap;\ while (entry->d_name)\ {\ if (entry->d_name == type_name)\ {\ doSafeFactoryRegistration(entry->d_factory);\ return;\ }\ ++entry;\ }\ \ throw CEGUI::UnknownObjectException("::registerFactory - The window renderer factory for type '" + type_name + "' is not known in this module.");\ }\ \ extern "C" CEGUI::uint registerAllFactories(void)\ {\ CEGUI::uint count = 0;\ module ## WRMapEntry* entry = module ## WRFactoriesMap;\ while (entry->d_name)\ {\ doSafeFactoryRegistration(entry->d_factory);\ ++entry;\ ++count;\ }\ return count;\ }\ \ void doSafeFactoryRegistration(CEGUI::WindowRendererFactory* factory)\ {\ assert(factory != 0);\ \ CEGUI::WindowRendererManager& wfm = CEGUI::WindowRendererManager::getSingleton();\ if (wfm.isFactoryPresent(factory->getName()))\ {\ CEGUI::Logger::getSingleton().logEvent(\ "WindowRenderer factory '" + factory->getName() + "' appears to be already registered, skipping.",\ CEGUI::Informative);\ }\ else\ {\ wfm.addFactory(factory);\ }\ } #endif // end of guard _CEGUIWindowRendererModule_h_
CEGUIWindowRendererModule.h
网页地址
文件地址
上一页
72/76
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.