Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

User Synchronization using WaitForVerticalBlank

Posted on 2006-06-13
3
Medium Priority
?
1,063 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

610 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