Jump to content
  • Advertisement

Archived

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

Pikachu

Why do i got flickering?

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

Guest Anonymous Poster
Yo might want to explain a little more about your setup cause there could be a number of things creating this

Share this post


Link to post
Share on other sites
Advertisement
Hard to say without seeing the code. I recently created a double buffer that used a Window's HDC to print text on the screen. Every time I called "Flip" I could see a bad flicker. I changed the DC to the DirectDraw
GetDC and the flicker went away!

------------------
Still Learning...

Share this post


Link to post
Share on other sites
Flickering is usually caused by not using double buffering.

------------------
Dance with me......

Share this post


Link to post
Share on other sites
I'm using double buffer. I made a simple directdraw class to handle that stuff. Front buffer and back buffering. The only thing I do in the main of my program is drawing the map and move it. I move it just to check to make sure it clips right. The main is this:

ddGame.SetDrawSurface(DDSBACK);
dmMap.DrawMap(ddGame.lpddsBack, 0);
ddGame.SetDrawSurface(DDSPRIMARY);
ddGame.WaitForVSync();
ddGame.Flip(DDSBACK);

dmMap.vTopLeft.X -= inc;
dmMap.vTopLeft.Y -= inc;

if (counter++ == 80) {
inc = -inc;
counter = 0;
}

ddGame is my direcrt draw class, dmMap is my map.

Using VC++ 6.0, Direct 7.0

Share this post


Link to post
Share on other sites
I think your problem is how you're setting what the program draws to. When using the Flip() function, you never need to draw to the primary surface. You draw to the backbuffer, and then flip, and the pointers to the primary and backbuffer are automatically switched. So the next frame you just draw to the backbuffer again, and flip from either of them, and repeat...

Jonathan

Share this post


Link to post
Share on other sites
Oh, sorry. Little confusion. Let me explain what happen in my class. The set draw surface sets the destination for all the actions, ie flipping by calling ddGame.Flip(DDSBACK); takes the back surface and flips it to the active surface, ie the primary one.

Share this post


Link to post
Share on other sites
Ok this is probly simple but i can't figure it out. I'm not tackling 3d yet, just working on an isometrics game. I got a map that draws but I'm getting flickering. I use Direct Draw's WaitForVSync but I still notice it. What could cause this?

~ Thanx in advance

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!