This is my configuration:
Athlon XP 2000+
GeForce4 MX440 64MB DDR AGP4x
Asus A7S333 (SiS333) (BIOS v1004, the latest one)
Windows 98
DirectX 8.1
NVidia GeForce drivers 30.82 (the latest ones)
Dev-C++ 4.9.6.0
SDL 1.2.5a (I’m using libSDL.a and libSDL_main.a from the mingw32 pack. OT:
why don’t you provide SDL for dev-c++ on libsdl.org?)
glSDL 0.3
linker options: -lmingw32 -lSDLmain -lSDL -mwindows -lglSDL -lopengl32
In my test program, I obtain the following results:
1)in software mode, it’s very fast
2)both in hardware and opengl mode, without double buffer, it goes warp
speeds - I can barely see it (however, it flickers)
3)both in hardware and opengl mode, with double buffer, it’s incredibly
slow (about 10ms each frame! There’s no difference if
SDL_Delay(10) is commented out or not!)
If I comment out SDL_Flip, I can’t see anything: that means that I’m using
a real double buffer surface and SDL_Flip doesn’t just do an SDL_UpdateRect
on the whole screen. Also, this way the program terminates real fast, that
means that SDL_Flip is the actual bottleneck in the whole stuff.
CRV?ADER/KY
KnowledgE is PoweR
-------------- next part --------------
#include “glSDL.h”
/*options:
USE_SW directx software
USE_HW directx hardware
USE_HWDB directx hardware, double buffer
USE_GL opengl hardware
USE_GLDB opengl hardware, double buffer
*/
#define USE_SW
SDL_Surface * screen;
int main(int argc, char * argv[])
{
SDL_Rect flrect, clrect;
if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
#ifdef USE_SW
screen = SDL_SetVideoMode(1024,768,32, SDL_SWSURFACE | SDL_FULLSCREEN);
#elif defined USE_HW
screen = SDL_SetVideoMode(1024,768,32, SDL_HWSURFACE | SDL_FULLSCREEN);
#elif defined USE_HWDB
screen = SDL_SetVideoMode(1024,768,32, SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);
#elif defined USE_GL
screen = SDL_SetVideoMode(1024,768,32, SDL_GLSDL | SDL_HWSURFACE | SDL_FULLSCREEN);
#elif defined USE_GLDB
screen = SDL_SetVideoMode(1024,768,32, SDL_GLSDL | SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);
#endif
if( screen == NULL )
{
fprintf(stderr, "Can't set video mode: %s\n", SDL_GetError());
exit(1);
}
flrect.w = flrect.h = 100;
flrect.x = flrect.y = 0;
clrect = flrect;
for( ; flrect.y<500; flrect.x++,flrect.y++) {
SDL_FillRect(screen,&clrect,0x0);
SDL_FillRect(screen,&flrect,0xFF);
#ifdef USE_SW
SDL_UpdateRect(screen,clrect.x,clrect.y,101,101);
#elif defined USE_HWDB
SDL_Flip(screen);
SDL_FillRect(screen,&clrect,0x0);
SDL_FillRect(screen,&flrect,0xFF);
#elif defined USE_GLDB
SDL_Flip(screen);
SDL_FillRect(screen,&clrect,0x0);
SDL_FillRect(screen,&flrect,0xFF);
#endif
clrect = flrect;
//SDL_Delay(10);
}
return 0;
}