Original Post
🔒 Locked
Drawing
Advertisement
Look-up "Double buffering" in the articles and resource. You can also use the vsync to stop the flickering, but I like double buffering better. basically, you draw to an off-screen bitmap and then copy this bitmap to the screen. You didn''t include your os/language/api so I can''t give you an example. Just check the articles on this site or google it.
Denny.
Denny.
I am using C++. Here is the code I am using
Here is the DrawBox Function.
The box draws fine, but it flickers.
Any ideas?
[edited by - Newbie00 on March 6, 2004 9:10:25 PM]
f_pDirect3DDevice->BeginScene();
DrawBox();
f_pDirect3DDevice->EndScene();
f_pDirect3DDevice->Present(NULL, NULL, NULL, NULL);
Here is the DrawBox Function.
void DrawBox()
{
f_pDirect3DDevice->SetVertexShader(D3DFVF_PANELVERTEX);
f_pDirect3DDevice->SetStreamSource(0, g_pVertices, sizeof(PANELVERTEX));
f_pDirect3DDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 2);
}
The box draws fine, but it flickers.
[edited by - Newbie00 on March 6, 2004 9:10:25 PM]
Did you forget: f_pDirect3DDevice->Clear(...);
Or are you using MFC, if so you must tell MFC not to erase the background.
If its none of this, gives us more information.
-CProgrammer
Or are you using MFC, if so you must tell MFC not to erase the background.
If its none of this, gives us more information.
-CProgrammer
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement