當前位置: 首頁>>代碼示例>>C++>>正文


C++ Animate函數代碼示例

本文整理匯總了C++中Animate函數的典型用法代碼示例。如果您正苦於以下問題:C++ Animate函數的具體用法?C++ Animate怎麽用?C++ Animate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Animate函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: Clear

void CExpensiveGiftCtrl::InsertGif(LPCTSTR szFilename,INT nNum)
{
		CString sTmp;
		CPictureExEx* pPicture=(CPictureExEx *)m_pSkinConfContext->GetPictureExEx(szFilename);
		if(pPicture==NULL)
		{
			m_bPicIsOK=FALSE;
			return;
		}
		else
			m_bPicIsOK=TRUE;

		m_cx=pPicture->m_PictureSize.cx;
		m_cy=pPicture->m_PictureSize.cy;
		if (m_cy>61)
			m_cy = 58;
		m_pPicture=pPicture;
        m_nThreadCurrent=0;
	    Clear();
	  	HDC hWinDC =::GetDC(NULL);
		//////////////創建一個GIF的設備/////////////////////
	 	m_hMenDC=CreateCompatibleDC(hWinDC);
		m_hMemBM=CreateCompatibleBitmap(hWinDC,m_pPicture->m_PictureSize.cx,m_pPicture->m_PictureSize.cy);
        SelectObject(m_hMenDC,m_hMemBM);
       	HBRUSH hBrush = CreateSolidBrush(RGB(232,243,255));
	    RECT rect = {0,0,m_pPicture->m_PictureSize.cx,m_pPicture->m_PictureSize.cy};
		FillRect(m_hMenDC,&rect,hBrush);
		Animate();
		::ReleaseDC(NULL,hWinDC);
		::DeleteObject(hBrush);
		SetTimer(1,70,NULL);
	
	
}
開發者ID:kkyoo,項目名稱:TestKTV,代碼行數:34,代碼來源:ExpensiveGiftCtrl.cpp

示例2: Animate

void CXTPPopupControl::OnLButtonDown(UINT nFlags, CPoint point)
{

	if ((GetPopupState() == xtpPopupStateExpanding) && !m_bSplashScreenMode)
	{
		m_nStep = 0;
		Animate(0);
		//kill timer event
		KillTimer(TID_EXPANDING);
		OnShow();
	}

	//test point to pressed controll
	CXTPPopupItem* pPressed = HitTest(point);

	if (m_bAllowMove && (!pPressed || (!pPressed->GetID() && !pPressed->IsButton() && (pPressed->GetCaption().IsEmpty() || !pPressed->IsHyperLink()))))
	{
		TrackMove();
		return;
	}

	//if success test
	if (pPressed)
	{
		m_pPressed = pPressed;
		//set capture
		SetCapture();
		//redraw all valide controls
		RedrawControl();
	}


	CWnd::OnLButtonDown(nFlags, point);
}
開發者ID:killbug2004,項目名稱:ghost2013,代碼行數:34,代碼來源:XTPPopupControl.cpp

示例3: Animate

void HangingLetterSign::LateUpdate()
{
	
	if(mActive)
		Animate();
	
}
開發者ID:kristofe,項目名稱:GameEngine,代碼行數:7,代碼來源:HangingLetterSign.cpp

示例4: return

EXPORT_C TKeyResponse CEikButtonBase::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
	const TInt code=aKeyEvent.iCode;
	if (code==EKeyDownArrow || code ==EKeyUpArrow)
		return(EKeyWasNotConsumed);
    if (aType!=EEventKey)
        return(EKeyWasConsumed);
	CEikButtonBase::TState oldState=State();
   	switch (code)
        {
	case EKeyLeftArrow:
	case EKeyTab:
    case EKeyRightArrow:
		Animate();
	default:
		;
		}
	TKeyResponse ret=EKeyWasNotConsumed;
	if (State()!=oldState)
		{
		ReportEventL(MCoeControlObserver::EEventStateChanged);
		ret=EKeyWasConsumed;
		}
    return ret;
	}
開發者ID:cdaffara,項目名稱:symbiandump-mw1,代碼行數:25,代碼來源:EIKBUTB.CPP

示例5: onIdle

void onIdle ()
/* pre:  glut window is not doing anything else
   post: scene is updated and re-rendered if necessary */
{
  static int oldTime = 0;
	
  if (isAnimating)
    {
		
      int currentTime = glutGet((GLenum)(GLUT_ELAPSED_TIME));
      /* Ensures fairly constant framerate */
      if (currentTime - oldTime > ANIMATION_DELAY)
        {
	  /* animate the scene */
	  Animate();
	  oldTime = currentTime;
	  /* compute the frame rate */
	  computeFPS();
	  /* notify window it has to be repainted */
	  glutPostRedisplay();
        }
        
     idle_tasks();
    }
}
開發者ID:kkharinarayanan,項目名稱:cgass2,代碼行數:25,代碼來源:main.cpp

