本文整理汇总了C++中setOpenGLView函数的典型用法代码示例。如果您正苦于以下问题:C++ setOpenGLView函数的具体用法?C++ setOpenGLView怎么用?C++ setOpenGLView使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOpenGLView函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:sydnash,项目名称:wexin_planefight,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:Dzhekson6000,项目名称:StepInTime,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:adroitly,项目名称:QtEdit,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:0xiaohui00,项目名称:Cocos2dxUsefulClasses,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:mycone,项目名称:Tui-x,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:likebeta,项目名称:code-snippets,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:1414648814,项目名称:YellowPlane,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:xrlw111201,项目名称:albumDemo,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:nilsun,项目名称:CocosGameFrameWork,代码行数:23,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:enhhh,项目名称:zeek,代码行数:37,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:JoregeSanz,项目名称:MyRepo,代码行数:37,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:mengtest,项目名称:Cocos2d-x_Project,代码行数:37,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:quweiqi,项目名称:HRace,代码行数:37,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:253627764,项目名称:cocos2d-1,代码行数:24,代码来源:AppDelegate.cpp
示例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;
}
开发者ID:yuerain1990,项目名称:SecondGame,代码行数:36,代码来源:AppDelegate.cpp
示例16: Rect
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect("Alienator", Rect(0, 0, 960, 640));
director->setOpenGLView(glview);
}
director->getOpenGLView()->setDesignResolutionSize(960, 640, 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);
FileUtils::getInstance()->addSearchPath("res");
// run
runAlienator();
return true;
}
开发者ID:lynnard,项目名称:alienator,代码行数:24,代码来源:AppDelegate.cpp
示例17: Size
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
Size designResolution = Size(2048, 1536);
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::create("My Game");
glview->setDesignResolutionSize(designResolution.width, designResolution.height, ResolutionPolicy::SHOW_ALL);
director->setOpenGLView(glview);
}
director->setContentScaleFactor(designResolution.height / glview->getFrameSize().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);
// run by customer GameController
GameController::getInstance()->enterStartScene();
return true;
}
开发者ID:KJTang,项目名称:GalGame,代码行数:24,代码来源:AppDelegate.cpp
示例18: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("ChapterTen02");
glview->setFrameSize(640, 360);
director->setOpenGLView(glview);
}
// 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;
}
开发者ID:XINCGer,项目名称:Cocos2d-X_Tools,代码行数:24,代码来源:AppDelegate.cpp
示例19: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::create("Learning Cocos2d-x Game Developement v3.3");
//glview->setFrameSize(800,480);//change window resolution
director->setOpenGLView(glview);
}
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadBackgroundMusic("bgMusic.wav");
CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic("bgMusic.wav",true);
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("enemyKill.wav");
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("fireRocket.wav");
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("gunshot.wav");
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("playerKill.wav");
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("pop.wav");
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("rocketExplode.wav");
// 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 = MainMenu::scene();
// run
director->runWithScene(scene);
return true;
}
开发者ID:Ratel13,项目名称:cc2dx33_wp8Game,代码行数:36,代码来源:AppDelegate.cpp
示例20: Rect
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect("Takigyo", Rect(0, 0, 640, 960));
director->setOpenGLView(glview);
}
cocos2d::Size targetSize = glview->getFrameSize();
// CCLOG("w:%f", targetSize.width);
// CCLOG("h:%f", targetSize.height);
if (targetSize.width/targetSize.height >= 0.74){
glview->setDesignResolutionSize(640, 960, ResolutionPolicy::EXACT_FIT);
} else {
glview->setDesignResolutionSize(640, 960, 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);
FileUtils::getInstance()->addSearchPath("res");
// create a scene. it's an autorelease object
auto scene = MainScene::createScene();
// run
director->runWithScene(scene);
return true;
}
开发者ID:oishoes,项目名称:Takigyo,代码行数:36,代码来源:AppDelegate.cpp
注:本文中的setOpenGLView函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论