954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

SDL and Background stopping??

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

dakerao
Newbie Poster
24 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

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.

sfuo
Practically a Master Poster
656 posts since Jul 2009
Reputation Points: 164
Solved Threads: 99
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: