text flickers
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
Do you have double-buffering enabled?
Yesterday we still stood at the verge of the abyss,
today we''re a step onward!
Yesterday we still stood at the verge of the abyss,
today we''re a step onward!
Yesterday we still stood at the verge of the abyss,today we're a step onward! Don't klick me!!!
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.
Kneelz
PS: Your code looks right to me. IT CAN''T BE WRONG.
It flickers because you draw the text on the PRIMARY surface. That''s wrong. Use the lpDDSecondary surface and it should work.
Darkening
Darkening
thanx darkening you solved my problem :D
and thanx to every1 else that also tried to help me
and thanx to every1 else that also tried to help me
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement