Hello

<newbie=ON>
I'm playing with NSOpenGLView and trying to port glxgears to gnustep. 
I reuse as code from glxgears as possible.

With glxgears I get 2225 FPS
With gnustep-gears I get 380 FPS !

Even when I draw nothing in my window (drawRect = flushBuffer) i only 
get 480 FPS.

I think of 2 point :
- NSOpenGL* classes are very CPU intensive
- my frame loop is bad

I use [RunLoop-performSelecto:...] to loop. The documentation says the 
selector is perform before the next runloop iteration.

<CODE>
- (void) nextAnimationFrame: (id) gl_view
{
  NSTimeInterval thisFrame = [NSDate timeIntervalSinceReferenceDate];
  NSTimeInterval sinceLastFrame = (thisFrame - _lastFrame);
  _lastFrame = thisFrame;
  
  [_scene nextFrameWithStep: sinceLastFrame];
  [gl_view setNeedsDisplay: YES];
  
  if(YES == _running)
  {
    if (!_rl_modes)
    {
      _rl_modes = [[NSArray alloc] initWithObjects: NSDefaultRunLoopMode,
                               NSModalPanelRunLoopMode,
                               NSEventTrackingRunLoopMode, nil];
    }
    [[NSRunLoop currentRunLoop]
         performSelector: @selector(nextAnimationFrame:)
                  target: self
                argument: gl_view
                   order: 10
                   modes: _rl_modes];
  }
}
</CODE>

Does the RunLoop iteration timed ? I hope it runs as fast as possible...

Any comment will be welcome !  :-)

Thanks in advance

xavier




_______________________________________________
Help-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnustep

Reply via email to