This topic is 4433 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

So I started creating a reusable framework for my projects using Managed DirectX and C++. I tried rendering a simple triangle and a couple seconds into the program the screen blanks out for a second then pops back in for a second or two and repeats this process. I thought maybe it was a problem with the debug runtimes, so I changed to the release and I got the same problem. I stripped out my code for rendering the triangle to see if I get the same problem when I'm just clearing the backbuffer. It took a while, 5 seconds or so, but the problem came up again. Has anyone ever heard of this problem?

Share on other sites
Well my wildest guess would be an issue with the backbuffer?

Share on other sites
Upon further inspection, It appears only to happen in windowed mode, although I couldn't test it out fully before my system quit on me and now the program won't run at all. Probably need a restart. I remember seeing the warning about the lockloader exception when debugging so I'll look into that over the next day or two. Unfortunately, I won't be able to try anything out until Wednesday.

Share on other sites
Usually flickering is associated with the clearing of the backbuffer. When you aren't clearing your backbuffer you will get some sort of flickering.

I hope this helps.
Take care.

Share on other sites
Yes when you render, do you put in a call to yourdevice.Clear()?

Share on other sites
Yeah, its not the window running my app that is flickering, its the whole screen going black.

Share on other sites
- Does it happen with the SDK samples?
- Do you get any debug output? (Enable unmanaged debugging and switch to the debug runtime).

Share on other sites
It doesn't happen when I execute the managed samples in the SDK and I get no errors from directx while debugging, but I do get the loader lock exception.

Share on other sites
Ok, there's a new development. I had my friend run the application on his machine and it runs fine. I updated my video card drivers and it still happens. My video card has been going for a while now, so maybe I need to break down and get a new one.

Share on other sites
If it's in windowed mode, but the whole screen is going black, it sounds like it is trying to change display settings. You don't happen to be calling Reset() a lot or something odd like that do you?

Share on other sites
Quote:
 Original post by Agony... it sounds like it is trying to change display settings. You don't happen to be calling Reset() a lot or something odd like that do you?

Nope. I thought it looked a lot like changing display settings as well. I even stripped down my render function just to make sure I didn't have any Reset's being called. I had it nothing more than

Globals::Device->BeginScene();Globals::Device->Clear(ClearFlags::Target | 		 ClearFlags::ZBuffer |		 ClearFlags::Stencil,		 0xFF0000FF,1.0f,0);Globals::Device->EndScene();Globals::Device->Present();

EDIT: Just confirming that it does indeed only happen in windowed mode.

[Edited by - njpaul on January 4, 2006 3:15:12 PM]

Share on other sites
I'm not familiar with managed apps, so please forgive me if I'm way way off.

But I did have a similar problem once. It was something like (been a while) my window class was trying to clear itself with a black brush or something...

This might've been the culprit.

	ex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);

This can be set to null.

Or maybe possibly something in my LRESULT CALLBACK WinProc having do do with erasing the background. Not sure if these are applicable in managed apps, but if you're stumped maybe look at this sort of thing.

I tried to download my source code from my website but my page nor the hoster's seems to come up :/

Benny

Share on other sites
I'm almost positive it is not my program, but probably my graphics card, now because I just downloaded RenderMonkey and the same thing happens.