Jump to content
  • Advertisement
Sign in to follow this  
Sandra-24

Could you give me some advice please?

This topic is 4831 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

Here's what I've been trying to accomplish for days now with C# and Managed DirectX. Take a large image about 3500x2400 (I can resize it, make its dimensions a power of 2, split it into 35 512x512 squares etc but I want it around that size) And draw it in a window. Then I want to be able to use the FPS keys WASD to 'scroll' the image. I tried this with just windows forms and the flickering and lag was terrible, hence why I'm here. That's it. I just don't know how to do this, there seems to be many ways, how would you implement the above? For many of you I'm sure this is a trivial task, but I just can't seem to figure out where to begin, if I had a strategy to work towards it would really help me. Thanks, and sorry for littering your forum with threads today. -Sandra

Share this post


Link to post
Share on other sites
Advertisement
I would probably use textured quads through something like D3D. Then you just split up the big image into pieces and then use those as textures on your quads. Move the camera around a little bit and there's your scrolling.

If you're not familiar with D3D check out the samples in the DirectX SDK. Once you can get a triangle diplaying on the screen with a texture then it's a simple step to get to what you're looking for.

Share this post


Link to post
Share on other sites
I think you're doing something wrong. Open the image with ACDSee or equivalent, and scroll. It shouldn't flicker or anything. If it's not too late, I'd advise you to check how you did it with WinForms and do it the right way.

Share this post


Link to post
Share on other sites
http://www.geocities.com/davidayton/CDisplay

Give this a try, unless you really want to program it yourself, in which case I would advise you to break the image up into 512x512 chunks (Your graphics card will thank you for it), then bind the individual chunks to a series of polygons. Also try to cull out anything that isn't in the viewing area.

As for keyboard input, DInput is pretty simple, although you can just use GetAsyncKeyState()

Share this post


Link to post
Share on other sites
I loaded the image in a variety of image editing software and it scrolls well enough to be acceptable. If I wrote a control to display the image into C++ and used the Windows API instead of .NET forms it would work quite well I think. So I'm going to try that first. If that fails I'll fall back on using textured 512x512 quads with directx. Thanks for the advice guys.

-Sandra

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!