Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

I am making a program that uses directdraw fullscreen. The screen doesnt redraw every frame, it makes any changes to the screen on the primary surface as they are needed.

 

When the program starts up, it draws the initial screen on the primary surface.

 

Here is the problem: Sometimes, when the image comes back on the screen, the screen is blank, just the backcolor of my target form. I am not sure why this happens. My best guess is that I am drawing it too early.

 

If I am right, and I don't know if I am, then the solution would be to have the program wait until the resolution has changed and all ready for drawing.

 

Here is the question: Does anyone know how, if possible, you can detect when directx is ready for drawing?

[sIGPIC]e[/sIGPIC]
  • 4 weeks later...
Posted

Note: I know this thread is old, but someone may have a related question in the future.

 

You can check that your owner control is created by testing the Control.Created property. This seems to be common practice among sample code that I've seen. But it sounds like your surface is being lost, which you can check through a try/catch block and catching the SurfaceLostException. When this happens, try to restore the surface and redraw it.

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...