• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ s3eDeviceYield函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中s3eDeviceYield函数的典型用法代码示例。如果您正苦于以下问题:C++ s3eDeviceYield函数的具体用法?C++ s3eDeviceYield怎么用?C++ s3eDeviceYield使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: IW_CALLSTACK

int CCApplication::Run()
{
	IW_CALLSTACK("CCApplication::Run");
	
	if ( ! initInstance() || !applicationDidFinishLaunching() )
	{
		return 0;
	}
	
	int64 updateTime = s3eTimerGetMs();
	
	while (!s3eDeviceCheckQuitRequest()) 
	{ 
		int64 currentTime = s3eTimerGetMs();
		if (currentTime - updateTime > m_nAnimationInterval)
		{
			updateTime = currentTime;
			
			s3eDeviceYield(0);
			s3eKeyboardUpdate();
			s3ePointerUpdate();
			
			ccAccelerationUpdate();
			CCDirector::sharedDirector()->mainLoop();
		}
		else 
		{
			s3eDeviceYield(0);
		}
		
	}
	return -1;
}
开发者ID:daoopp,项目名称:WebGame,代码行数:33,代码来源:CCApplication_airplay.cpp


示例2: main

//-----------------------------------------------------------------------------
// Main global function
//-----------------------------------------------------------------------------
int main()
{
#ifdef EXAMPLE_DEBUG_ONLY
    // Test for Debug only examples
#ifndef IW_DEBUG
    DisplayMessage("This example is designed to run from a Debug build. Please build the example in Debug mode and run it again.");
    return 0;
#endif
#endif

    //IwGx can be initialised in a number of different configurations to help the linker eliminate unused code.
    //Normally, using IwGxInit() is sufficient.
    //To only include some configurations, see the documentation for IwGxInit_Base(), IwGxInit_GLRender() etc.
    IwGxInit();

    // Example main loop
    ExampleInit();

    // Set screen clear colour
    IwGxSetColClear(0xff, 0xff, 0xff, 0xff);
    IwGxPrintSetColour(128, 128, 128);
    
    while (1)
    {
        s3eDeviceYield(0);
        s3eKeyboardUpdate();
        s3ePointerUpdate();

        int64 start = s3eTimerGetMs();

        bool result = ExampleUpdate();
        if  (
            (result == false) ||
            (s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN) ||
            (s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN) ||
            (s3eDeviceCheckQuitRequest())
            )
            break;

        // Clear the screen
        IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);
        RenderButtons();
        RenderSoftkeys();
        ExampleRender();

        // Attempt frame rate
        while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
    }
    ExampleShutDown();
    DeleteButtons();
    IwGxTerminate();
    return 0;
}
开发者ID:marmalade,项目名称:applifier,代码行数:62,代码来源:ExamplesMain.cpp


示例3: main

// "main" is the S3E entry point
int main()
{
	Iw2DInit();
    IwUtilInit();
	
	
    // create game object
    pGame = new CGame;

    int currentUpdate = GetUpdateFrame();
    int nextUpdate = currentUpdate;
	s3ePointerUpdate();
    // to exit correctly, applications should poll for quit requests
    while(!s3eDeviceCheckQuitRequest())
    {
        // run logic at a fixed frame rate (defined by UPS)

        // block until the next frame (don't render unless at
        // least one update has occurred)
        while(!s3eDeviceCheckQuitRequest())
        {
            nextUpdate = GetUpdateFrame();
            if( nextUpdate != currentUpdate )
                break;
            s3eDeviceYield(1);
        }

        // execute update steps
        int frames = nextUpdate - currentUpdate;
        frames = MIN(MAX_UPDATES, frames);
        while(frames--)
        {
            pGame->Update(nextUpdate - currentUpdate);
        }
        currentUpdate = nextUpdate;

        // render the results
        pGame->Render();

        // if an application uses polling input the application
        // must call update once per frame
        s3ePointerUpdate();
        s3eKeyboardUpdate();

        // S3E applications should yield frequently
        s3eDeviceYield();
    }

    // clear up game object
    delete pGame;
	Ground::DestroyGround();
	IwUtilTerminate();
	Iw2DTerminate();
	
    return 0;
}
开发者ID:brizee,项目名称:honours,代码行数:57,代码来源:main.cpp


示例4: IW_CALLSTACK

