|
-
April 12th, 2005, 07:00 PM
#1
Flickering even though using backbuffer(DirectDraw)
I have a program I made that uses DirectDraw, I've created a surface with a back buffer and I directly manipulate the back buffers memory, then use flip on the primary surface, even though I'm doing this the screen still flickers a few seconds after start up, then the flickering becomes much less frequent (every 10 seconds or so compared to multiple times a second), this flickering is the entire screen going black, even though my colour blt that I use to clear the back buffer is called before I lock it, and I flip right after I unlock... can someone shed some light onto the reason for this?
In C, you merely shoot yourself in the foot.
In C++, you accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical care is impossible, because you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
-
April 12th, 2005, 07:09 PM
#2
Re: Flickering even though using backbuffer(DirectDraw)
First thing which comes on my mind is to check if you have vertical retrace synchronization enabled.
Hob
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
April 12th, 2005, 08:46 PM
#3
Re: Flickering even though using backbuffer(DirectDraw)
lol your everwhere unless vsync is on by default, other wise it's not on.
In C, you merely shoot yourself in the foot.
In C++, you accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical care is impossible, because you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
-
April 13th, 2005, 02:00 AM
#4
Re: Flickering even though using backbuffer(DirectDraw)
I am not experienced with DX a lot, but when i was creating my learning applications, flickering occured in 2 situations:
1. when I was trying do draw very contrast objects each frame, like white square on first frame, red on second, and white, and red, it was looking like painting flickering pink square. If its a problem with your 'life' game, maybe you should decrease frame rate a bit, because when cell is 'alive' in one frame and 'dies' in next one, and then is 'alive' again and so on, what equals to switching one pixel from black to white and back very fast.
2. when framerate was not synchronized with vertical freq of minotor. waiting for vertical retrace should be possible enable/disable as system default via graphics driver. Apart from default system setting, it can be achieved by specifying some flag in some drawing function , AFAIR it was a flag in Flip(..), but i am not sure.
These were the only 2 situations when I experienced flickering, but in your case reason can be other. Test your app on another machine and check if its not a fault of drivers, DX version, system version, and so on...
And yes, i am everywhere 
Hob
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
April 13th, 2005, 04:32 PM
#5
hmmm it's in my game of life proggy (the asm prog you helped me with), I've added some more speed optimizations to the program since you've seen it but nothing to change how direct draw functions.
I believe the vsync thing is on by default and it is adjusted in the flip method. this is realy strange :\ it occurs on more than one computer, with 100% different hardware configs on each system (each systems hardware configuration is unique)
In C, you merely shoot yourself in the foot.
In C++, you accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical care is impossible, because you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
-
April 14th, 2005, 05:39 PM
#6
Re: Flickering even though using backbuffer(DirectDraw)
attach your project then, ill check it.
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|