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


C++ CCDirector::setOpenGLView方法代码示例

本文整理汇总了C++中CCDirector::setOpenGLView方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::setOpenGLView方法的具体用法?C++ CCDirector::setOpenGLView怎么用?C++ CCDirector::setOpenGLView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCDirector的用法示例。


在下文中一共展示了CCDirector::setOpenGLView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
    
    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(g_nScreenWidth, g_nScreenHeight, kResolutionShowAll);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);
	

    // register lua engine
    CCLuaEngine* pEngine = CCLuaEngine::defaultEngine();
    CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine);
	
	lua_State * pLuaState = ScutDataLogic::LuaHost::Instance()->GetLuaState();

	//CDataRequest::Instance()->RegisterLUACallBack((LUA_DATAHANDLE_CALLBACK)&ScutCxControl::netDataDispatch);
	//CFrameManager::Instance(); 
	char tempPath[MAX_PATH + 1];
	::GetModuleFileNameA(NULL,tempPath, _MAX_PATH + 1);
	string ret((char*)tempPath);
	ret = ret.substr(0,ret.rfind("\\") +  1);

    //std::string path = CCFileUtils::sharedFileUtils()->fullPathForFilename("E:/ND/openSourceEngine/Scutgame/Release.win32/lua/mainapp.lua");
	std::string path =ret +  "lua/mainapp.lua";
	//CFileHelper::executeScriptFile(NdDataLogic::CFileHelper::getPath("lua/mainapp.lua").c_str());
     pEngine->executeScriptFile(path.c_str());

	 CCSize szWin = pDirector->getWinSize();
	 CFileHelper::setWinSize(szWin.width, szWin.height);

    return true;
}
开发者ID:HongXiao,项目名称:Client-source,代码行数:38,代码来源:AppDelegate.cpp

示例2: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

    // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
    // pDirector->enableRetinaDisplay(true);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);
    /* 本来の */
    // create a scene. it's an autorelease object
    CCScene *pScene = HelloWorld::scene();
    
    // run
    pDirector->runWithScene(pScene);
    /**/
    
    /**
    // もしCocosBuildrにしたら
    CCNodeLoaderLibrary * ccNodeLoaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
    CCBReader * ccbReader = new CCBReader(ccNodeLoaderLibrary);
    CCScene * scene = CCScene::create();
    CCNode * node = ccbReader->readNodeGraphFromFile("CCBTest.ccbi");
    
    if(node != NULL) {
        scene->addChild(node);
    }
    ccbReader->release();
    pDirector->runWithScene(scene);
    /**/
    
    return true;
}
开发者ID:shinriyo,项目名称:papwa,代码行数:38,代码来源:AppDelegate.cpp

示例3: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    CCEGLView *pEGLView = CCEGLView::sharedOpenGLView();
    pDirector->setOpenGLView(pEGLView);
    
    //设置view size
    CCSize screenSize = pEGLView->getFrameSize();
    CCSize designSize = CCSize(320, 480);
    
    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionShowAll);
    
    //设置资源路径
    std::vector<std::string> searchPaths;
    if (screenSize.width > 320 ) {  //临时把高清直接从小图放大
        searchPaths.push_back("iphone");    //iphonehd 临时
        pDirector->setContentScaleFactor(1);    //320/designSize.width 临时
    }else {
        searchPaths.push_back("iphone");
        pDirector->setContentScaleFactor(320/designSize.width);
    }
    CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);

    // turn on display FPS
    pDirector->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = BattleField::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:newbdez33,项目名称:march,代码行数:38,代码来源:AppDelegate.cpp

示例4: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
	CCLog("enter applicationDidFinishLaunching...");
    TDCCTalkingDataGA::onStart("2B002F9CD724EB09730AF32CB4D909C3", "");
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

    // turn on display FPS
    //pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);
    pDirector->getOpenGLView()->setDesignResolutionSize(320, 480, kResolutionExactFit);

    // create a scene. it's an autorelease object
    CCScene *pScene = AccountLayer::scene();

    // run
    pDirector->runWithScene(pScene);
    CCLog("exit applicationDidFinishLaunching...");
    return true;
}
开发者ID:CaiZhongda,项目名称:cocos2dx-talkingdata,代码行数:23,代码来源:AppDelegate.cpp

示例5: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

    pDirector->setOpenGLView(pEGLView);
    
    pDirector->setContentScaleFactor(1024.0 / pDirector->getWinSize().width);
	
    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = GameScene::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:ccbn-dh,项目名称:tetris-cocos2dx,代码行数:23,代码来源:AppDelegate.cpp

