<div dir="ltr"><div>I was corrected by Henri about that behaviour. I shouldn't use that as a check.<br></div>Regardless, the tests do by themselves amount to the fact that the depth surface remains attached even after we explictly release all our references to it (therefore the refcount is 1 after calling release on the last reference). So after destroying the root surface, the attached surface is also destroyed as it's refcount was 1, and ddraw implicitly calls DeleteAttachedSurface which decrements that refcount to 0, in turn destroying it.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 26, 2015 at 6:26 PM, Aaryaman Vasishta <span dir="ltr"><<a href="mailto:jem456.vasishta@gmail.com" target="_blank">jem456.vasishta@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">About the refcount of the depth surface after render target is destroyed: How about a simple NULL check for lpvtbl?<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 26, 2015 at 5:32 PM, Aaryaman Vasishta <span dir="ltr"><<a href="mailto:jem456.vasishta@gmail.com" target="_blank">jem456.vasishta@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Jun 26, 2015 at 2:32 AM, Stefan Dösinger <span dir="ltr"><<a href="mailto:stefandoesinger@gmail.com" target="_blank">stefandoesinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
</span>Minor issue: I don't think there's a reason to destroy and recreate the surface.<br>
</blockquote></span><div>The other way afaik is to QI surface version >= 3 and then call SetSurfaceDesc. This seemed easier to do so. Is there some other way? <br><br></div><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
> +    IDirectDrawSurface_Release(d3drm_ds);<br>
> +    IDirectDrawSurface_Release(d3drm_surface);<br>
> +    IDirectDrawSurface_Release(ds);<br>
</span>What happens to the depth buffer here? Does it remain attached?<span><font color="#888888"><br></font></span></blockquote><div> <br></div></span><div>At this point (after releasing ds) the refcounts of both ds and render target (i.e. surface) become 1.<br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>