-
problem with sdl_flip()
Okay so ive been through lazy foos tutorial.. now im attempting to make a pong game, but now SDL_flip is giving me a problem.. when I comment it out my code runs fine.. I get a return 3.
Code:
#include <string>
#include "SDL\SDL.h"
#include "system.h"
#include "Image.h"
#define BPP 32
#define SCREEN_W 640
#define SCREEN_H 320
SDL_Surface* display = NULL;
int main(int argc, char* args[])
{
System system(SCREEN_W, SCREEN_H, BPP, "Pong");
system.init();
Image image;
SDL_Surface *message;
message = image.loadBMPImage("");
image.applySurface(0, 0, message, system.screen);
SDL_Flip(display);
SDL_Delay(2000);
system.cleanUp();
}
-
This is probably better off on SDL's mailing list but I'll see if I can help.
The problem here is you're not showing how you initialize SDL. What surface parameters are you setting when you set the display mode?
If you're having a problem when SDL_flip() is being called and not when it's commented out, you probably didn't set your screen mode to include SDL_DOUBLEBUF.
I assume you create the screen mode in your system class so check that first.
-
-
possibly im not sure. I decided to move on from this and I did it in another project and everything works fine