Re: High FPS in NSOpenGLView
Re: High FPS in NSOpenGLView
- Subject: Re: High FPS in NSOpenGLView
- From: Peter Ammon <email@hidden>
- Date: Mon, 28 May 2001 09:51:44 -0700
on 5/27/01 7:07 PM, Kim Foo-Jones at email@hidden wrote:
>
I would like to use Cocoa to make a framework for developing my
>
game engine. The framework could evolve into an editor so AppKit
>
would be very helpful in future.
>
>
I have previously been writing the framework under OS9 and it was
>
very simple to set-up a loop to run my engine routines in. What
>
would be the best approach under OSX using Cocoa? I have an
>
NSOpenGLView subclass to render into, but of course I need a loop
>
to do my interactive rendering in... Do I need to create a
>
separate thread to the main program or is there some other
>
mechanism which would be more appropriate? Are there any issues
>
with drawing into an NSOpenGLView with such a method?
>
>
The subject line is a bit misleading as I'm not looking for
>
ultimate performance at this stage - I just want to get a loop
>
going to prototype my engine. It does need to be real-time,
>
though - capable of at least 15-20 fps, say.
>
>
Also, it would be good if I could do it in a way which made it
>
easy to move the engine into an actual game in future. The engine
>
itself is more-or-less self-contained - it only issues OpenGL
>
commands...
I saw hundreds of fps by simply creating a repeating NSTimer with an
interval of 0 that called my NSOpenGLView's display method.
-Peter