• Advertisement
Sign in to follow this  

Render frame in dual screen (fullscreen mode)

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

Hello everybody,


I’d like to render frame on D3D9 using two screens in fullscreen mode.
For example :
I have two screens resolution 1024x768.
So I’d like to render frame in 2048 x 768 same time on two screens.
How must I program based on D3D9?

I tried somethings, but I don't find the soluce.

Here is some my code :

[source lang="cpp"]
#define SCREEN_WIDTH 2048
#define SCREEN_HEIGHT 768
[/source]

[source lang="cpp"]
ZeroMemory(&wc, sizeof(WNDCLASSEX));

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.lpszClassName = L"WindowClass";

RegisterClassEx(&wc);

hWnd = CreateWindowEx(NULL, L"WindowClass", L"Our Direct3D Program",
WS_EX_TOPMOST | WS_POPUP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
NULL, NULL, hInstance, NULL);[/source]

[source lang="cpp"]
d3d = Direct3DCreate9(D3D_SDK_VERSION);

D3DPRESENT_PARAMETERS d3dpp;

ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = FALSE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = hWnd;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferWidth = SCREEN_WIDTH;
d3dpp.BackBufferHeight = SCREEN_HEIGHT;

d3d->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&d3ddev);[/source]


Regards,
Chrisoft.

Share this post


Link to post
Share on other sites
Advertisement
AFAIK, the only way to render to two screens with Dx9 is to create two separate, fullscreen devices. You would have to duplicate all resources on both devices. When rendering, you draw with each device, with the view matrices adjusted so that each monitor is drawing half of the full view.

You could use Dx in non-fullscreen exlusive mode, where you just have one large window with no borders that covers the entire screen (e.g. WoW and Eve have this as an option). Then you would only need one device. Edited by turch

Share this post


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

  • Advertisement