Jump to content
  • Advertisement
Sign in to follow this  
thopol

.: Flickering bitmaps under XP :.

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

Hi there. I've got a little problem here... i write games in C++ using Direct Draw and they all run fine under Win 98/ME but under Win 2000 and XP the bitmaps begin to flicker and sometimes at the init time program gives a message that it can't load the bitmap. I give you here a link to the zip file containing the compiled example program with the source code, could anybody look into the source code and tell me why do those funny things happen? i'd be gratefull if you could even fix that problem. Thanks. link: http://members.lycos.co.uk/thopolzone/test.zip try to use a download manager to download the file. THopol.

Share this post


Link to post
Share on other sites
Advertisement
Hello again thopol :) I see you are having the same problems. Maybe my code wasn’t good enough or it didn’t help? I spent some time coding the example for you, I hope you put it to good use. You never emailed me back. Your link does not work!

Email the source to me and I will look at it. I’m thinking you are not drawing the imagery correctly. You must clear the screen first, the draw you images, then flip the buffers.

Share this post


Link to post
Share on other sites
Never mine, I got the source code. I used MSN to do this. It seams IE didn’t work. I will take a look now!

Share this post


Link to post
Share on other sites
[OFF TOPIC]
An interesting turn of events just occurred. A police man just knocked on my door to alert me of a fire. It was not my house though, it was my neighbor’s house down the street.
[/OFF TOPIC]

Your code is a little hard to fallow. I must clear something up for you. LPDIRECTDRAW4 is not the DirectDraw7 interface. I see that you even query fof the DirectDraw7 interface using the IirectDraw4 interfaces, and it worked, wft?

Use the DirectDraw7 interfaces if you want to use DrectDraw7, not DirectDraw4 interfaces. They are different.

Oe thing I’ve notices is that you use the MAKEINTRESOURCE macro to load the IDI_WINLOGO icon for you WNDCLASSEX. You don’t have to do this. Just supply the icon resource name. you only have to use MAKEINTRESOURCE when specifying you own icon resource you have created or imported.

How you initialize the clipper seams a little awkward to me. You don’t have to specify all of that region data crap. All you have to do is use SetHWnd and then attach the clipper to the primary surface. You are settings it to the back, not good.

Another thing, you are flipping the screen then clearing it in your ClearDD method; don’t do that. Clear the screen first, then after you have drawn every thing--flip.

Also, in InitImage, you are using the FAILED macro to check if the LoadImage function fails. That is not the way you should do that either. Instead, you should check if the hbmp_Bmp if == NULL after you have called that function, if it is, then invoke you error routines.

I see that you have called IDirectDrawSurface4::Flip( ) after you have called BitBlt to draw the bitmap to you surface. REMOVE THAT! You do not flip the off screen surface after drawing to it. Your surface description isn’t setup with the flipping & complex properties, so those methods should fail horribly.

I didn’t see any flickering on my machine. But I have a faster graphics card. I will rewrite your code for you and then email it back to you with you profile’s email. Look at what I did.

[Edited by - sakky on September 23, 2004 1:51:01 AM]

Share this post


Link to post
Share on other sites
Thx guys for help, especially you Sakky.
I found out that this problem comes from my graphics card or the drivers and seems that the source code didn't have anything to this flickerin but anyway thx alot as i think that my apps will now be much more stable. I also thank you for fixing that problem with loading images.
Moving back to the last thing... maybe someone knows where is the main source of the problem as even when i run ddraw tests in DXDIAG the 1/3 of screen fickers and the bitmaps look like there was a motion blur enabled... and this only happens in the fullscreen mode(only my apps and DXDIAG ddraw tests show this strange behavior and other games in ddraw don't).
Once more thanks alot.

THopol.

Share this post


Link to post
Share on other sites
Your welcome :) You should download the newest version of DirectX and your graphics hardware drivers. This should fix out with a lot of you problems. You might now be able to use Direct3D but DirectDraw will still work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!