BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenGL and multimedia hirez timer

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Jeff Labute
Guest





PostPosted: Sun Oct 23, 2005 9:34 pm    Post subject: OpenGL and multimedia hirez timer Reply with quote



Hi Everyone...

{using delphi 6 pro}

I've wanted to switch to a multimedia timer for better time resolution.
Currently in my code, I am using an onidle event to redraw my opengl scene.
If i switch to a ttimer, i get about the same time resolution depending on
the
hardware platform... and everything works fine.

Now, I've tried to use third part multimedia timer
wrappers in place of the Timer... but my scene does not appear to draw, I
just get a black window. I get nothing at all if I don't have a
SwapBuffers(DC); command at the end of my draw scene. Apparently it's not
straightforward to switch to a multi media timer? I am using a timer that I
got off Torry's Delphi site... and it seems to just have the standard
settimer and timegettime procedures and stuff.
If i put a label that updates every 10ms or other stuff in the window to
update it works fine at the frequency i chose.. just not working for opengl
stuff. (Some components called Wave Audio comes with a multimedia timer).
If I delete this multimedia timer and put the ttimer or onidle back in to
the code, everything is fine again. If I slow the multimedia timer down to
100ms it still doesn't work... I don't think it's a speed issue. I've used
examples from nehe to put my little project together.. plus it uses serial
components and zeos sql db components.

help

Jeff


Back to top
Eric Grange
Guest





PostPosted: Mon Oct 24, 2005 7:24 am    Post subject: Re: OpenGL and multimedia hirez timer Reply with quote



Multimedia timer events are triggered in the context of another thread,
unless your component does a Synchronize for you.
OpenGL context activation is per-thread, so if you initialize in the
main thread and try rendering in a secondary thread, nothing will happen.

Eric
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.