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

C++ Flip函数代码示例

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

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



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

示例1: SettingsWindowProc

int SettingsWindowProc(PASSPROCVARS Params){
	int r=0;
	r+=cbHighScores.ProcFunction(Params);
	r+=cbPlay.ProcFunction(Params);
	r+=cbExit.ProcFunction(Params);
	r+=cbOptions.ProcFunction(Params);
	r+=cbCredits.ProcFunction(Params);

	if(r){
//DrawString("Setting up alpha table/@", 0, 10, 8);
//DrawString("Setting up alpha table/@", 0, 20, 12);
//DrawString("Setting up alpha table/@", 0, 35, 13);
//DrawString("Setting up alpha table/@", 0, 50, 21);
		Flip(Pass.DDFront);
		Blit(Pass.DDBack, ScreenUnhighlighted, 0,0,640,480,0,0);
	}
	switch(Params.uMsg){
	case WM_PAINT:
		settingsRedrawScreen();
		break;
	case WM_CLOSE:
		Pass.SettingsInfo=SETTINGS_EXIT;
		Pass.ProgramFlow=PF_EXIT;
		break;
	}

return 0;
}
开发者ID:thenfour,项目名称:Archives,代码行数:28,代码来源:settings.cpp


示例2: GL_PUSH

void GSDevice::Present(const GSVector4i& r, int shader)
{
	GSVector4i cr = m_wnd->GetClientRect();

	int w = std::max<int>(cr.width(), 1);
	int h = std::max<int>(cr.height(), 1);

	if(!m_backbuffer || m_backbuffer->GetWidth() != w || m_backbuffer->GetHeight() != h)
	{
		if(!Reset(w, h))
		{
			return;
		}
	}

	GL_PUSH("Present");

	ClearRenderTarget(m_backbuffer, 0);

	if(m_current)
	{
		static int s_shader[5] = {0, 5, 6, 8, 9}; // FIXME

		Present(m_current, m_backbuffer, GSVector4(r), s_shader[shader]);
	}

	Flip();

	GL_POP();
}
开发者ID:B1ackDaemon,项目名称:pcsx2,代码行数:30,代码来源:GSDevice.cpp


示例3: XM7_BitBlt

/*
 *  BITBLT
 */
BOOL XM7_BitBlt(int nDestLeft, int nDestTop, int nWidth, int nHeight,
			int nSrcLeft, int nSrcTop)
{

	AG_Rect srcrect, dstrect;

	if(bUseOpenGL) {
		Flip();
		return TRUE;
	}
	srcrect.x = nSrcLeft;
	srcrect.y = nSrcTop;
	srcrect.w = (Uint16) nWidth;
	srcrect.h = (Uint16) nHeight;

	dstrect.x = nDestLeft;
	dstrect.y = nDestTop;
	dstrect.w = (Uint16) nWidth;
	dstrect.h = (Uint16) nHeight;
		/*
		 * データ転送
		 */
		/*
		 * 擬似インタレース設定をここでやる
		 */
		if (bOldFullScan != bFullScan) {
			if (!bFullScan) {
				RenderSetOddLine();
			} else {
				RenderFullScan();
			}
		}
		bOldFullScan = bFullScan;
		return TRUE;
}
开发者ID:Artanejp,项目名称:XM7-for-SDL,代码行数:38,代码来源:api_draw.cpp


示例4: CreditsProc

int CreditsProc(PASSPROCVARS Params){
	int r=0;
	r+=ccbOK.ProcFunction(Params);
	if(r){
		//we have to flip the screen
		Flip(Pass.DDFront);
		Blit(Pass.DDBack, ddsCredits, 0, 0, 640, 480, 0, 0);
	}
//now handle some messages
	switch(Params.uMsg){
	case WM_CLOSE:
		Pass.ProgramFlow=PF_EXIT;
		CreditsInfo=CREDITS_EXIT;
		break;
	case WM_PAINT:
		ddsCredits->Restore();
		ddsCreditsh->Restore();
		DDReLoadBitmap(ddsCredits,BMP_CREDITS);
		DDReLoadBitmap(ddsCreditsh,BMP_CREDITSH);
		Blit(Pass.DDFront, ddsCredits, 0, 0, 640, 480, 0, 0);
		Blit(Pass.DDBack, ddsCredits, 0, 0, 640, 480, 0, 0);
		break;
	case WM_KEYDOWN:
   	switch(Params.wParam){
      	case VK_ESCAPE:
         	CreditsInfo=CREDITS_EXIT;
         break;
      }
	break;
	}
	return 0;
}
开发者ID:thenfour,项目名称:Archives,代码行数:32,代码来源:credits.cpp