示例6: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
    
    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(800, 280, kResolutionNoBorder);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    //CCScene *pScene = HelloWorld::scene();
    CCScene* pScene = UIGameFatherLayer::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:aboduo,项目名称:Parkour,代码行数:23,代码来源:AppDelegate.cpp

示例7: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

    pDirector->setOpenGLView(pEGLView);
	
    // turn on display FPS
    //pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);
    
    CCTexture2D::setDefaultAlphaPixelFormat(kCCTexture2DPixelFormat_RGBA4444);

    // create a scene. it's an autorelease object
    CCScene *pScene = MainScene::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:aababy,项目名称:Frame,代码行数:23,代码来源:AppDelegate.cpp

示例8: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());


    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = GameLayer::scene();

    // run
    pDirector->runWithScene(pScene);

	//SimpleAudioEngine::sharedEngine()->preloadEffect(CCFileUtils::sharedFileUtils()->fullPathForFilename("hit.wav").c_str());
    //SimpleAudioEngine::sharedEngine()->preloadEffect(CCFileUtils::sharedFileUtils()->fullPathForFilename("score.wav").c_str());
	return true;
}
开发者ID:hzl2928963,项目名称:Air-Hockey-Box2d,代码行数:23,代码来源:AppDelegate.cpp

示例9: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

	CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960,640,kResolutionNoBorder);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 30);

	CCFileUtils::sharedFileUtils()->addSearchPath("data/start/");

    // create a scene. it's an autorelease object
    CCScene *pScene = CStartScene::scene();

    // run
    pDirector->runWithScene(pScene);
    return true;
}
开发者ID:jonesgithub,项目名称:carrot,代码行数:23,代码来源:AppDelegate.cpp

示例10: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

    pDirector->setOpenGLView(pEGLView);
	
    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / FPS);

    // create a scene. it's an autorelease object
    CCScene *pScene = CCScene::create();
    CCLayer *pSplashLayer = new Splash();
    pSplashLayer->autorelease();
    
    pScene->addChild(pSplashLayer);
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:gf432,项目名称:RealScooer,代码行数:23,代码来源:AppDelegate.cpp

示例11: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
	MyPurchase::sharedPurchase()->loadIAPPlugin();

    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
    pEGLView->setDesignResolutionSize(960.0f, 640.0f, kResolutionNoBorder);
    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = HelloWorld::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:0309,项目名称:cocos2d-x,代码行数:23,代码来源:AppDelegate.cpp

示例12: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    //pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

	CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
	pDirector->setOpenGLView(pEGLView);
	pEGLView->setDesignResolutionSize(640, 600, kResolutionFixedWidth);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = SplashScreen::scene();

    // run
    pDirector->runWithScene(pScene);
    return true;
}
开发者ID:masky5310,项目名称:SixGunChess,代码行数:23,代码来源:AppDelegate.cpp

示例13: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

    // turn on display FPS
//    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);
    
    CCTexture2D::PVRImagesHavePremultipliedAlpha(true);
    CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("tapTownSprites.plist", "tapTownSprites.pvr.ccz");

    // create a scene. it's an autorelease object
    CCScene *pScene = HelloWorld::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:level-two,项目名称:TapTown,代码行数:23,代码来源:AppDelegate.cpp

示例14: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());

    // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
    // pDirector->enableRetinaDisplay(true);

    // turn on display FPS
    pDirector->setDisplayStats(false);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    CCScene *pScene = GameMenu::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:JoeHu,项目名称:book-code,代码行数:23,代码来源:AppDelegate.cpp

示例15: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
	CCDirector* pDirector = CCDirector::sharedDirector();
	CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
	bool isDebug;
#ifndef MEDUSA_DEBUG
	isDebug=false;
#endif

#ifdef MEDUSA_WINDOWS
	isDebug=true;
#endif

	pDirector->setOpenGLView(pEGLView);
	pDirector->setDisplayStats(isDebug);
	pDirector->setAnimationInterval(1.0 / 60); 
	Size2F designSize=PaperConfig::Instance().GetDesignWinSize();
	pEGLView->setDesignResolutionSize(designSize.Width,designSize.Height,kResolutionShowAll);
	PaperGame::Instance().InitRoles();
	PaperGame::Instance().StartWithGameBlackAround();
	PaperGame::Instance().StartWithSelectRole();
	return true;
}
开发者ID:alkaidlong,项目名称:PaperDemo,代码行数:23,代码来源:AppDelegate.cpp


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