int CCApplication::Run()
{
	IW_CALLSTACK("CCApplication::Run");
	
	s3eBool quitRequested = 0;
    bool bNeedQuit = false;

	if (!applicationDidFinishLaunching() )
	{
		return 0;
	}
	
	uint64 updateTime = 0 ;
	
	while (true) 
	{ 
		updateTime = s3eTimerGetMs();
			
		s3eDeviceYield(0);
		s3eKeyboardUpdate();
		s3ePointerUpdate();
			
		ccAccelerationUpdate();

		quitRequested = s3eDeviceCheckQuitRequest();
		if( quitRequested) {
            CCDirector* pDirector = CCDirector::sharedDirector();
            // if opengl view has been released, delete the director.
            if (pDirector->getOpenGLView() == NULL)
            {
                CC_SAFE_DELETE(pDirector);
                bNeedQuit = true;
            }
            else
            {
                pDirector->end();
            }
		}

		if( bNeedQuit ) {
			break;
		}

        CCDirector::sharedDirector()->mainLoop();

		while ((s3eTimerGetMs() - updateTime) < m_nAnimationInterval) {
			int32 yield = (int32) (m_nAnimationInterval - (s3eTimerGetMs() - updateTime));
			if (yield<0)
				break;
			s3eDeviceYield(yield);
		}
		
	}
	return -1;
}
开发者ID:0309,项目名称:cocos2d-x,代码行数:55,代码来源:CCApplication.cpp


示例5: main

//-----------------------------------------------------------------------------
// Main global function
//-----------------------------------------------------------------------------
int main()
{
#ifdef EXAMPLE_DEBUG_ONLY
    // Test for Debug only examples
#ifndef IW_DEBUG
    DisplayMessage("This example is designed to run from a Debug build. Please build the example in Debug mode and run it again.");
    return 0;
#endif
#endif

    Iw2DInit();

    // Example main loop
    ExampleInit();
    // Set screen clear colour

    while (1)
    {
        s3eDeviceYield(0);
        s3eKeyboardUpdate();
        s3ePointerUpdate();

        int64 start = s3eTimerGetMs();

        bool result = ExampleUpdate();
        if  (
            (result == false) ||
            (s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN) ||
            (s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN) ||
            (s3eDeviceCheckQuitRequest())
            )
            break;

        // Clear the screen
        Iw2DSurfaceClear(0xffffffff);
        RenderSoftkeys();
        ExampleRender();

        // Attempt frame rate
        while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
    }
    ExampleShutDown();
    Iw2DTerminate();
    return 0;
}
开发者ID:marmalade,项目名称:applifier,代码行数:54,代码来源:ExamplesMain_Iw2D.cpp


示例6: main

int main()
{
	IwGxInit();
	IwGxSetColClear(0, 0, 0xff, 0xff);
	IwResManagerInit();
	Iw2DInit();
	setupTextures();
	registerInput();

    const int textWidth = s3eDebugGetInt(S3E_DEBUG_FONT_SIZE_WIDTH);
    const int textHeight = s3eDebugGetInt(S3E_DEBUG_FONT_SIZE_HEIGHT);
    const int width = s3eSurfaceGetInt(S3E_SURFACE_WIDTH);
    const int height = s3eSurfaceGetInt(S3E_SURFACE_HEIGHT);

	sprintf(g_debugButtonEvent, "ButtonEvent:");
	sprintf(g_debugKeyEvent, "KeyEvent:");
	sprintf(g_debugMotionEvent, "MotionEvent:");
	sprintf(g_debugTouchEvent, "TouchEvent:");
	sprintf(g_debugTouchMotionEvent, "TouchMotionEvent:");

	while (!s3eDeviceCheckQuitRequest())
	{
		render();

		// Yield until unyield is called or a quit request is recieved
        s3eDeviceYield(S3E_DEVICE_YIELD_FOREVER);
	}
	destroyTextures();
	Iw2DTerminate();
	IwResManagerTerminate();
	IwGxTerminate();
	return 0;
}
开发者ID:spurdow,项目名称:ouya-sdk-examples,代码行数:33,代码来源:VirtualController.cpp


示例7: main

