Archived

This topic is now archived and is closed to further replies.

Mysterious White Background...

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

device.Clear(ClearFlags.Target | ClearFlags.ZBuffer , Color.Blue, 1.0f, 0); 
I''m using the above code. Sometimes a white square appears and covers everything. We also sometimes have white lines. Anyone know what causes these? Thanks. -Nick

Share this post


Link to post
Share on other sites
The only thing that comes to mind is that if Windows thinks an app isn''t responding it will white out the display. Maybe your Windows messages aren''t being dealt with properly?

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
Yeah, WindowsXP will automatically blank out a window with its background color (usually white by default) if it determines messages aren''t being processed.

I like pie.

Share this post


Link to post
Share on other sites
It''s still taking in input, and drawing the unit you control, although it is somewhat flickering. I can close it with alt+f4 without any error messages.

Share this post


Link to post
Share on other sites
Is your input coming from DirectInput or windows messages? DirectInput will work even if windows messages are piling up.

I''m assuming you''re using .Net. Are you doing the wacky OnPaint trick?

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
I''m using DirectInput. And I do my rendering in the OnPaint Method. Is there a better way to do it?

Share this post


Link to post
Share on other sites
I''ve never seen the advantage in the OnPaint method and it''s always struck me as a hack.

There are some additional things you have to set up with it. I''d have to check my notes though and they''re at home.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
I thought there was more, but all I could find was that you need to set the style of your window like so:

this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque,true);

Interestingly the .Net docs warn against doing this, but it''s required with the OnPaint hack.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
I don''t know if that still applies, but usually you''d also override WM_ERASEBKGND and simply return TRUE, so windows wouldn''t redraw the background.

Share this post


Link to post
Share on other sites