Jump to content
  • Advertisement
Sign in to follow this  
gameplayprogammer

Rendering a small section of a terrain to....

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

Rendering a small section of a terrain to a specific area on screen. I have a large terrain and i want to show a section of it in a small window within my game screen. Is there a way in DirectX to render to a smaller area on screen and not the whole screen? Also anyone know how to render 2D, say an image at x = 5, y = 5 and with width = 100 and height = 100?

Share this post


Link to post
Share on other sites
Advertisement
To render to a specific portion of the screen only use viewports. If you're using D3D9, look for D3DVIEWPORT9 and IDirect3DDevice9::SetViewport, and have a look at "Programming Guide/Getting Started/Viewports and Clipping" in the docs. Under D3D10 similar counts for D3D10_VIEWPORT, ID3D10Device::RSSetViewports and "Programming Guide/Pipeline Stages/Rasterizer Stage/Getting Started with the Rasterizer Stage"


To render 2D sprites you can use ID3DXSprite or ID3DX10Sprite respectively.

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!