示例5: main

////FUNCTIONS//////////////////
//-----------------------------------------------------------------------------
// Name: Main()
// Desc: Where all work is done
//-----------------------------------------------------------------------------
bool main()
{
	static int nFrames = 0;
	//static CVECTOR shipsVelVector(0.f,0.f,0.f);
	
	if(GetKeyStatus(VK_ESCAPE) == true)
		return(0);
	
	//Clear the surface
	if(!ClrS(lpddsSecondary,&wndRect))//can't be within a lock-Unlock block or u can't blt
		return(0);
	
	DynamicStarField(NULL,800,Sprites[0].physProp.VelVector,nFrames);
	//Sprites[0].DrawSprite(lpddsSecondary);
	MoveShip();
	
	if(bDebugMode)
		DebugInfo(nFrames);
	
	//Flip primary and secondary surfaces
	Flip();
	//Sleep(1000);
	fFrameTime = frameTimer.EndTimerAndRestart();
	nFrames++;
	return(1);
}
开发者ID:scirelli,项目名称:testForDX7,代码行数:31,代码来源:Main.cpp


示例6: parent

Overlay::Overlay(renderer* parent) : parent(parent)
{
	{
		CoreSuspender suspend;
		//parent->zoom(df::zoom_commands::zoom_reset);
		good_viewscreen = false;
		ReadTileLocations();
		copy_from_inner(); 
	}

	front_mutex = al_create_mutex();

	int32_t flags = al_get_new_bitmap_flags();
	if(al_get_current_display() != NULL){
		al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP | ALLEGRO_ALPHA_TEST);
	}
	front = al_create_bitmap(0,0);
	if(al_get_current_display() != NULL){
		al_set_new_bitmap_flags(al_get_bitmap_flags(al_get_backbuffer(al_get_current_display())));
	}
	back = al_create_bitmap(0,0);
	al_set_new_bitmap_flags(flags);

	Flip();
};
开发者ID:bookong,项目名称:stonesense,代码行数:25,代码来源:Overlay.cpp


示例7: DrawTitleDown

////////////////////////////////////////////////////////////
// Draw Tetris Title 
////////////////////////////////////////////////////////////
void DrawTitleDown(int y_cur)
{
	int x, y;
	int y_start_in_image;
	int y_start_in_screen = 0;
	int width, y_temp; 	// For performance
	
	
	y_start_in_image = TETRIS_TITLE_HEIGHT  - y_cur;
	if(y_start_in_image < 0) {
		y_start_in_screen = 0-y_start_in_image;
		y_start_in_image = 0;
	} 
	
	EraseScreenNoFlip();
	width = TETRIS_TITLE_WIDTH / 2;
	
   	for(y = y_start_in_image; y < TETRIS_TITLE_HEIGHT; y++) {
   		y_temp = (y - y_start_in_image) + y_start_in_screen;
		for(x = 0; x < width; x++) {
			PlotPixel(x+10,y_temp, tetrisTitleData[(y*width)+x]);
		}
	}
		
	WaitForVblank();
	Flip();
}
开发者ID:jduranmaster,项目名称:GBA-Tetris,代码行数:30,代码来源:tetris_title.c


示例8: ntohs

