Hello!
For my level loading screen I used to have a LPD3DXEFFECT->SetFloat, bmap_process + draw_quad combination in my on_level event (and beyond because there's more stuff to setup after level_load). This faked a "smooth" transition between levels but was obviously chunky and juddery, putting most of the people off nowadays.

As an improvement I've tried to do multithreaded rendering instead.
I use CreateThread, then in the worker function loop I have code as follows:
Code:
LPDIRECT3DDEVICE9 pd3dDevKu = (LPDIRECT3DDEVICE9)pd3ddev;
if( SUCCEEDED( pd3dDevKu->BeginScene() ) )
{
	either old code from on_level
	or just a plain draw_quad
	or DrawPrimitiveUP
	or nothing at all, no draw instructions

	pd3dDevKu->EndScene();
	pd3dDevKu->Present(NULL, NULL, NULL, NULL);
}


Before level_load in the main thread I set a variable to 1 that encapsulates the previous code. I make sure to not draw anything manually while that secondary thread is running (I put a WaitForSingleObject(MUTEX) around it, just to be sure).

It's working to some degree, all 3 different draw approaches mentioned in the code above (although bmap_process seems to be crashing it easily), however after some level_loads and thus multithreaded drawing the game breaks.
It either gives an error (for bmap_process), closes the game after a 1sec freeze, messes up 2d panels (or rather draw_quad and draw_text, which is what I use) or just shows a frozen screen while the game continues to run normally.

So I assume it's either the fact that I'm *beginning* and *ending* a scene which might conflict (randomly, because of the 2 separate threads) with the engine's rendering process, or *presenting* it to the screen.
I've thought about using let's say render_sky to halt the main rendering process (with a MUTEX) when my other thread is rendering but I think it's already too late at that point (and there's no function that is called after the 2D elements, right?).




Is there any light at the end of my loading screen tunnel, can this be done with the current state of A8?

Thanks.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends