Jump to content
  • Advertisement
Sign in to follow this  
Ivian

DirectX render problem with CEGUI

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

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:

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
};


beztytuulme.th.jpg
When I move the window.




So what is wrong with it?

Share this post


Link to post
Share on other sites
Advertisement
Reminds me of this. Try resetting scissors before you clear:


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

Share this post


Link to post
Share on other sites
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
};


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?

device -> SetRenderState(D3DRS_LIGHTING, false);
device -> SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);





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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!