Dying on SDL_Flip.
It seems my SDL program dies whenever I flip pages.
Am I doing something wrong? I haven't drawn anything on screen yet.
screen = SDL_SetVideoMode(800, 600, 16,
SDL_SWSURFACE | SDL_DOUBLEBUF);
nevermind, i figured it out. it was an unrelated pointer thing.
Not sure about SDL - I wrote my own flip code in assembly.
Simply retrieve a pointer from DirectX to the buffer and primary surface.
A faster way would be MMX except that MMX does not allow memory to memory transfers. Besides that the only faster way I know of is REP STOSQ which is only available on the Intel IA-64 Itanium CPU.
When not in fullscreen mode...
you don't need SDL_DOUBLEBUFF
you should'nt use SDL_Flip
*rummages for reference*
God this book is small....
Also, i suggest using macros for screen hieght/width because they are used so often... and its alot easier to change and... yeah.
void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);
void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);
Ex.1 for a 800x600 window:
SDL_UpdateRect(screen, 0, 0, 800, 600)
Ex.2 for a 800x600 window:
rect.x = 0;
rect.y = 0;
rect.w = 800;
rect.h = 600;
SDL_UpdateRects(screen, 1, &rect)