当前位置: 首页>>代码示例>>C++>>正文


C++ Flip函数代码示例

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


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


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