• Advertisement

Archived

This topic is now archived and is closed to further replies.

GDI and DirectX

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

I wrote myself a lovely set of macros to help with debugging, which wrote various useful informations to the screen using the GDI TextOut function. This works fine until i start double buffering, at which point the GDI continues to write only to the area of memory containing the original primary surface. Basically only one in two frames feature my nice GDI text. Is there a way to tell the GDI to write to the right part of memory, or alternatively does anyone know of an alternative way i could do this easily? (without using two monitors) Thanks NICK

Share this post


Link to post
Share on other sites
Advertisement
Im not 100% sure but i think u call GetDc on your backbuffer and se that then call ReleaseDc or something

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Aha! your suggestion set me thinking and i realised i was using:

hdc = GetDC(hwnd)
...
ReleaseDC(hwnd, hdc)

from Win32 rather than:

primarysurface->GetDC(&hdc)
...
primarysurface->ReleaseDC(hdc)

which solves my problem! I am happy now

thanx
Nick

Share this post


Link to post
Share on other sites
Depending on which version of DX you''re using, using the GDI can range from bad to extremely bad in terms of performance. If you are just using it for debugging it might not matter, but keep that in mind...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just an idea, why not write to a file instead? That way in case of a crash you have an idea what has happened.

l8a

Share this post


Link to post
Share on other sites

  • Advertisement