// "main" is the S3E entry point
int main()
{
	

	if (s3eChartboostAvailable()) {

		s3eChartboostSetAppID("app id");

		s3eChartboostSetAppSignature("app signature");

		s3eChartboostInstall();

		s3eChartboostShowInterstitial("pre-game");
	}



	// to exit correctly, applications should poll for quit requests
	while(!s3eDeviceCheckQuitRequest())
	{
		// S3E applications should yield frequently
		s3eDeviceYield();
	}


	return 0;
}
开发者ID:rocifier,项目名称:s3eChartboost,代码行数:28,代码来源:main.cpp


示例8: main

int main()
{
	Iw2DInit();

	TweenTest* tests = new TweenTest();

	while (!s3eDeviceCheckQuitRequest())
    {
		tests->Update(FRAME_TIME);

		Iw2DSurfaceClear(0xff000000);

		//tests->Render();

		Iw2DSurfaceShow();
		
		s3eDeviceYield(0);
	}

	delete tests;

	Iw2DTerminate();

	return 0;
}
开发者ID:Tr0ma,项目名称:confitureplease,代码行数:25,代码来源:main.cpp


示例9: main

int main()
{
	// Start up Virtual Piggy
	VirtualPiggy::Create();
	VIRTUAL_PIGGY->Init(VIRTUAL_PIGGY_API_KEY);
	VIRTUAL_PIGGY->setMerchantID(VIRTUAL_PIGGY_MERCHANT_ID);

	// TESTS: Run each test individually
//	TEST_ParentPurchase();
//	TEST_ChildPurchase();
//	TEST_ChildPurchaseSubscription();
//	TEST_ParentPurchaseSubscription();
//	TEST_GetChildAddress();
//	TEST_GetChildGenderAge();
//	TEST_GetLoyaltyBalance();
//	TEST_GetParentAddress();
//	TEST_GetParentChildAddress();
//	TEST_MerchantCancelSubscription();
	TEST_PingHeaders();

	// Marmalade main loop
	while (!s3eDeviceCheckQuitRequest())
	{
		VIRTUAL_PIGGY->Update();
		s3eDeviceYield(0);
	}

	// Shut down Virtual Piggy
	VIRTUAL_PIGGY->Release();
	VirtualPiggy::Destroy();

    return 0;
}
开发者ID:VirtualPiggyInc,项目名称:VirtualPiggy,代码行数:33,代码来源:Main.cpp


示例10: IwMain

//--------------------------------------------------------------------------
// Main global function
//--------------------------------------------------------------------------
S3E_MAIN_DECL void IwMain()
{
#ifdef EXAMPLE_DEBUG_ONLY
    // Test for Debug only examples
#endif

    // Example main loop
    ExampleInit();
    uint64 timeOld = s3eTimerGetMs();
    while (1)
    {
        s3eDeviceYield(0);
        s3eKeyboardUpdate();
        s3ePointerUpdate();

        uint64 timeNew = s3eTimerGetMs();
        float dt = (timeNew - timeOld) * 0.001f;
        timeOld = timeNew;

        bool result = ExampleUpdate(dt);
        if (
            (result == false) ||
            (s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)||
            (s3eKeyboardGetState(s3eKeyLSK) & S3E_KEY_STATE_DOWN)||
            (s3eDeviceCheckQuitRequest())
        )
            break;
        ExampleRender();
        //s3eSurfaceShow();
    }
    ExampleShutDown();
}
开发者ID:marmalade,项目名称:project-ball,代码行数:35,代码来源:main.cpp


示例11: main

int main()
{
	Iw2DInit();
	CIw2DImage* g_AirplayLogo = Iw2DCreateImage("largeAirplayLogo.bmp");
	while (1)
	{
		int64 start = s3eTimerGetMs();
		if	(s3eDeviceCheckQuitRequest())
			break;
		// Clear the screen
		Iw2DSurfaceClear(0xffffffff);
		CIwSVec2 topLeft = CIwSVec2((int16)(Iw2DGetSurfaceWidth() / 2 - g_AirplayLogo->GetWidth() / 2), 
			(int16)(Iw2DGetSurfaceHeight() / 2 - g_AirplayLogo->GetHeight() / 2));
		CIwSVec2 size = CIwSVec2((int16)g_AirplayLogo->GetWidth(), (int16)g_AirplayLogo->GetHeight());
		Iw2DDrawImage(g_AirplayLogo, topLeft, size);
		Iw2DSurfaceShow();

		// Attempt frame rate
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
		{
			int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
			if (yield<0)
				break;
			s3eDeviceYield(yield);
		}
	}
	delete g_AirplayLogo;
	Iw2DTerminate();
	return 0;
}
开发者ID:etgarcia,项目名称:AS3-for-Airplay-SDK,代码行数:30,代码来源:Learn.cpp


