Hello again,
so here is the init routine:
if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO )
< 0 )
{
return;
}
back_buff = SDL_SetVideoMode( 800, 600, 16, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL );
if ( back_buff ) {
set_rectangle( screen_rect, 0, 0, 800, 600 );
SDL_ShowCursor( SDL_DISABLE );
return;
}
The bitmap surfaces are loaded via LoadBitmap and converted to screen format using SDL_DisplayFormat.
My blit looks like this:
SDL_BlitSurface( background, NULL, back_buff, NULL );
SDL_BlitSurface( fruits[ball->type()], NULL, back_buff, &ball->r );
SDL_BlitSurface( paddels[0], NULL, back_buff, &player1->r );
SDL_BlitSurface( paddels[0], NULL, back_buff, &player2->r );
I could improve the framerate by using SDL_DisplayFormat, but 60 fps aren’t too much for a simple game like pong. My vertical refresh rate is 85 Hz, so it should produce at least 25 frames more.
Thank you,
Marc