当前位置: 首页>>代码示例>>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;未经允许,请勿转载。