Sign in to follow this  

Getting DirectX to Go Fullscreen In Horizontal Span [FIXED]

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

Hey all, I have this idea for an app that requires me to get DirectX to go fullscreen in horizontal span but also have 2 separate screen buffers that i can write to( so each screen has separate displays). But i have no idea where to start. Was wondering if anyone knew of any good articles or books i could read on this subject. [Edited by - NovaCaine on September 7, 2005 5:19:59 PM]

Share this post


Link to post
Share on other sites
cool, but just so i know what im doing id go something like


// First "Screen"
D3DVIEWPORT9 vp;
vp.X = 0;
vp.Y = 0;
vp.Width = ScreenRes1.Width;
vp.Height = ScreenRes1.Height;
vp.MinZ = NearPlane;
vp.MaxZ = FarPlane;

// Set Veiwport
SetViewport (vp)

// Render stuff on first "Screen"

// Second "Screen"
D3DVIEWPORT9 vp;
vp.X = ScreenRes1.Width;
vp.Y = 0;
vp.Width = ScreenRes2.Width;
vp.Height = ScreenRes2.Height;
vp.MinZ = NearPlane;
vp.MaxZ = FarPlane;

// Set Veiwport
SetViewport (vp)

// Render stuff on second "Screen"


Share this post


Link to post
Share on other sites
YAY :D:D:D

It worked, only thing i had to change was setting the veiwport back to the full backbuffer size to clear it, and add my D3D device pointer in front of the SetVeiwport call.

finished render call looks something like this


// Clear the screen to black (You can change what color it changes to in D3DCOLOR_XRGB).
// Set viewport to whole screen to clear it
D3DVIEWPORT9 vp;
vp.X = 0;
vp.Y = 0;
vp.Width = 1280;
vp.Height = 640;
vp.MinZ = 0.0f;
vp.MaxZ = 1.0f;

m_D3DDevice->SetViewport( &vp );

m_D3DDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_XRGB(255,255,255), 1.0f, 0);

// Tell Direct 3D we are now going to start drawing.
m_D3DDevice->BeginScene();

SetupMatrices();

// Setup Viewport( "Screen" )
vp.X = 0;
vp.Y = 0;
vp.Width = m_iWidth;

m_D3DDevice->SetViewport( &vp );

m_Tiger.RenderModel( m_D3DDevice );

// Shift vp to "Second screen"
vp.X = 640;

m_D3DDevice->SetViewport( &vp );

m_Tiger.RenderModel( m_D3DDevice );


// We are done drawing for this scene.
m_D3DDevice->EndScene();

// Swap the old frame with the new one.
m_D3DDevice->Present(NULL, NULL, NULL, NULL);

Share this post


Link to post
Share on other sites

This topic is 4481 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.

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