Just wondering how one goes about implementing a scrolling background in a 2D game. In direct draw I learned to manipulate the pixels of an image directly. Thus I could place my background to the backbuffer in a way as to simulate it scrolling.
However, I'm not sure about how to implement this method in Direct3D at all (if it is even possible.. i don't know).
I tried a different approach. Can someone tell me if this is OK or if it is a very bad performance idea.
I have a .bmp 640x480 that I want to scroll. So I loaded it into a IPD3DXSPRITE structure and drew it to the screen twice. One right after the other as to simulate a 1280x480 texture and just moved it horizontally.
My second case is a .bmp 1280x182 that I also want to scroll. So I split it up into two 640x182 pieces and did the same steps as above.
Is this a good idea to do? Does drawing 3/4ths of a texture offscreen still require the computer to do stuff. (I.E. Am I wasting unnecessary computing?)
Cause it seems like my program is occasionally hiccuping and all I have is 3 textures loaded and four IPD3DXSPRITE calls per frame..
Should I be restricting my Render() calls via a timer or should I just let it call Render() as much as it can? Cause my program is using nearly 100% of the CPU constantly which doesn't seem kosher to me..
I tried to attach my 2 "scrolling" textures as well as an exe so you could get a visual of what I'm trying to do, but the upload feature is a real ..........' about size...
Anyways thnx for any help.