[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: slow OpenGl or RunLoop misunderstanding ?
From: |
xavier . glattard |
Subject: |
Re: slow OpenGl or RunLoop misunderstanding ? |
Date: |
Tue, 16 Jan 2007 16:58:42 +0100 |
User-agent: |
Internet Messaging Program (IMP) 3.2.5 |
Selon Richard Frith-Macdonald <richard@tiptree.demon.co.uk>:
>
> On 15 Jan 2007, at 20:25, xavier.glattard@free.fr wrote:
>
> >
> > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
> > [_scene glDrawFrame];
> >
> > [[self openGLContext] flushBuffer];
> > }
> >
> > I've tried to comment out the 3 last lines :
> > - when all 3 lines disabled I get 3040 FPS ! (yes, 3 thousands)
> > - when i left any of the lines I get 380-480 FPS... (4 hundreds)
> >
> > It looks like my opengl is so slow... (not accelerated ? why ?!)
>
> I agree that it looks like there may be a hardware acceleration
> problem. Perhaps you could try hacking initWithFormat:sharedContext:
> to see if changing any of the context initialisation will effect
> things (when googling this I saw a comment somewhere about direct
> rendering disabling acceleration on some system).
>
> > and RunLoop has no responsability (no "wait state").
> >
> > Xavier
> >
Finally you were right in your first answer : RunLoop delays
the 'needDisplay event' (every 1/500 sec ?) :
when i change my loop to a timed one (NSTimer...) _and_ use
[-lockFocusInRect:}/[-drawRect:]/[-unlockFocus] instead of
[-setNeedsDisplay:] i get more than 2000 FPS :-)
As I think the timer way is nothing but a workaround
I'm going to look for a way to change that... :o)
Xavier