• Advertisement
Sign in to follow this  

SlimDX background color

This topic is 1327 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,

 

how can I set background color in SlimDX ? I am using SlimDX.Direct3D9. Folowwing lines do not work. i see black background still.

 

     SlimDX::Color4 bkcolor( 255.0f, 65.0f, 255.0f, 25.0f );    
     sl_device->Clear( SlimDX::Direct3D9::ClearFlags::All, bkcolor, 1.0f, 0 ); 
 
    sl_device->BeginScene(); 
 
     ... etc.... 
 
thanks 

Share this post


Link to post
Share on other sites
Advertisement

Hello, this should help:

 

        sl_device->Clear( ClearFlags::Target | ClearFlags::ZBuffer, 0xffff0000 , 1.0f, 0);  

Share this post


Link to post
Share on other sites
It does indeed fail. Actually, SlimDX throws an exception on failing calls (Configuration.ThrowOnError is enabled by default). Did you disable it ?
 
Also, I already recommended the The DirectX Debug Runtime. It will (usually) tell you exactly what went wrong. If you can't get those messages in Visual Studio, use DebugView (linked to in that article).Use it!

Share this post


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

  • Advertisement