当前位置: 首页>>代码示例>>C++>>正文


C++ setOpenGLView函数代码示例

本文整理汇总了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;
}
开发者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


注:本文中的setOpenGLView函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。