Bugzilla – Attachment 65766 Details for
Bug 146792
slow libSDL screen updates w/ composite
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
program to test SDL screen update speed
testfps.cpp (text/plain), 1.07 KB, created by
Martin Bickel
on 2006-01-30 21:23:28 UTC
(
hide
)
Description:
program to test SDL screen update speed
Filename:
MIME Type:
Creator:
Martin Bickel
Created:
2006-01-30 21:23:28 UTC
Size:
1.07 KB
patch
obsolete
>/* >prerequisite packages: > SDL > SDL-devel > >to compile: > g++ -I/usr/X11R6/include -I/usr/include/SDL -D_REENTRANT -c testfps.cpp > g++ -o testfps testfps.o -lm -lSDL -lpthread > >*/ > >#include <stdio.h> >#include <stdlib.h> > >#include "SDL.h" > >int main() >{ > /* Initialize SDL */ > if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { > fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); > exit(1); > } > atexit(SDL_Quit); > > int video_bpp; > const SDL_VideoInfo *info = SDL_GetVideoInfo(); > if ( info->vfmt->BitsPerPixel > 8 ) { > video_bpp = info->vfmt->BitsPerPixel; > } else { > video_bpp = 16; > fprintf(stderr, "forced 16 bpp mode\n"); > } > > SDL_Surface *screen; > if ( (screen=SDL_SetVideoMode(1000,700,video_bpp,SDL_SWSURFACE)) == NULL ) { > fprintf(stderr, "Couldn't set video mode: %s\n", SDL_GetError()); > exit(2); > } > > int time = 10; > Uint32 ticks1 = SDL_GetTicks(); > Uint32 ticks2; > int frames = 0; > > do { > SDL_UpdateRect(screen, 0, 0, 0, 0); > ++frames; > ticks2 = SDL_GetTicks(); > } while ( ticks2 - ticks1 < time * 1000 ); > > printf("%d fps\n", frames / time ); > return(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 146792
: 65766