示例12: IwMain

//--------------------------------------------------------------------------
// Main global function
//--------------------------------------------------------------------------
S3E_MAIN_DECL void IwMain()
{
#ifdef EXAMPLE_DEBUG_ONLY
	// Test for Debug only examples
#endif
	onInit();
	while (1)
	{
		s3eDeviceYield(0);
		s3eKeyboardUpdate();
		bool result = onUpdate();
		if (
			(result == false) ||
			(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)
			||
			(s3eKeyboardGetState(s3eKeyLSK) & S3E_KEY_STATE_DOWN)
			||
			(s3eDeviceCheckQuitRequest())
			) {
			break;
		}
		onRender();
		s3eSurfaceShow();
	}
	onShutDown();
}
开发者ID:yjpark,项目名称:shortcut,代码行数:29,代码来源:ShortcutMain.cpp


示例13: stop

COggVorbisFileHelper::~COggVorbisFileHelper()
{
	stop();
	bStopDecoding = true;
	while(mDecThread.thread_status == CThread::TRUNNING) 
	{
		s3eDebugTracePrintf("waiting decoding thread terminating\n");
		s3eDeviceYield(10);
	}

	if(mDecBuffer != NULL)
	{
		delete mDecBuffer;
		mDecBuffer = NULL;
	}
	//cleanup();

	if(res_contR)	speex_resampler_destroy(res_contR);
	if(res_contL)	speex_resampler_destroy(res_contL);

	delete [] iFilterBufferL;
	delete [] iFilterBufferR;
	delete [] dFilterCoefficients;

	delete [] m_outL;
	delete [] m_outR;

	/*if(nStatus != OH_NAN) ov_clear(&vf);*/
	
}
开发者ID:arf-it,项目名称:marmalade-libvorbis,代码行数:30,代码来源:oggHelper.cpp


示例14: main

S3E_MAIN_DECL int main()
{
    s3eBool available = FortumoAvailable();
    
	Fortumo_SetLoggingEnabled(true);
	
    while(!s3eDeviceCheckQuitRequest()) {
        s3eDeviceYield(0);
        s3ePointerUpdate();
        s3eDebugPrint(0, 30, (available) ? "Fortumo (OK)" : "Fortumo (ERR)", 0);
        s3eSurfaceShow();
        
        if(available && (s3ePointerGetState(S3E_POINTER_BUTTON_SELECT) & S3E_POINTER_STATE_PRESSED)) {
            Fortumo_PaymentRequest *request = Fortumo_PaymentRequest_Create();
            
            Fortumo_PaymentRequest_SetDisplayString(request, "display_string_here");
            Fortumo_PaymentRequest_SetService(request, "service_id_here", "app_secret_here");
            Fortumo_PaymentRequest_SetProductName(request, "product_name_here");
            Fortumo_PaymentRequest_SetConsumable(request, true);
            Fortumo_MakePayment(request, &Fortumo_OnPaymentComplete, NULL);
            Fortumo_PaymentRequest_Delete(request);
        }
    }
    
    return 0;
}
开发者ID:marmalade,项目名称:Fortumo,代码行数:26,代码来源:DemoPayment.cpp


示例15: main

// Main entry point for the application
int main()
{
	int i = 0;
	bool hidden = false;
	bool adsAvailable = false;
	bool noView = false;

	if(AdmobAdsAvailable()){
		InitAds("a14bd815ee70598");
		adsAvailable = true;
	}

		
    // Wait for a quit request from the host OS
    while (!s3eDeviceCheckQuitRequest())
    {
        

		// Fill background blue
        s3eSurfaceClear(0, 0, 255);

        // Print a line of debug text to the screen at top left (0,0)
        // Starting the text with the ` (backtick) char followed by 'x' and a hex value
        // determines the colour of the text.
        s3eDebugPrint(120, 150, "`xffffffHello, World!", 0);

		if (noView){
			s3eDebugPrint(120, 190, "`xff1111No view", 0);
		}else{
			s3eDebugPrint(120, 190, "`x11ff11Ok", 0);
		}

        // Flip the surface buffer to screen
        s3eSurfaceShow();

        // Sleep for 0ms to allow the OS to process events etc.
        s3eDeviceYield(1);

		if(adsAvailable){
			i++;

			if(i>15000){
				i = 0;
				if (hidden) {
					noView = ShowAds() != 0;
				} else {
					noView = HideAds() != 0;
				}

				hidden = !hidden;
			}
		}

		s3eKeyboardUpdate();
		if(s3eKeyboardGetState(s3eKeyBack) & S3E_KEY_STATE_DOWN){
			break;
		}
    }
    return 0;
}
开发者ID:chinnurtb,项目名称:admob1,代码行数:61,代码来源:s3eHelloWorld.cpp


