Sign in to follow this  

Surface lost question not covered by the tutorial

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

First of all very good tutorial: http://www.gamedev.net/reference/articles/article608.asp ...but I don't really understand the mechanics behind lost surfaces and how I'll fix the problem in practise. I understand the part of setting a bool flag when the app is inactivated/activated. I also understand that surfaces in the video memory can be overwritten when GDI gains control. But when I restore a surface, what is it I actually have to do? Is there a copy of the surface contents in the system memory that I need to copy to VRAM? If so, can that be done by an existing function in Direct Draw? Or do I actually have to reload the information from the bitmap file on my hard drive (in which case it's probably good to have some struct/class to encapsulate surface and filename of the file for better code structure)?

Share this post


Link to post
Share on other sites
looks like I finally found the answer - bitmap has to be manually reloaded from the file. Maybe that should be added to the tutorial? Or maybe the tutorial is too old so nobody except me cares anyway :/. I've seen many wanting to switch to D3D for rendering in 2D - is there any advantage using Direct3D9 if you're only going to render 2D anyway?

Share this post


Link to post
Share on other sites

This topic is 4341 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this