Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

User Synchronization using WaitForVerticalBlank

Posted on 2006-06-13
3
1,041 Views
Last Modified: 2013-12-08
I am using DirectX 9.  I need to synchronize the time a bitmap displays and output of a TTL pulse with a National Instruments Digital Input/Output board.   The only method available seems to be:
IDirectDraw::WaitForVerticalBlank(DWORD dwFlags,HANDLE hEvent);  

I have found no tutorials regarding DirectDraw in DirectX 9 (because it is no longer released with DirectX) or how to work around the depreciated functions.

HOW can I use this method (i.e. WaitForVerticalBlank)?  WHAT should I Initialize?  Do I need to use DirectShow to get to the IDirectDrawSurface multimedia interface?  How would I do that?  Would this lead me to IDirectDraw?  Does it need to be initialized like I currently do to get the Direct3D object & device?
g_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
g_pD3D->CreateDevice(...);

Now I am able to render a .bmp by using IDirect3DSurface9* backbuffer; GetBackBuffer(...); StretchRect(...); and Present(...);
But again the time of display is not well synchronized with the TTL pulse.  I determine this on an oscilloscope by comparing the output of a photodector against the TTL.

Thank you for your help!
Matt




0
Comment
Question by:mbh5m
3 Comments
 
LVL 18

Accepted Solution

by:
JoseParrot earned 125 total points
ID: 16917671
Hi,

Great job with the oscilloscope! Like in the good times of electronics!
Well, after a so well arranged arguments, we have no other way than try to help you!

I had a similar problem, to synchronize a camera to a high definition display. The solution was to "downgrade" the system.

We don't need Windows xP to do that. Actualy Windows makes it worst; windows requires so much resources to itself, and is more and more abstract to hardware, that it is better to use an old DOS to do it.

If the application you have doesn't require Windows, or if you can separate dedicated functions to other machine, don't use the wasteful and angry Windows. You can put an inexpensive PC devoted to the function with DOS and all TSR you want, programmed in pure C (not C++, just C).

If National doesn't have device drivers to DOS, may be Directx lower than 9 could be the other option.

Jose
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Python TKinter installation needs version advice 1 332
count7 challenge 12 125
Any Advice on Sonar / DAW freaky instruments? 2 79
Beginner to Unreal Engine 4 5 94
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question