CCConfiguration(配置类 可以得到当前载体的支持功能信息 )
2014-05-21 18:49
483 查看
#ifndef __CCCONFIGURATION_H__
#define __CCCONFIGURATION_H__
#include "cocoa/CCObject.h"
#include "CCGL.h"
#include "cocoa/CCString.h"
#include <string>
NS_CC_BEGIN
typedef enum _ccConfigurationType {
ConfigurationError,
ConfigurationString,
ConfigurationInt,
ConfigurationDouble,
ConfigurationBoolean
} ccConfigurationType;
class CC_DLL CCConfiguration : public CCObject
{
public:
//配置类 是一个全局单例
static CCConfiguration *sharedConfiguration(void);
//清空配置
static void purgeConfiguration(void);
public:
virtual ~CCConfiguration(void);
//OpenGL 最大 texture 尺寸
int getMaxTextureSize(void) const;
//OpenGL 最大 Modelview Stack Depth.
int getMaxModelviewStackDepth(void) const;
int getMaxTextureUnits(void) const;
/** Whether or not the GPU supports NPOT (Non Power Of Two) textures.
OpenGL ES 2.0 already supports NPOT (iOS).
@since v0.99.2
*/
bool supportsNPOT(void) const;
/** Whether or not PVR Texture Compressed is supported */
//是否支持 PVR Texture 压缩
bool supportsPVRTC(void) const;
/** Whether or not BGRA8888 textures are supported.
@since v0.99.2
*/
//是否支持 BGRA8888 textures
bool supportsBGRA8888(void) const;
/** Whether or not glDiscardFramebufferEXT is supported
@since v0.99.2
*/
//是否支持 glDiscardFramebufferEXT
bool supportsDiscardFramebuffer(void) const;
/** Whether or not shareable VAOs are supported.
@since v2.0.0
*/
//是否支持 VAOs(的增值运营与服务)
bool supportsShareableVAO(void) const;
/** returns whether or not an OpenGL is supported */
bool checkForGLExtension(const std::string &searchName) const;
bool init(void);
/** returns the value of a given key as a string.
If the key is not found, it will return the default value */
//returns 给定的 key 对应的值(string) ,如果该 key 没有被发现,它会返回默认值
const char* getCString( const char *key, const char *default_value=NULL ) const;
/** returns the value of a given key as a boolean.
If the key is not found, it will return the default value */
bool getBool( const char *key, bool default_value=false ) const;
/** returns the value of a given key as a double.
If the key is not found, it will return the default value */
double getNumber( const char *key, double default_value=0.0 ) const;
//returns 给定的 key 对应的值(Object)
CCObject * getObject( const char *key ) const;
/** sets a new key/value pair in the configuration dictionary */
void setObject( const char *key, CCObject *value );
/** dumps(倾倒) the current configuration on the console */
void dumpInfo(void) const;
/** gathers(收集 获得) OpenGL / GPU information */
void gatherGPUInfo( void );
/** Loads a config file. If the keys are already present, then they are going to be replaced. Otherwise the new
keys are added. */
//加载一个配置文件,如果 keys 已经存在了,那么他将被替换掉,添加新的 keys.
void loadConfigFile( const char *filename );
private:
CCConfiguration(void);
static CCConfiguration *s_gSharedConfiguration;
static std::strings_sConfigfile;
protected:
GLint m_nMaxTextureSize;
GLint m_nMaxModelviewStackDepth;
bool m_bSupportsPVRTC;
bool m_bSupportsNPOT;
bool m_bSupportsBGRA8888;
bool m_bSupportsDiscardFramebuffer;
bool m_bSupportsShareableVAO;
GLint m_nMaxSamplesAllowed;
GLint m_nMaxTextureUnits;
char * m_pGlExtensions;
CCDictionary*m_pValueDict;
};
// end of global group
/// @}
NS_CC_END
#endif // __CCCONFIGURATION_H__
#define __CCCONFIGURATION_H__
#include "cocoa/CCObject.h"
#include "CCGL.h"
#include "cocoa/CCString.h"
#include <string>
NS_CC_BEGIN
typedef enum _ccConfigurationType {
ConfigurationError,
ConfigurationString,
ConfigurationInt,
ConfigurationDouble,
ConfigurationBoolean
} ccConfigurationType;
class CC_DLL CCConfiguration : public CCObject
{
public:
//配置类 是一个全局单例
static CCConfiguration *sharedConfiguration(void);
//清空配置
static void purgeConfiguration(void);
public:
virtual ~CCConfiguration(void);
//OpenGL 最大 texture 尺寸
int getMaxTextureSize(void) const;
//OpenGL 最大 Modelview Stack Depth.
int getMaxModelviewStackDepth(void) const;
int getMaxTextureUnits(void) const;
/** Whether or not the GPU supports NPOT (Non Power Of Two) textures.
OpenGL ES 2.0 already supports NPOT (iOS).
@since v0.99.2
*/
bool supportsNPOT(void) const;
/** Whether or not PVR Texture Compressed is supported */
//是否支持 PVR Texture 压缩
bool supportsPVRTC(void) const;
/** Whether or not BGRA8888 textures are supported.
@since v0.99.2
*/
//是否支持 BGRA8888 textures
bool supportsBGRA8888(void) const;
/** Whether or not glDiscardFramebufferEXT is supported
@since v0.99.2
*/
//是否支持 glDiscardFramebufferEXT
bool supportsDiscardFramebuffer(void) const;
/** Whether or not shareable VAOs are supported.
@since v2.0.0
*/
//是否支持 VAOs(的增值运营与服务)
bool supportsShareableVAO(void) const;
/** returns whether or not an OpenGL is supported */
bool checkForGLExtension(const std::string &searchName) const;
bool init(void);
/** returns the value of a given key as a string.
If the key is not found, it will return the default value */
//returns 给定的 key 对应的值(string) ,如果该 key 没有被发现,它会返回默认值
const char* getCString( const char *key, const char *default_value=NULL ) const;
/** returns the value of a given key as a boolean.
If the key is not found, it will return the default value */
bool getBool( const char *key, bool default_value=false ) const;
/** returns the value of a given key as a double.
If the key is not found, it will return the default value */
double getNumber( const char *key, double default_value=0.0 ) const;
//returns 给定的 key 对应的值(Object)
CCObject * getObject( const char *key ) const;
/** sets a new key/value pair in the configuration dictionary */
void setObject( const char *key, CCObject *value );
/** dumps(倾倒) the current configuration on the console */
void dumpInfo(void) const;
/** gathers(收集 获得) OpenGL / GPU information */
void gatherGPUInfo( void );
/** Loads a config file. If the keys are already present, then they are going to be replaced. Otherwise the new
keys are added. */
//加载一个配置文件,如果 keys 已经存在了,那么他将被替换掉,添加新的 keys.
void loadConfigFile( const char *filename );
private:
CCConfiguration(void);
static CCConfiguration *s_gSharedConfiguration;
static std::strings_sConfigfile;
protected:
GLint m_nMaxTextureSize;
GLint m_nMaxModelviewStackDepth;
bool m_bSupportsPVRTC;
bool m_bSupportsNPOT;
bool m_bSupportsBGRA8888;
bool m_bSupportsDiscardFramebuffer;
bool m_bSupportsShareableVAO;
GLint m_nMaxSamplesAllowed;
GLint m_nMaxTextureUnits;
char * m_pGlExtensions;
CCDictionary*m_pValueDict;
};
// end of global group
/// @}
NS_CC_END
#endif // __CCCONFIGURATION_H__
相关文章推荐
- 多线程:显示当前程序中所用程序的线程,得到线程的信息(基础功能二)
- 多线程:显示当前程序中的线程,得到线程的信息(基础功能一)
- 可以得到当前系统信息的脚本sysinfo.vbs
- 开发好一个软件功能模块不是光有激情、有干劲、有技术就可以得到成功的
- SQL2000系统表、存储过程、函数的功能介绍及应用2009年01月21日 星期三 11:38虽然使用系统存储过程、系统函数与信息架构视图已经可以为我们提供了相当丰富的元数据信息,但是对于某些特殊的元数据信息,我们仍然需要直接对系统表进行查询。因为SQL
- 获取当前组策略配置的信息
- SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息
- 得到AppSettings中的配置信息的自定义类
- 开发好一个软件功能模块不是光有激情、有干劲、有技术就可以得到成功的
- 得到当前系统信息(公司、用户、日期、语言、数据库信息)
- 服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。
- 【视频】配置信息管理 的 使用方法(四):功能节点维护
- 得到AppSettings中的配置信息的自定义类
- 不用ajax也能实现的功能!单击添加新行时可以删除这一行信息的源码
- 从qglobal.h中可以得到的信息-我们应该多研究优秀软件的源码
- [礼仪大赛策划方案手段]PPT简易的文字编排+网络大量免费的Flash动画+笔记本都具有的扩展桌面双屏支持功能+投影机 就可以打造一场专业的电视台效果时,有何感想?能弃之这些身边的条件而不用吗?
- 继承 System.Windows.Forms.ComboBox 实现支持自动完成功能的 ComboBox!个人感觉还可以!!!
- 在.NET中得到计算机硬件信息的一些功能
- 得到当前系统信息(公司、用户、日期、语言、数据库信息)
- 【视频】配置信息管理 的 使用方法(四):功能节点维护