Jump to content
  • Advertisement

Archived

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

Newbie00

Drawing

This topic is 5365 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 am trying to draw a box on to the screen. It draws fine, but it flickers extremely fast. How would i stop it from flickering? [edited by - Newbie00 on March 6, 2004 7:43:03 PM]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I am using C++. Here is the code I am using

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. Any ideas?

[edited by - Newbie00 on March 6, 2004 9:10:25 PM]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!