Archived

This topic is now archived and is closed to further replies.

Tile scrolling and Fullscreen mode

This topic is 5574 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I''m very tired and maybe i have missed something here, but I want to scroll some tiles using direct3d8. However, I need to create a backbuffer that is large than the actual screen resolution, according to the docs there is no easy way to do this, and I''ve been trying for quite sometime now. The only other thing I can think of is using SetRenderTarget to set the devices render target to a different surface other than the back buffer. However, then there is the problem getting that rendered scene onto the back buffer for display, I''ve tried getting the backbuffer surface and using CopyRects on the two surfaces but this was very slow (like 10fps slow). So, am I making this harder than it needs to be? Have I missed something? Thanks for you time.

Share this post


Link to post
Share on other sites
quote:
Original post by Redline
Okay, I''m very tired and maybe i have missed something here, but I want to scroll some tiles using direct3d8. However, I need to create a backbuffer that is large than the actual screen resolution, according to the docs there is no easy way to do this, and I''ve been trying for quite sometime now.

Most people that do this are thinking of the old computers where you''d scroll a large surface around using various hardware tricks. With the acceleration on today''s cards, there''s almost never a reason to do this. Just redraw the entire screen every frame. Scrolling becomes a matter of moving the viewpoint, not of moving the background.



[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
Yeah, that''s one of the ways I eventually managed to do it. I used SetRenderTarget to blit everything directly to a large surface, then use CopyRects to copy that surface to the backbuffer. This worked quite well, and was quite speedy on my machine (1800XP + GF4) but was still a little slow on older machines.

I have now eliminated the tiles altogether and simply load my large background to a suitable surface (which is create with CreateRenderTarget) and then I blit the required viewpoint position and size from that surface direct to the backbuffer. I did it this way as it''s faster (by ~100fps) then setting the render target then copying and I avoid any cards that may not support the SetRenderTarget functionality. Also, I don''t have to deal with the tiles for a background now.

The only disadvantage is that CopyRects is quite featureless, no scaling, no rotation nothing. The only way around this I think is to use a surface from a texture, and having a texture that large might be problematic.

Share this post


Link to post
Share on other sites