How do I stop this from happening in SDL

http://i.imgur.com/D6M2X.png

where the background just stops. I want it to carry on too the left for ever or atleast the width of the image on the SDL_Surface here is a video to showcase the problem


http://www.youtube.com/watch?v=KROV7eq8RLo

and here is the code

http://pastebin.com/xQguRnVS

If you do not want the background to move then you will have to draw it first then translate the rest of your scene based on the position of your camera or whatever is moving right now. If you want the background to go forever and move it then you will have to tile* the background image on a huge surface (I wouldn't recommend that).

*Not 100% sure if SDL allows you to tile images but I know in OpenGL you can.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.