Sign in to follow this  
gameplayprogammer

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this