Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rendering to multiple windows SDK #466207
05/31/17 21:12
05/31/17 21:12
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
I have tried everywhere and found that this is the only place to find results.
I am trying to create a second window using the C++ SDK, but I am having trouble rendering to the second window. I have created a new window and Swap Chain (following the Microsoft documentation), but I don't know how else to proceed. IDirect3DDevice9::Begin and IDirect3DDevice9::End calls cause strange results.

Can someone advise me on how to correctly setup a second window in which to render another scene. It is intended to debug render targets at runtime.
Thanks.

Re: Rendering to multiple windows SDK [Re: sheefo] #466367
06/12/17 07:53
06/12/17 07:53
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Do you mean multiple viewports inside the same window, or really multiple windows? In the latter case the simplest way probably would be running several engine instances.

Re: Rendering to multiple windows SDK [Re: jcl] #466508
06/18/17 22:25
06/18/17 22:25
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline OP
User
sheefo  Offline OP
User

Joined: Jul 2006
Posts: 783
London, UK
I intended to have multiple windows with shared resources. I attempted to implement it [blindly] by creating a second HWND and using IDirect3DDevice9::CreateAdditionalSwapChain(). Is this is correct method of implementation?

I have two windows, but I don't know how to differentiate rendering between them. The engine window is GREEN from the call to draw_quad(), but RED when I uncomment IDirect3DDevice9::BeginScene() and IDirect3DDevice9::EndScene(). The second window remains black.

Code:
do {
	if (v(key_esc)) {
		break;
	}

	IDirect3DDevice9* pExtraDevice;
	g_pSwapChain->GetDevice(&pExtraDevice);
	//pExtraDevice->BeginScene();
	pExtraDevice->Clear(0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_RGBA(255, 0, 0, 255), 1.0f, 0x00000000);
	//pExtraDevice->EndScene();
	g_pSwapChain->Present(0, 0, 0, 0, 0);
	pExtraDevice->Release();

	draw_quad(nullptr, _vec(0.0f, 0.0f, 0.0f), nullptr, &v(screen_size), nullptr, (COLOR*)_vec(0.0f, 255.0f, 0.0f), _VAR(100), _VAR(0));
} while (engine_frame());


Re: Rendering to multiple windows SDK [Re: sheefo] #466518
06/19/17 08:23
06/19/17 08:23
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I'm not so deep in DirectX that I can directly answer that question. I would normally suppose that BeginScene() and EndScene() switches rendering to the extra device, and EndScene() and SwapChain->Present() must be called _after_ draw_quad. But maybe you can get better information on a DirectX forum.


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1