A question about scrolling backgrounds in XNA
I'm working on scrolling backgrounds for my game and I'm kind of stumped on how I should repeat the texture. Thus far I have it so that the background class takes five variables: two floats (one for each axis, both clamped to 0.01 and 1.0), two bools (to see if it should repeat on either axis) and the camera. It draws the texture to a rectangle and the rectangle's position moves with the camera's position multiplied by the appropriate float.

The movement code thus far is just:

    source.X = (int)(camera.Pos.X * scrollX);
    source.Y = (int)(camera.Pos.Y * scrollY);

So what I'd like to do is make it so that the texture repeats on the appropriate axis (or axes) when one or both of the repeat bools is true, but I have no idea how I can do it with my current system. I was thinking I could add three or more rectangles (I usually make my backgrounds pretty big), have them all draw the same texture and move around according to where the camera is, but I'm not exactly sure how I could do that. Any suggestions?
A question about scrolling backgrounds in XNA
===

I'm working on scrolling backgrounds for my game and I'm kind of stumped on how I should repeat the texture. Thus far I have it so that the background class takes five variables: two floats (one for each axis, both clamped to 0.01 and 1.0), two bools (to see if it should repeat on either axis) and the camera. It draws the texture to a rectangle and the rectangle's position moves with the camera's position multiplied by the appropriate float.

The movement code thus far is just:

    source.X = (int)(camera.Pos.X * scrollX);
    source.Y = (int)(camera.Pos.Y * scrollY);

So what I'd like to do is make it so that the texture repeats on the appropriate axis (or axes) when one or both of the repeat bools is true, but I have no idea how I can do it with my current system. I was thinking I could add three or more rectangles (I usually make my backgrounds pretty big), have them all draw the same texture and move around according to where the camera is, but I'm not exactly sure how I could do that. Any suggestions?