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

C++ Animate函数代码示例

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

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



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


示例16: Animate

//-------------------------------------------------------------
//- Render
//- Renders the model in its position at time 0
//-------------------------------------------------------------
void CMs3d::Render()
{
	//Note: This function really isn't needed, as it preforms the same basic function
	//      as the render function below.  It is included to provide an implementation of the
	//      Render() function put forth in the CModel class.
	Animate(1.0f, 0.0f, 0.0f, false);
}
开发者ID:jinshizi,项目名称:rushcodes,代码行数:11,代码来源:ms3d.cpp


示例17: ChoosePixelFormat

void CMemoryCardView::CRender::ThreadProc()
{
	unsigned int nPixelFormat = ChoosePixelFormat(m_deviceContext, &m_PFD);
	SetPixelFormat(m_deviceContext, nPixelFormat, &m_PFD);
	m_hRC = wglCreateContext(m_deviceContext);
	wglMakeCurrent(m_deviceContext, m_hRC);

	glEnable(GL_TEXTURE_2D);
	glClearColor(1.0, 1.0, 1.0, 1.0);

	while(!m_threadOver)
	{
		while(m_mailBox.IsPending())
		{
			m_mailBox.ReceiveCall();
		}

		Animate();
		DrawScene();
		Sleep(16);
	}

	m_icons.clear();
	wglMakeCurrent(NULL, NULL);
	wglDeleteContext(m_hRC);
}
开发者ID:250394,项目名称:Play-,代码行数:26,代码来源:MemoryCardView.cpp


示例18: Render

/**-----------------------------------------------------------------------------
 * 화면 그리기
 *------------------------------------------------------------------------------
 */
VOID Render()
{
	UINT nPass;

    /// 후면버퍼와 Z버퍼 초기화
    g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(200,200,200), 1.0f, 0 );
	g_pd3dDevice->SetRenderState( D3DRS_FILLMODE, g_bWireframe ? D3DFILL_WIREFRAME : D3DFILL_SOLID );

	/// 애니메이션 행렬설정
	Animate();
    /// 렌더링 시작
    if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )
    {
		if( g_bUseVS )	// 정점 쉐이더를 사용하여 출력?
		{
			g_pEffect->SetFloat( "g_fTime", (float)(timeGetTime()) / 100 );

			/// 정점선언값과 정점 설정
			g_pd3dDevice->SetVertexDeclaration( g_pDecl );
			g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(MYVERTEX) );

			/// fx출력에 사용할 테크닉 선정
			g_pEffect->SetTechnique( "MyShader" );
			
			/// fx를 사용한 출력개시
			g_pEffect->Begin( &nPass, D3DXFX_DONOTSAVESTATE );

			/// PASS 개수만큼 출력
			for( int i = 0; i < nPass ; i++ )
			{
				g_pEffect->BeginPass( i );
				g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 1 );
				g_pEffect->EndPass();
			}

			/// fx를 사용한 출력종료
			g_pEffect->End();
		}
		else
		{
			// fx를 사용한뒤에는 이 값을 NULL로 해야 D3D고정 파이프라인을 사용할 수 있다.
			g_pd3dDevice->SetVertexShader( NULL );
			g_pd3dDevice->SetPixelShader( NULL );
			g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(MYVERTEX) );
			g_pd3dDevice->SetFVF( MYVERTEX::FVF );
			g_pd3dDevice->SetTexture( 0, g_pTexture );
			g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_MODULATE );	/// MODULATE연산으로 색깔을 섞음
			g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );	/// 첫번째 섞을색은 텍스쳐 색
			g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );	/// 두번째 섞을색은 정점 색
			g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );	/// alpha연산은 사용하지 않음
			g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 1 );
		}

		g_pd3dDevice->EndScene();
    }

    /// 후면버퍼를 보이는 화면으로!
    g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
}
开发者ID:blastingzone,项目名称:ComputerGraphicsAdvenced,代码行数:63,代码来源:main.cpp


示例19: SetAnimationProperties

MAS::Widget *MAS::Window::Popup(MAS::Dialog *p, int xx, int yy, MAS::Widget *f) {
   SetAnimationProperties(skin->winAnimationLength, skin->winAnimationType);

   Animate();
   Widget *ret = Dialog::Popup(p, xx, yy, f);
   ResetAnimation();
   return ret;
}
开发者ID:bambams,项目名称:ma5king,代码行数:8,代码来源:window.cpp


示例20: Animate

void CCyclerSprite::Think( void )
{
	if ( ShouldAnimate() )
		Animate( pev->framerate * (gpGlobals->time - m_lastTime) );

	pev->nextthink		= gpGlobals->time + 0.1;
	m_lastTime = gpGlobals->time;
}
开发者ID:Hammermaps-DEV,项目名称:SOHL-V1.0-Refresh,代码行数:8,代码来源:h_cycler.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Animation函数代码示例发布时间:2022-05-30
下一篇:
C++ AnglesToAxis函数代码示例发布时间: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