示例6: Animate

//  Keep the dart stationary relative to the dartboard (move with the dartboard), also allows dart to 
//  scroll off the screen, hides any darts that are entirely off the screen
void Dart::UpdateDart(int BGPos[]) {
	
	int actualloc[2];
	bool wrapping[2] = {false, false};
	actualloc[0] = loc[0] - BGPos[0]-2*8;
	actualloc[1] = loc[1] - BGPos[1]-2*8;

	if (actualloc[0] < 0) {
		actualloc[0] += 512;
		wrapping[0] = true;
	} 
	if (actualloc[1] < 0) {
		actualloc[1] += 256;
		wrapping[1] = true;
	}
	
	Animate();

	if ((wrapping[0] == true && actualloc[0]+8*8 < 512) || (wrapping[1] == true && actualloc[1]+8*8 < 256) ||
		(wrapping[0] == false && actualloc[0] > SCREEN_WIDTH) || (wrapping[1] == false && actualloc[1] > SCREEN_HEIGHT)) {
		SetObject(dartnumber,
		  ATTR0_SHAPE(0) | ATTR0_8BPP | ATTR0_REG | ATTR0_Y(0) | ATTR0_HIDE,
		  ATTR1_SIZE(2) | ATTR1_X(0),
		  ATTR2_ID8(64) | ATTR2_PRIO(2));				
	} else {		
		SetObject(dartnumber,
		  ATTR0_SHAPE(0) | ATTR0_8BPP | ATTR0_REG | ATTR0_Y(actualloc[1]) | ATTR0_AFF | ATTR0_AFF_DBL,
		  ATTR1_SIZE(2) | ATTR1_X(actualloc[0]) | ATTR1_AFF(dartnumber-1),
		  ATTR2_ID8(64) | ATTR2_PRIO(2));	  
	}
	
}
開發者ID:Steelbadger,項目名稱:GBADarts,代碼行數:34,代碼來源:class.cpp

示例7: GetClientRect

void CExpensiveGiftCtrl::OnTimer(UINT nIDEvent) 
{
	if (nIDEvent == 1)
	{
		if(!m_bTrackLeave)
		   m_nPos+=m_nStep;                //開始相對應長度
       	CRect ClientRect;
    	GetClientRect(&ClientRect);
		if(m_nPos < ClientRect.Width()+m_cx*m_nItemNumber)
		{
			if(m_nAnimate==2)
			{
			   m_nAnimate=0;
			   Animate();
			}
			else
				m_nAnimate++;
		}
		Invalidate();                   //全部重刷
	}
	if (nIDEvent == 1300)
	{
		KillTimer(1300);
		OnUpNewRoadItem();
	}
	if (nIDEvent == 1301)
	{
		KillTimer(1301);
		m_bWaitRoadItem=FALSE;
		if(m_pRoadItem->GetCount()!=0)	//後麵有隊列,直接推上
			OnWaitNewRoadItem(TRUE);
	}
	CWnd::OnTimer(nIDEvent);

}
開發者ID:kkyoo,項目名稱:TestKTV,代碼行數:35,代碼來源:ExpensiveGiftCtrl.cpp

示例8: Animate

void CSprite::AnimateThink( void )
{
	Animate( pev->framerate * (gpGlobals->time - m_lastTime) );

	pev->nextthink		= gpGlobals->time + 0.1;
	m_lastTime			= gpGlobals->time;
}
開發者ID:NoFreeWill,項目名稱:MultiplayerSource,代碼行數:7,代碼來源:effects.cpp

示例9: Animate

void TwoDRenderer::Update()
{
    if (animate)
    {
        Animate();
    }
}
開發者ID:Jorge-Morales,項目名稱:SideProject,代碼行數:7,代碼來源:2DRender.cpp

示例10: draw_atlantis

/*
 *-----------------------------------------------------------------------------
 *    Called by the mainline code periodically to update the display.
 *-----------------------------------------------------------------------------
 */
ENTRYPOINT void
draw_atlantis(ModeInfo * mi)
{
	atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];

	Display    *display = MI_DISPLAY(mi);
	Window      window = MI_WINDOW(mi);

	MI_IS_DRAWN(mi) = True;

	if (!ap->glx_context)
		return;

	glXMakeCurrent(display, window, *(ap->glx_context));

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        glPushMatrix();
        glRotatef(current_device_rotation(), 0, 0, 1);
        AllDisplay(ap);
        Animate(ap);
        glPopMatrix();

        if (mi->fps_p) do_fps (mi);
	glXSwapBuffers(display, window);
}
開發者ID:mmarseglia,項目名稱:xscreensaver,代碼行數:31,代碼來源:atlantis.c

示例11: Render

/**-----------------------------------------------------------------------------
 * 화면 그리기
 *------------------------------------------------------------------------------
 */
