Sign in to follow this  
Ivian

DirectX render problem with CEGUI

Recommended Posts

Hi.

I've made a CEGUI test project to check GUI rendering with custom objects on the screen.
But when I run it, it seem to me, that CEGUI blocks backbuffer clearing.

I've tried the MRT, but my graphic card doesn't support it.

Problems looks like that:

[code]while(dx.run()) //winapi etc.
{
dx.device -> BeginScene();
dx.device -> Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0L );

dx.draw.fillRect(0,0,500,500,0xffff0000);
dx.draw.flush();
sys.renderGUI();

dx.end_render(); //end scene & present
};[/code]

[url="http://img269.imageshack.us/i/beztytuulme.jpg/"][img]http://img269.imageshack.us/img269/7602/beztytuulme.th.jpg[/img][/url]
When I move the window.




So what is wrong with it?

Share this post


Link to post
Share on other sites
Reminds me of [url="http://www.gamedev.net/topic/591728-dx9-pinkgreen-fullscreen-flashing/"]this[/url]. Try resetting scissors before you clear:

[code]
dx.device->SetRenderState(D3DRS_SCISSORTESTENABLE, false);
[/code]

Share this post


Link to post
Share on other sites
[code]while(dx.run()) //winapi etc.
{
dx.device -> BeginScene();


dx.device->SetRenderState(D3DRS_SCISSORTESTENABLE, false);

dx.device -> Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0L );

dx.draw.fillRect(0,0,500,500,0xffff0000);
dx.draw.flush();
sys.renderGUI();

dx.end_render(); //end scene & present
};[/code]

This makes the GUI render correctly, but i can't see the red rect. (at the start of app it appear, but on the second while step it is disappearing).

Maybe I set the other render flags uncorrectly?

[code]device -> SetRenderState(D3DRS_LIGHTING, false);
device -> SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
[/code]




Share this post


Link to post
Share on other sites
CEGUI likely screws other render states which lets your fillrect function fail. Either set all relevant render states to make sure your function works or run your app through PIX to see which states get changed. I haven't used CEGUI myself, maybe it has some functionality to reset states automatically.

Edit: Other measures to take (before resorting to PIX):
- Check the result codes of the DX calls in fillrect. Do they fail ?
- If they fail, enable the DirectX debug runtime and check if they have something to complain about.

Share this post


Link to post
Share on other sites

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