Solved

User Synchronization using WaitForVerticalBlank

Posted on 2006-06-13
3
1,052 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
[X]
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
3 Comments
 
LVL 18

Accepted Solution

by:
Jose Parrot 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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