示例#1
0
void draw_function( void )
{
	spClearTarget( 0 );

	char buffer[256];
	sprintf(buffer,"FPS: %i",spGetFPS());
	spFontDrawRight( spGetWindowSurface()->w-1, spGetWindowSurface()->h-font->maxheight, -1, buffer, font );
	spFlip();
}
示例#2
0
文件: shmupstage.cpp 项目: pmprog/P01
void ShmupStage::Render()
{
	if( stageFlag < 2 )
		return;

	curGame->Render();
	
	char buffer[256];
	sprintf( buffer, "FPS: %i", spGetFPS() );
	spFontDrawRight( spGetWindowSurface()->w-1, spGetWindowSurface()->h-font->maxheight, -1, buffer, font );
	/*
	sprintf( buffer, "Pos: %i", curGame->Scenery->ScrollLevelPosition );
	spFontDraw( 3, spGetWindowSurface()->h-font->maxheight, -1, buffer, font );
	*/
}
示例#3
0
void draw_schizo( void )
{
	RESET_ZBUFFER
	CLEAN_TARGET((*levelPointer)->backgroundColor)
	spSetZSet( Z_SORTING );
	spSetZTest( Z_SORTING );
	spSetAlphaTest( 1 );

	drawLevel((*levelPointer));

	//HUD (for debug reasons)
	spSetZSet( 0 );
	spSetZTest( 0 );
	spSetAlphaTest( 1 );
	char buffer[256];
	sprintf( buffer, "camera X: %i\ncamera Y: %i\ncollisiontests: %i\nfps: %i\nspeed:%.5i,%.5i",
			(*levelPointer)->currentCamera.x >> SP_ACCURACY-5,(*levelPointer)->currentCamera.y >> SP_ACCURACY-5,
			getCollisionCount(),spGetFPS(),
			(*levelPointer)->choosenPlayer->physicsElement->speed.x,
			(*levelPointer)->choosenPlayer->physicsElement->speed.y);
	spFontDrawRight( screen->w-1, screen->h-font->maxheight*5, -1, buffer, font );
	#if defined ZOOMUP && defined ZOOMDOWN
		#ifdef FIRSTUP
			spScale2XSmooth(screen,dummy_screen);
			spScaleDownSmooth(dummy_screen,screen);
		#else
			spScaleDownSmooth(screen,dummy_screen);
			spScale2XSmooth(dummy_screen,screen);
		#endif
	#elif defined ZOOMUP
		spScale2XSmooth(screen,real_screen);
	#elif defined ZOOMDOWN
		spScaleDownSmooth(screen,real_screen);
	#endif
	if (levelFade > 0) // Fade in
		spInterpolateTargetToColor(0,(levelFade*SP_ONE)/FADE_TIME);
	if (levelFade < 0) // Fade out
		spInterpolateTargetToColor(0,SP_ONE+(levelFade*SP_ONE)/FADE_TIME);
	spFlip();
}