本文整理汇总了C++中setOpenGLView函数的典型用法代码示例。如果您正苦于以下问题:C++ setOpenGLView函数的具体用法?C++ setOpenGLView怎么用?C++ setOpenGLView使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOpenGLView函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto eglView = EGLView::getInstance();
director->setOpenGLView(eglView);
eglView->setDesignResolutionSize(480, 840, ResolutionPolicy::NO_BORDER);
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
auto scene = StartLayer::createScene();
// run
director->runWithScene(scene);
return true;
}
示例2: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
//glview = GLView::createWithFullScreen("Step in time");
glview = GLView::create("Step in time");
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(1366, 768, kResolutionShowAll);
director->setDisplayStats(false);
director->setAnimationInterval(1.0 / 10);
auto scene = MainScene::createScene();
Director::getInstance()->pushScene(scene);
director->runWithScene(scene);
return true;
}
示例3: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = CCQGLView::getInstance();
//glview->setBgColor(Color4B(50, 50, 50, 255));
director->setOpenGLView(glview);
_mainWindow.setGLView(glview->getGLWidget());
_mainWindow.show();
::SetParent(glview->getHWND(), _mainWindow.m_Parent);
// turn on display FPS
director->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();
// run
director->runWithScene(scene);
return true;
}
示例4: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("My Game");
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
glview->setDesignResolutionSize(480.0f,320.0f,ResolutionPolicy::SHOW_ALL);
// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();
// run
director->runWithScene(scene);
return true;
}
示例5: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("HelloTuiCpp");
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(800,480,ResolutionPolicy::EXACT_FIT);
// turn on display FPS
director->setDisplayStats(true);
director->setAnimationInterval(1.0 / 60);
//regist scene
ResoureMgr::getInstance()->registScene();
// run
CSceneManager::getInstance()->runWithScene(LoadScene("Welcome::Welcomeui"));
return true;
}
示例6: Rect
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect("star", Rect(0, 0, 480, 800), 0.8);
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(480, 800, ResolutionPolicy::EXACT_FIT);
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
auto scene = Launch::createScene();
// run
director->runWithScene(scene);
return true;
}
示例7: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::create("My Game");
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
auto scene = LoadingScene::create();
// run
director->runWithScene(scene);
return true;
}
示例8: Rect
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect("albumDemo", Rect(0, 0, 960, 640));
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(640, 1136, ResolutionPolicy::SHOW_ALL);
director->setDisplayStats(false);
director->setAnimationInterval(1.0 / 60);
FileUtils::getInstance()->addSearchPath("res");
auto scene = HelloWorld::createScene();
director->runWithScene(scene);
return true;
}
示例9: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("My Game");
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
auto scene = TestScene::create();
auto layer = TestLayer::create();
layer->setCGFLayerDelegate(scene);
scene->addSceneMainLayer(layer);
director->runWithScene(scene);
return true;
}
示例10: Rect
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect("zeek", Rect(0,0,960,640));
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(612,432, ResolutionPolicy::FIXED_HEIGHT);
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
auto scene = Scene::create();
director->runWithScene(scene);
GameMgr::getInstance()->setGameScene(scene);
auto lastLevel = UserDefault::getInstance()->getIntegerForKey("lastLevel",1);
GameMgr::getInstance()->loadGame(lastLevel);
auto node = CSLoader::getInstance()->createNode("GameSceneUI.csb");
cocos2d::ui::Button* btn = (cocos2d::ui::Button*)node->getChildByName("restartBtn");
btn->addTouchEventListener([](Ref*,cocos2d::ui::Widget::TouchEventType eventType){
if(eventType == cocos2d::ui::Widget::TouchEventType::ENDED)
{
GameMgr::getInstance()->restartCurrentLevel();
}
});
scene->addChild(node,100);
// run
//Layer* levelselectLayer = LevelSelectLayer::create();
//levelselectLayer->setScale(0.2f);
//scene->addChild(LevelSelectLayer::create());
return true;
}
示例11: log
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
log(" ********* 1 ********* ");
if(!glview) {
glview = GLViewImpl::create("My Game");
director->setOpenGLView(glview);
log(" ********* 2 ********* ");
}
log(" ******** 3 ********** ");
// turn on display FPS
//director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
//set design resolution
glview->setDesignResolutionSize(DESIGN_WIDTH_LANDSCAPE, DESIGN_HEIGHT_LANDSCAPE, ResolutionPolicy::NO_BORDER);
// create a scene. it's an autorelease object
//auto scene = HelloWorld::createScene();
auto scene = GameScene::createScene();
// run
director->runWithScene(scene);
//preload sounds
Utils::preloadSounds();
return true;
}
示例12: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::create("My Game");
director->setOpenGLView(glview);
}
//设置适配方式
//宽度适配,以800,480为基础变化
glview->setDesignResolutionSize(640, 1136, ResolutionPolicy::FIXED_WIDTH);
// turn on display FPS
director->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
std::vector<std::string> searchPaths;
searchPaths.push_back("images");//
searchPaths.push_back("Buy");//
searchPaths.push_back("CMGC");
FileUtils *pFileUtils=FileUtils::getInstance();
pFileUtils->setSearchPaths(searchPaths);
// create a scene. it's an autorelease object
auto startScene=ASStartGame::createScene();
// run
director->runWithScene(startScene);
return true;
}
示例13: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("My Game");
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
// auto scene = HelloWorld::createScene();
//auto scene = CHorseRunning::createScene();
// run
//director->runWithScene(scene);
DBManager::Shared()->Init();
FrameManager::Shared()->Init();
NetManager::Shared()->Init();
FrameManager::Shared()->CreateToScene("FrameDefault");
FrameManager::Shared()->CreateToScene("FrameLogo");
//FrameManager::Shared()->CreateToScene("FrameRunning");
//FrameManager::Shared()->CreateToScene("CHorseRunning");
return true;
}
示例14: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
//修改屏幕参数
glview = GLView::create("Flappy Bird");
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(288,512, ResolutionPolicy::SHOW_ALL);
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
//将WelcomeScene作为游戏的第一个场景
auto welcomeScene = WelcomeScene::createScene();
// run
director->runWithScene(welcomeScene);
return true;
}
示例15: Rect
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect("NoNameGame", Rect(0, 0, 320, 568));
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(640, 1136, ResolutionPolicy::FIXED_WIDTH);
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
register_all_packages();
//存储所有文件的
std::vector<std::string> allfile = { DB, ALL_BOY };
//拷贝文件
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)//Android下需要复制数据文件
for (int i = 0; i < allfile.size(); i++){
if (isFileExist(allfile.at(i).c_str()) == false){ //检查文件是否存在 不存在的话 拷贝一份
copyData(allfile.at(i).c_str());
}
}
#endif
// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();
// run
director->runWithScene(scene);
return true;
}