Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very low frames per second?




Am 03.10.2007 um 00:35 schrieb Keehun Nam:

Hello,

So I have set up a QuartzComposer to render in an OpenGL and I've set the render setup with a timer.

If I do the following line, it is fine,

_renderTimer = [[NSTimer scheduledTimerWithTimeInterval:(0 / (NSTimeInterval)kRendererFPS) target:self selector:@selector (_render:) userInfo:nil repeats:YES] retain];



It's just a pesky little math problem.

(0 / (NSTimeInterval)kRendererFPS)
evaluates to 0.0 regardless of what you use for kRendererFPS and
(3+ 0 / (NSTimeInterval)kRendererFPS) results in 3.0 every time.

The scheduledTimerWithTimeInterval:0 repeated:YES, fires the timer as fast as possible.
The scheduledTimerWithTimeInterval:3 repeated:YES, fires the timer every three seconds.


In general it doesn't hurt, to study the documentation and your own code a little more carefully, before asking the mailing list...
------------------------------------------------------
The things you own
end up owning you. -- Palahniuk



_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >Very low frames per second? (From: Keehun Nam <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.