[vtkusers] Refreshing the vtkRenderWindow

REGAT-BARREL Aurélien arbvtk at yahoo.fr
Tue May 4 10:49:28 EDT 2004


Be careful : SetTimer needs a message loop.
http://support.microsoft.com/default.aspx?scid=kb;en-us;102482

Vivek Gupta <vivekg at mac.com> wrote:
Hello,

I wanted to let you know that the Windows Set Timer worked! Thanks a 
lot for all of the help!

Here are the couple of lines that I had to add just for reference by 
anyone else who might need it:

1) Declaration of the callback

VOID CALLBACK myTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD 
dwTime) {
renWin->Render();
}

I have my renderWindow declared globally so I have access to it.

2) Actual creation of the timer
int timer_number = SetTimer( NULL, 0, 20, (TIMERPROC) myTimerProc );

The first parameter would be a handle to the Window that should handle 
it and the second is to give an id to the event. However in this case 
there is no window that I want to associate it with, just the 
application. The third parameter how often the event will be generated 
(in milliseconds) and the last is the callback function.

3) Kill the timer after the event loop exits
KillTimer(NULL, timer_number);

4) For more information take a look at this URL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/ 
WinUI/WindowsUserInterface/Windowing/Timers/UsingTimers.asp

(Sorry if the URL gets wrapped poorly)



Aurélien REGAT-BARREL
		
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040504/45575926/attachment.htm>


More information about the vtkusers mailing list