Exemple #1
0
	void MainLoop()
	{
		int last_time = SDL_GetTicks();
		int frames = 0;
		//float mean[10];  - will be used for better frame timings
		//int mean_ptr = 0;
		float time_diff = 0.0f;

		
		while(go)
		{
			//Process events
			ProcessEvents();
			
			//run preframes
			PreFrameAll(time_diff);
			
			//paint all
			PaintAll(time_diff);
			
			frames++;
			if(SDL_GetTicks() - last_time >= 1000)
			{
				time_diff = (SDL_GetTicks() - last_time) / (1000.0f * frames);
			}
		}
	}
void Pane::TunnelPaint(Surface* psurface, bool bPaintAll)
{
    if (m_pparent != NULL && !m_bOpaque) {
        psurface->Offset(-m_offset);
        m_pparent->TunnelPaint(psurface, false);    
        psurface->Offset(m_offset);
    }

    if (bPaintAll) {
        PaintAll(psurface);
    } else {
        Paint(psurface);
    }
}