Thread: problem with sdl_flip()

  1. #1
    Registered User
    Join Date
    May 2009

    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.

    #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");
        Image image;
        SDL_Surface *message;
        message = image.loadBMPImage("");
        image.applySurface(0, 0, message, system.screen);

  2. #2
    Professional Chef leeor_net's Avatar
    Join Date
    Apr 2004
    Charles Town, WV
    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.
    - Leeor

  3. #3
    Registered User \007's Avatar
    Join Date
    Dec 2010
    You didn't init SDL?

  4. #4
    Registered User
    Join Date
    May 2009
    possibly im not sure. I decided to move on from this and I did it in another project and everything works fine

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM