🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

scrolling engine

Started by
3 comments, last by ECKILLER 24 years, 5 months ago
Hi I want to make a zeldaish game in DX, but i don''t know how to do the scrolling. Dont really want an engine, but want to know how to make my own. ECKILLER
ECKILLER
Advertisement
If your tile rendering routine is quick enough, its often easier just to redraw the frame rather than worry about moving it. Add an "OffsetX and OffsetY" into your renderer, and add it to every X,Y tile reference. That gives you pixel-level scrolling. Just be sure to enable clipping and draw one set of tiles too-many on the side thats coming onto the screen. If that doesn''t make sense, say so... I haven''t had enough coffee today.
I think that''s pretty much the only way to do scrolling on DirectX. It doesn''t seem to support primary surfaces bigger than the screen or have any "view window" things or anything. It supports Mode-X (sorta), but I''m not sure how well the modern display cards support Mode-X or other VGA unchained modes (utilizing those was the primary way of scrolling on PCs before). But don''t worry - pretty much every game nowadays redraws the screen at least once every frame.
The only other way I''ve heard of people doing it involves loading a level into an enormous bitmap, and then blitting just the appropriate section to the screen. Since you can use fastblt (no clipping), they get pretty impressive frame rates on older computer. Sadly, they also use up the computers RAM really fast with this approach!
I''ve been into tile scrolling a few years now, first on the
wonderful Amiga and now with DX (back to basic). I think the only good way is to render the screen every frame, don''t use fastblt because this only blits video memory to video memory very fast. Just copy tiles one by one to you''re video memory (from normal ram), if you use an optimized copy routine (write your own) and don''t use the standard blit routine''s because they lack speed, you''ll be amazed by the result.

This topic is closed to new replies.

Advertisement