Click here to Skip to main content
16,008,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString! Pin
mostafa_pasha16-Sep-04 7:17
mostafa_pasha16-Sep-04 7:17 
GeneralRe: CString! Pin
David Crow16-Sep-04 7:21
David Crow16-Sep-04 7:21 
GeneralRe: CString! Pin
mostafa_pasha16-Sep-04 7:41
mostafa_pasha16-Sep-04 7:41 
GeneralRe: CString! Pin
David Crow16-Sep-04 7:47
David Crow16-Sep-04 7:47 
GeneralEliminating Flicker using DirectDraw?! Pin
towd16-Sep-04 5:57
towd16-Sep-04 5:57 
GeneralRe: Eliminating Flicker using DirectDraw?! Pin
normanS19-Sep-04 21:19
normanS19-Sep-04 21:19 
GeneralRe: Eliminating Flicker using DirectDraw?! Pin
towd20-Sep-04 5:43
towd20-Sep-04 5:43 
GeneralRe: Eliminating Flicker using DirectDraw?! Pin
normanS20-Sep-04 20:32
normanS20-Sep-04 20:32 
I can't claim to be anything like an expert - I was having a semi-educated guess! I have used mainly SDK-level graphics - SetDIBitsToDevice() - as well as a DirectDraw library supplied by a frame grabber supplier.

But some more on my ideas . . .

Do you know what rate your application actually displays the bitmaps? Is it possible that within a single vertical blanking period, you actually try to display both bitmaps? That might give the appearance you describe.

According to the Microsoft DirectDraw documentation, it should be sufficient to do something like:

while not finished<br />
	WaitForVerticalBlank(. . . DDWAITVB_BLOCKBEGIN . . .)<br />
	displayBitmap1<br />
	WaitForVerticalBlank(. . . DDWAITVB_BLOCKBEGIN . . .)<br />
	displayBitmap2<br />
endWhile


What I have seen by profiling is that the DirectDraw functions return control to the application almost instantaneously, so if WaitForVerticalBlank(. . . DDWAITVB_BLOCKBEGIN . . .) actually returns if you are IN the vertical blanking period, not just at the START of the vertical blanking period, multiple bitmaps may be displayed in the same vertical blanking period.

It may thus be necessary to sit in a loop like this:

while not finished<br />
	WaitForVerticalBlank(. . . DDWAITVB_BLOCKBEGIN . . .)<br />
	displayBitmap1<br />
	WaitForVerticalBlank(. . . DDWAITVB_BLOCKEND . . .)<br />
	WaitForVerticalBlank(. . . DDWAITVB_BLOCKBEGIN . . .)<br />
	displayBitmap2<br />
	WaitForVerticalBlank(. . . DDWAITVB_BLOCKEND . . .)<br />
endWhile


Of course, Microsoft documentation may be correct, in which case explicitly waiting for the end of vertical blanking is not necessary.

I hope this makes sense.
GeneralRe: Eliminating Flicker using DirectDraw?! Pin
Anonymous23-Sep-04 6:25
Anonymous23-Sep-04 6:25 
GeneralUsing MsChart ActiveX Pin
genki200016-Sep-04 5:45
genki200016-Sep-04 5:45 
GeneralUpdating a CDocument from other objects. Pin
Budric B.16-Sep-04 5:11
Budric B.16-Sep-04 5:11 
GeneralRe: Updating a CDocument from other objects. Pin
David Crow16-Sep-04 6:23
David Crow16-Sep-04 6:23 
GeneralRe: Updating a CDocument from other objects. Pin
Budric B.16-Sep-04 6:42
Budric B.16-Sep-04 6:42 
GeneralRe: Updating a CDocument from other objects. Pin
David Crow16-Sep-04 7:14
David Crow16-Sep-04 7:14 
GeneralRe: Updating a CDocument from other objects. Pin
Budric B.16-Sep-04 7:39
Budric B.16-Sep-04 7:39 
GeneralRe: Updating a CDocument from other objects. Pin
David Crow16-Sep-04 7:44
David Crow16-Sep-04 7:44 
GeneralRe: to which window Pin
Budric B.16-Sep-04 8:32
Budric B.16-Sep-04 8:32 
GeneralRe: to which window Pin
David Crow16-Sep-04 8:55
David Crow16-Sep-04 8:55 
GeneralThank you (nt) Pin
Budric B.16-Sep-04 9:13
Budric B.16-Sep-04 9:13 
GeneralRe: Oh and another silly question Pin
Budric B.16-Sep-04 6:53
Budric B.16-Sep-04 6:53 
GeneralRe: Oh and another silly question Pin
David Crow16-Sep-04 7:04
David Crow16-Sep-04 7:04 
GeneralSerialize Pin
TUMB16-Sep-04 5:02
TUMB16-Sep-04 5:02 
GeneralRe: Serialize Pin
David Crow16-Sep-04 5:21
David Crow16-Sep-04 5:21 
GeneralRe: Serialize Pin
TUMB16-Sep-04 5:25
TUMB16-Sep-04 5:25 
GeneralRe: Serialize Pin
TUMB16-Sep-04 5:28
TUMB16-Sep-04 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.