Mysterious White Background...

Started by
8 comments, last by nickwinters 20 years ago
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
Advertisement
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
Stay Casual,KenDrunken Hyena
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.
[sub]My spoon is too big.[/sub]
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.
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
Stay Casual,KenDrunken Hyena
I''m using DirectInput. And I do my rendering in the OnPaint Method. Is there a better way to do it?
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
Stay Casual,KenDrunken Hyena
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
Stay Casual,KenDrunken Hyena
hmmm.... I already have that. Hopefully it will all go away once I add sphere mapping.
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.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

This topic is closed to new replies.

Advertisement