VOID Render()
{
    /// 후면버퍼와 Z버퍼 초기화
    g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(200,200,200), 1.0f, 0 );

	/// 애니메이션 행렬설정
	Animate();
    /// 렌더링 시작
    if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )
    {
		g_pd3dDevice->SetTexture( 0, g_pTexDiffuse );							/// 0번 텍스쳐 스테이지에 텍스쳐 고정(색깔맵)
		g_pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );	/// 0번 텍스처 스테이지의 확대 필터
		g_pd3dDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0 );		/// 0번 텍스처 : 0번 텍스처 인덱스 사용

		g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_MODULATE);
		g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
		g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );

		DrawMesh( &g_matAni );
		if ( !g_bHideFrustum )
		{
			g_pFrustum->Draw( g_pd3dDevice );
		}

		/// 렌더링 종료
		g_pd3dDevice->EndScene();
    }

    /// 후면버퍼를 보이는 화면으로!
    g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
}
開發者ID:blastingzone,項目名稱:ComputerGraphicsAdvenced,代碼行數:35,代碼來源:HeightMap.cpp

示例12: fnAlarm

void fnAlarm(void)
{
	rt_uint32_t e;
	uint8_t buf,int_m,t=0;
	uint16_t delay1,delay2,strength;
	rt_thread_delay_hmsm(0,0,3,0);
	int_m = (clock_m+5)%60;
	rt_kprintf("It is %d:%d now\nAlarm Level %d\n",clock_h,clock_m,t);
	rt_event_send(reg_event,REG_ALARM_MSK);
	while (rt_mq_recv(key_mq,&buf,sizeof(uint8_t),0)!=RT_EOK)
	{
		if (clock_m==int_m)
		{
			t+=1;
			int_m = (int_m+5)%60;
			rt_kprintf("Alarm Level %d\n",t);
		}
		switch (t)
		{
			case 0: delay1 = 500; delay2 = 4500; strength = 400; break;
			case 1: delay1 = 1000; delay2 = 2000; strength = 600; break;
			case 2: delay1 = 500; delay2 = 500; strength = 800; break;
			default: delay1 = 500; delay2 = 250; strength = 1000; break;
		}
		SetAlarm(strength);
		rt_thread_delay_hmsm(0,0,0,delay1);
		SetAlarm(0);
		Animate(delay2);
	}
	rt_event_recv(reg_event,REG_ALARM_MSK,RT_EVENT_FLAG_OR|RT_EVENT_FLAG_CLEAR,0,&e);
	return;
}
開發者ID:KNCheung,項目名稱:AlarmClockBeta,代碼行數:32,代碼來源:task_alarm.c

示例13: Update

void XboxLightRing::Update(byte err_code, bool isOn){
  if (err_code != 0){
    if (Animation.IsAnimating() == false) Animate(2); // General Error cycle
  }

  if (isOn && err_code == 0 && Animation.IsAnimating() == false){
    if (eColor == 0) { led1r_value = 0; led1g_value = 254; led2r_value = 0; led2g_value = 254;}
    if (eColor == 1) { led1r_value = 254; led1g_value = 254; led2r_value = 254; led2g_value = 254;}
    if (eColor == 2) { led1r_value = 254; led1g_value = 0; led2r_value = 254; led2g_value = 0;}
    if (eColor == 3) { led1r_value = 254; led1g_value = 0; led2r_value = 0; led2g_value = 254;}
    if (eColor == 4) { led1r_value = 0; led1g_value = 0; led2r_value = 0; led2g_value = 0;}
    
  }
  if (isOn == false && err_code == 0 && Animation.IsAnimating() == false){
    led1r_value = 0;
    led1g_value = 0;
    led2r_value = 0;
    led2g_value = 0;
  }

  // Update animations
  Animation.Update();

  // update leds
  analogWrite(led1g, led1g_value);
  analogWrite(led1r, led1r_value);
  analogWrite(led2g, led2g_value);
  analogWrite(led2r, led2r_value);

  if (bHddActive){
    if (analogRead(hddPin) > 100) analogWrite(led1r, analogRead(hddPin));
  }
}
開發者ID:jacobfk20,項目名稱:xbox-FrontPlateController,代碼行數:33,代碼來源:XboxLightRing.cpp

示例14: Animate

void CCyclerSprite::OnTakeDamage( const CTakeDamageInfo& info )
{
	if( m_maxFrame > 1.0 )
	{
		Animate( 1.0 );
	}
}
開發者ID:oskarlh,項目名稱:HLEnhanced,代碼行數:7,代碼來源:CCyclerSprite.cpp

示例15: Animate

int CCyclerSprite::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
	if (m_maxFrame > 1)
		Animate(1);

	return 1;
}
開發者ID:AlexCSilva,項目名稱:cs16-client,代碼行數:7,代碼來源:h_cycler.cpp


注:本文中的Animate函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。