Jump to content
  • Advertisement

Archived

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

Sirius

D3D SetViewport problem

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

I'm trying to handle window resizing by just changing the DX objects that need to be changed, instead of shutting down and reinitializing everything. Everything works fine, except that I can't resize the viewport. --- g_Device3D->SetRenderTarget( newBackBuf, NULL ); D3DVIEWPORT2 vpData; vpData.dwSize = sizeof( vpData ); vpData.dwWidth = newX; vpData.dwHeight = newY; vpData.dvClipX = -1.0f; vpData.dvClipWidth = 2.0f; vpData.dvClipY = 1.0f; vpData.dvClipHeight = 2.0f; vpData.dvMinZ = 0.0f; vpData.dvMaxZ = 1.0f; hr = g_Viewport->SetViewport2( &vpData ); if ( FAILED( hr ) ) ReportMessage( DDErrorString( hr ) ); --- I get a DDERR_INVALIDPARAMS error here, but this is an almost exact copy of the code from my InitDirect3D function, which works fine. What's going on? -Sirius Confucius say: Do not disturb sleeping dragon, for you are crunchy and will taste good with ketchup. Edited by - Sirius on 5/10/00 9:26:34 PM

Share this post


Link to post
Share on other sites
Advertisement
Are you using DirectX 7? It''s way better.


HRESULT hr;

// create a 640x480 viewport
D3DVIEWPORT7 vp = { 0, 0,
640, 480,
0.0f, 1.0f
};

hr = d3d_device->SetViewport(&vp);

if( FAILED(hr) )
return hr;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!