Getting debug information using TextOut()

Started by
10 comments, last by kseh 7 years, 8 months ago

The flicker is inevitable...

Hi Aardvajk,

Thanks, that makes sense. So are you saying that because win32 is generally based on event driven programs, not ones that run in a loop, it is only expecting a refresh or an update based on user input. And directX draws to the back buffer and then flips to the front buffer which keeps this smooth (no flickering because of the continual update of only whats changed... or something like that).

So basically with my engine like it is now I should just not worry about the flicker since I am just using it for very primitive output purposes?

Thanks

Advertisement

Right, I couldn't remember until Aardvajk mentioned it. With the Win32 API it was something like you want to blt to a memory DC first and then you could either blt that to your display DC or you could setup something to do page flipping. There should be examples that you can google to do this. Any examples I have are from before the revamped the API but I seem to remember you wanted to be careful about releasing any objects you're using properly. And as I recall I was able to use the Win32 API to get some ok graphics response with just setting up a timer to call InvalidateRect with a short interval.

That said, your code as it is in your example writes the text first and then (when uncommented) paints a solid rectangle next, so you're not going to see your text very well whether it goes to a back buffer or not.

This topic is closed to new replies.

Advertisement