bool CxImageSKA::Decode(CxFile *hFile)
{
	if (hFile==NULL)
		return false;

	// read the  header
	SKAHEADER ska_header;
	hFile->Read(&ska_header,sizeof(SKAHEADER),1);

    ska_header.Width = ntohs(ska_header.Width);
    ska_header.Height = ntohs(ska_header.Height);
    ska_header.dwUnknown = ntohl(ska_header.dwUnknown);

	// check header
	if (ska_header.dwUnknown != 0x01000000 ||
		ska_header.Width > 0x7FFF || ska_header.Height > 0x7FFF ||
		ska_header.BppExp != 3)
		return false;

	if (info.nEscape == -1){
		head.biWidth = ska_header.Width ;
		head.biHeight= ska_header.Height;
		info.dwType = CXIMAGE_FORMAT_SKA;
		return true;
	}

	int bpp = 1<<ska_header.BppExp;

	Create(ska_header.Width,ska_header.Height,bpp,CXIMAGE_FORMAT_SKA);
	if (!IsValid())
		return false;

	// read the palette
	int nColors = 1<<bpp;
	rgb_color* ppal = (rgb_color*)malloc(nColors*sizeof(rgb_color));
	if (!ppal) return false;
	hFile->Read(ppal,nColors*sizeof(rgb_color),1);
	SetPalette(ppal,nColors);
	free(ppal);

	//read the image
	hFile->Read(GetBits(),ska_header.Width*ska_header.Height,1);

	//reorder rows
	if (GetEffWidth() != ska_header.Width){
		BYTE *src,*dst;
		src = GetBits() + ska_header.Width*(ska_header.Height-1);
		dst = GetBits(ska_header.Height-1);
		for(int y=0;y<ska_header.Height;y++){
			memcpy(dst,src,ska_header.Width);
			src -= ska_header.Width;
			dst -= GetEffWidth();
		}
	}

	Flip();

	return true;
}
开发者ID:Aliceljm1,项目名称:CxImageVS2010,代码行数:59,代码来源:ximaska.cpp


示例9: Flip

