|
我设置surface如下:
screen = SDL_SetVideoMode(1020,700,32,SDL_HWSURFACE|SDL_ANYFORMAT|SDL_DOUBLEBUF|SDL_FULLSCREEN);
用下面代码填满:
for ( i=0; i<screen->h; ++i ) {
memset(buffer,(i*255)/screen->h,
screen->w*screen->format->BytesPerPixel);
buffer += screen->pitch;
}
填满后用下面代码测flip时间:
t_start=SDL_GetTicks();
SDL_Flip(screen);
t_end=SDL_GetTicks();
dt=t_end-t_start;
printf("%f",dt);
结果竟然要40ms!!
和SDL_UpdateRect(screen,0,0,0,0)用时差不多;
显卡是FX5200,系统是fedora5可以识别
奇怪的是我在vmware上的fedora5测得只要4-6ms
问高手是否初始化时还要考虑其他因素才能对显存操作? |
|