Sign in to follow this  

flickering

This topic is 4833 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'm having a problem with using the CDisplay and CSurface classes. The images I have created flicker so I think that I'm not flipping correctly BUT isn't that all handled by the CDisplay class using: Present() ? Anyway, I'm loading bitmaps like this: TotalScreen->CreateSurfaceFromBitmap(&tmpFrame,PathName,width,height); and TotalScreen->Clear(0); TotalScreen->Blt(xPos,yPos,Surface_1, 0); TotalScreen->Blt(xPos,yPos,Surface_2, 0); ... TotalScreen->Blt(xPos,yPos,Surface_n, 0); TotalScreen->Present(); Then I read something that said you can't flip unless your in full screen mode (is this true?)so I changed : if(FAILED(TotalScreen->CreateWindowedDisplay(hWnd,640,480))) ... to if(FAILED(TotalScreen->CreateFullScreenDisplay(hWnd,640,680,16))) which Failed, returning my message "Failed to Initialize DirectDraw" Am I missing something and/or have I got the right idea? [Edited by - tadobie on September 14, 2004 8:26:55 AM]

Share this post


Link to post
Share on other sites
Um, what classes are these and I want to see them. I can not give you accurate help with out some more information about these classes you are using. But I will try.

Usually, a flicker occurs when you are drawing animation that is not double buffered, hence, can be flipped. Usually full screen applications use two surfaces to solve this problem. One surface is the primary surface and the other is the back buffer. You draw to the back buffer then copy the contents to from the back buffer to the primary surface. This eliminates flickering. Even if you are in windowed mode you can still do this. You just have to make an off screen plain that is used for the back buffer. Where as, in full screen, you would make a special surface that is attached to the primary surface.

In answer to your question, yes, you can’t flip in a windowed mode. Only is full screen mode.

Share this post


Link to post
Share on other sites
Havent used these classes but with DD it is rather tricky to adhear to VSync in windowed mode (ie CDisplay probably doesn't do it).

Not sure why your init fullscreen is failing though. In any case lack of vsync is mainly a problem of tearing if your using double-buffering.

All that said its hard to diagnose since your using classes that most of us don't know that well.

Post a zip with the code and I'll check it out though.

Share this post


Link to post
Share on other sites
thanks for helping out,
I sussed it out!
I was showing only some of the loaded bitmaps before clearing them instead of waiting til the whole lot were one main surface and just showing that.
Thanks again for your help
I just wanted to say:
The code is in a skeleton with about 6 classes so I found it difficult to find a coherent bit of code to post.
and
I didnt mean to insult your intelligence by giving you directions to the site it's just that many people seem to not know what I'm refering to.

Share this post


Link to post
Share on other sites

This topic is 4833 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this