bool wxIDirectFBSurface::FlipToFront(const DFBRegion *region)
{
    // Blit to the front buffer instead of exchanging front and back ones.
    // Always doing this ensures that back and front buffer have same content
    // and so painting to the back buffer will never lose any previous
    // drawings:
    return Flip(region, DSFLIP_BLIT);
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:8,代码来源:wrapdfb.cpp


示例10: SetCapture

//----------------------------------------------------------------------------
bool TestTriTri::OnLButtonDown (int iXPos, int iYPos, unsigned int)
{
    if ( !m_bMouseDown )
    {
        m_bMouseDown = true;
        SetCapture(ms_hWnd);
        m_hDragDC = GetDC(ms_hWnd);

        m_iTriangle = -1;
        m_iSelect = -1;

        if ( 0 <= iXPos && iXPos < GetWidth()
        &&   0 <= iYPos && iYPos < GetHeight() )
        {
            COLORREF kColor = GetPixel(m_hDragDC,iXPos,iYPos);
            iYPos = Flip(iYPos);

            int i;
            for (i = 0; i < 3; i++)
            {
                if ( MouseNearVertex(iXPos,iYPos,m_aiX0[i],m_aiY0[i]) )
                {
                    m_iTriangle = 0;
                    m_iSelect = i;
                    return true;
                }
            }

            for (i = 0; i < 3; i++)
            {
                if ( MouseNearVertex(iXPos,iYPos,m_aiX1[i],m_aiY1[i]) )
                {
                    m_iTriangle = 1;
                    m_iSelect = i;
                    return true;
                }
            }

            if ( MouseInTriangle(iXPos,iYPos,m_aiX0,m_aiY0) )
            {
                m_iTriangle = 0;
                m_iXMouseStart = iXPos;
                m_iYMouseStart = iYPos;
                return true;
            }

            if ( MouseInTriangle(iXPos,iYPos,m_aiX1,m_aiY1) )
            {
                m_iTriangle = 1;
                m_iXMouseStart = iXPos;
                m_iYMouseStart = iYPos;
                return true;
            }
        }
    }

    return true;
}
开发者ID:BackupTheBerlios,项目名称:lwpp-svn,代码行数:59,代码来源:TestTriTri.cpp


示例11: GetAbsOrigin

bool CBounceBomb::IsValidLocation() 
{
	CBaseEntity *pAvoidObject = NULL;
	float flAvoidForce = 0.0f;
	CAI_Hint *pHint;
	CHintCriteria criteria;
	criteria.SetHintType( HINT_WORLD_INHIBIT_COMBINE_MINES );
	criteria.SetFlag( bits_HINT_NODE_NEAREST );
	criteria.AddIncludePosition( GetAbsOrigin(), 12.0f * 15.0f );
	pHint = CAI_HintManager::FindHint( GetAbsOrigin(), criteria );

	if( pHint )
	{
		pAvoidObject = pHint;
		flAvoidForce = 120.0f;
	}
	else
	{
		// Look for other mines that are too close to me.
		CBaseEntity *pEntity = gEntList.FirstEnt();
		Vector vecMyPosition = GetAbsOrigin();
		while( pEntity )
		{
			if( pEntity->m_iClassname == m_iClassname && pEntity != this )
			{
				// Don't lock down if I'm near a mine that's already locked down.
				if( vecMyPosition.DistToSqr(pEntity->GetAbsOrigin()) < MINE_MIN_PROXIMITY_SQR )
				{
					pAvoidObject = pEntity;
					flAvoidForce = 60.0f;
					break;
				}
			}

			pEntity = gEntList.NextEnt( pEntity );
		}
	}

	if( pAvoidObject )
	{
		// Build a force vector to push us away from the inhibitor.
		// Start by pushing upwards.
		Vector vecForce = Vector( 0, 0, VPhysicsGetObject()->GetMass() * 200.0f );

		// Now add some force in the direction that takes us away from the inhibitor.
		Vector vecDir = GetAbsOrigin() - pAvoidObject->GetAbsOrigin();
		vecDir.z = 0.0f;
		VectorNormalize( vecDir );
		vecForce += vecDir * VPhysicsGetObject()->GetMass() * flAvoidForce;

		Flip( vecForce, AngularImpulse( 100, 0, 0 ) );

		// Tell the code that asked that this position isn't valid.
		return false;
	}

	return true;
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:58,代码来源:combine_mine.cpp


示例12: Flip

void CGSHandler::SetVBlank()
{
	{
		Flip();
	}

	std::lock_guard<std::recursive_mutex> registerMutexLock(m_registerMutex);
	m_nCSR |= CSR_VSYNC_INT;
}
开发者ID:Phatcat,项目名称:Play-,代码行数:9,代码来源:GSHandler.cpp


示例13: sPerfMonBase

sPerfMonGpu::sPerfMonGpu(sAdapter *adapter,const char *name) : sPerfMonBase(name)
{
    Adapter = adapter;
    MostRecentFrame = GetFrame();
    MostRecentFrame->Frequency = 1000*1000;
    Current = 0;
    Flip();
    sPerfMonSubsystem_.Add(this);
}
开发者ID:wxthss82,项目名称:fr_public,代码行数:9,代码来源:Perfmon.cpp


示例14: Flip

void CGSHandler::SetVBlank()
{
	if(m_flipMode == FLIP_MODE_VBLANK)
	{
		Flip();
	}

	std::lock_guard<std::recursive_mutex> registerMutexLock(m_registerMutex);
	m_nCSR |= CSR_VSYNC_INT;
}
开发者ID:cmexp,项目名称:Play-,代码行数:10,代码来源:GSHandler.cpp


示例15: Flip

//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void ManagerImplemented::BeginUpdate()
{
	m_renderingSession.Enter();

	if( m_autoFlip )
	{
		Flip();
	}

	m_sequenceNumber++;
}
开发者ID:tasogare66,项目名称:Effekseer,代码行数:14,代码来源:Effekseer.Manager.cpp


示例16: ClearPressStart

////////////////////////////////////////////////////////////
// Clear PRESS START image from screen
////////////////////////////////////////////////////////////
void ClearPressStart()
{
	int x, y;
	for(y = 0; y < TETRIS_TITLE_PRESS_START_HEIGHT; y++) {
		for(x = 0; x < TETRIS_TITLE_PRESS_START_WIDTH/2; x++) {			
			PlotPixel(x+38,y+115,0x00);
		}
	}
	
	WaitForVblank();
	Flip();	
}
开发者ID:jduranmaster,项目名称:GBA-Tetris,代码行数:15,代码来源:tetris_title.c


示例17: GM_ASSERT

bool gmGarbageCollector::Collect()
{
  if(m_fullThrottle)
  {
    m_workLeftToGo = GM_MAX_INT32;
  }
  else
  {
    m_workLeftToGo = m_workPerIncrement;
  }

  m_doneTracing = false;

  if(m_firstCollectionIncrement)
  {
    // Scan each root object and gray it
    GM_ASSERT(m_scanRootsCallback);
    m_scanRootsCallback(m_gmMachine, this);

    m_firstCollectionIncrement = false;
    return false;
  }

  // If any grays exist, scan them first
  if(m_colorSet.AnyGrays())
  {
    if(BlackenGrays()) // Returns 0 if no more grays, and 1 if done with an increment of collection.
    {
      return false; // Out of time, so exit function
    }
  }

  m_doneTracing = true;

#if GM_GC_TURN_OFF_ABLE
  // Turn off gc until almost out of memory.
  // Can only do when allocating black.
  m_gcTurnedOff = true;
#endif //GM_GC_TURN_OFF_ABLE  

  // Let the collect continue until garbage memory has been reclaimed
  // This could be done as an external phase
  if(ReclaimSomeFreeObjects())
  {
    return false;
  }

#if !GM_GC_TURN_OFF_ABLE
  Flip();
#endif //!GM_GC_TURN_OFF_ABLE

  return true;
}
开发者ID:arajar,项目名称:funk,代码行数:53,代码来源:gmIncGC.cpp


示例18: while

void game::gameloop(){
   // Mix_SetPostMix(band_separate, &au);

	//Mix_PlayMusic( music, -1 );
	int score = 0;
	int cooldown = 20;

	while(shouldIQuit() == false)
	{
		if ((cooldown<0)&&au->poll_beat(0)){
			//srand(au.poll_sig(4));
			for (int i =0; i<rand()%10; i++)
			{
				baddie *b = new baddie(this);
				sprite_list.push_back(b);
				cooldown = 10;
			}
		}
		cooldown--;
		keys = SDL_GetKeyState( NULL );

		bg->updateBackground(getWindowSurface());

		std::list<sprite*>::iterator i;

		for(i=sprite_list.begin(); i != sprite_list.end(); ++i) {
			sprite *bees = *i;
			if (bees->removeMe)
			{
				i = sprite_list.erase(i);
				delete bees;
			}
		}

		for(i=sprite_list.begin(); i != sprite_list.end(); ++i) {
			(*i)->moveSprite();
		}

		for(i=sprite_list.begin(); i != sprite_list.end(); ++i) {
			(*i)->renderSprite();
		}
		h->displayText(10,10,"Score: %i0",score/10);
		if ((*sprite_list.begin())->currentState==IDLE){
			if(2*(*sprite_list.begin())->xpos>SCREEN_WIDTH)
			{ score+=2;}
			else {score++;}}
		if ((*sprite_list.begin())->currentState==DYING)score-=3;
		if ((*sprite_list.begin())->currentState==DEAD)score-=6;
		if (score <0) score = 0;

		Flip();
	}
}
开发者ID:omniphobia,项目名称:bassinvaders,代码行数:53,代码来源:game.cpp


示例19: DrawPressStart

////////////////////////////////////////////////////////////
// Draw PRESS START image to screen
////////////////////////////////////////////////////////////
void DrawPressStart()
{
	int x, y;
	
	for(y = 0; y < TETRIS_TITLE_PRESS_START_HEIGHT; y++) {
		for(x = 0; x < TETRIS_TITLE_PRESS_START_WIDTH/2; x++) {
			PlotPixel(x+38,y+115,tetrisTitlePressStartData[(y*TETRIS_TITLE_PRESS_START_WIDTH/2)+x]);
		}
	}
	
	WaitForVblank();
	Flip();
}
开发者ID:jduranmaster,项目名称:GBA-Tetris,代码行数:16,代码来源:tetris_title.c


示例20: m_texture

		Sprite::Sprite(const std::string& filename, GameEngine::GameContext& context, const glm::vec4& destRect, const glm::vec4& uvRect, float depth, float angle, const GameEngine::Rendering::ColourRGBA8& colour, bool flip) :
			m_texture(context.GetResourceManager().GetTexture(filename)),
			m_destRect(destRect),
			m_uvRect(uvRect),
			m_depth(depth),
			m_colour(colour),
			m_angle(angle)
		{
			if (flip)
			{
				Flip();
			}
		}
开发者ID:easdale2010,项目名称:Coatica-Qus-Assult,代码行数:13,代码来源:Sprite.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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