• Advertisement

Archived

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

text flickers

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

when I try to display a text in my DX-screen (within my game-loop) it flickers I use the following function : void PrintText(char *text, int bR, int bG, int bB, int tR, int tG, int tB) { if (G.lpDDSPrimary->GetDC(&G.hdc) == DD_OK) { SetBkColor(G.hdc, RGB(bR, bG, bB)); SetTextColor(G.hdc, RGB(tR, tG, tB)); TextOut(G.hdc, 0, 0, text, lstrlen(text)); G.lpDDSPrimary->ReleaseDC(G.hdc); } } did I mis something or isn''t this the right way to display text in a dx-screen (I don''t use a steady framerate) thanx in advance for any replies

Share this post


Link to post
Share on other sites
Advertisement
I had the same problem some time ago. Here''s the way I solved it: I moved all project files of the current DirectX project to the "C:\Recycled" folder and then formatted the whole hard disk. I re-installed Windows and then moved the files back from the "C:\Recycled" folder. It worked then perfectly. I heard, it is a time-critical installation-bug (TCIB). There was another solution on MSDN, I don''t know where.

Kneelz

PS: Your code looks right to me. IT CAN''T BE WRONG.

Share this post


Link to post
Share on other sites
It flickers because you draw the text on the PRIMARY surface. That''s wrong. Use the lpDDSecondary surface and it should work.

Darkening

Share this post


Link to post
Share on other sites

  • Advertisement