示例16: Notify

	bool Notify(CIwUIElement* pReceiver, CIwEvent* pEvent)
	{
		int id = pEvent->GetID();

		if (id == IWUI_EVENT_CLICK)
		{
			CIwUIEventClick* a = (CIwUIEventClick*)pEvent;
			
			if (!a->GetPressed())
			{
				EventStruct x;
				x.pReceiver = pReceiver;
				x.pEvent = IW_GX_ALLOC(CIwUIEventClick, 1);

				memcpy(x.pEvent, a, sizeof(CIwUIEventClick));

				g_events.append(x);

				return true;
			}
		}

		return CIwUIController::Notify(pReceiver, pEvent);
		if (pEvent->GetSender())
		{
			s3eDeviceYield(0);
			return true;
		}
		return CIwUIController::FilterEvent(pEvent);
	}
开发者ID:nbclark,项目名称:firefly-mp,代码行数:30,代码来源:FireflyMain.cpp


示例17: endOfGame

void endOfGame()
{
	SplashInit();
	SplashUpdate("continue");
	SplashRender();
	IwGxLightingOn();
	gameFinalRender();
	IwGxFlush();
	IwGxSwapBuffers();

	while(!s3eDeviceCheckQuitRequest())
	{
		int64 start = s3eTimerGetMs();
		while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
			
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
		if (g_Input.getTouchCount() != 0)
		{
			s3eResult g_result = s3eOSExecExecute("http://www.facebook.com/Baconbb10", true);
		}
	}
}
开发者ID:ironwk85,项目名称:AgentBacon,代码行数:27,代码来源:main.cpp


示例18: s3eDeviceYield

	//! runs the device. Returns false if device wants to be deleted
	bool CIrrDeviceMarmalade::run()
	{
		s3eDeviceYield();
		s3ePointerUpdate();
		s3eKeyboardUpdate();
		os::Timer::tick();
		return !Close;
	}
开发者ID:damucz,项目名称:irrlicht,代码行数:9,代码来源:CIrrDeviceMarmalade.cpp


示例19: IwGxFlush

void N2F::Iw3D::Iw2DHelper::EndTick()
{
	IwGxFlush();
	Iw2DSurfaceShow();
	s3eDeviceYield(0);

	return;
}
开发者ID:zibings,项目名称:n2fmarmalade,代码行数:8,代码来源:Iw2D.cpp


示例20: IW_CALLSTACK

int CCApplication::Run()
{
	IW_CALLSTACK("CCApplication::Run");
	
	s3eBool quitRequested = 0;

	if ( ! initInstance() || !applicationDidFinishLaunching() )
	{
		return 0;
	}
	
	int64 updateTime = s3eTimerGetMs();
	
	while (true) 
	{ 
		int64 currentTime = s3eTimerGetMs();
		if (currentTime - updateTime > m_nAnimationInterval)
		{
			updateTime = currentTime;
			
			s3eDeviceYield(0);
			s3eKeyboardUpdate();
			s3ePointerUpdate();
			
			ccAccelerationUpdate();

			quitRequested = s3eDeviceCheckQuitRequest() ;
			if( quitRequested && CCDirector::sharedDirector()->getOpenGLView() != NULL ) {
				CCDirector::sharedDirector()->end() ;
				// end status will be processed in CCDirector::sharedDirector()->mainLoop();
			}

			CCDirector::sharedDirector()->mainLoop();

			if( quitRequested ) {
				break ;
			}
		}
		else 
		{
			s3eDeviceYield(0);
		}
		
	}
	return -1;
}
开发者ID:Glikeme,项目名称:cocos2dx-webos,代码行数:46,代码来源:CCApplication_marmalade.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ s3eEdkJNIGetEnv函数代码示例发布时间:2022-05-30
下一篇:
C++ s3cdbg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap