discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenGLView


From: Philippe C.D. Robert
Subject: Re: NSOpenGLView
Date: Wed, 8 Nov 2006 15:05:35 +0100


On Nov 8, 2006, at 2:34 PM, Enrico Sersale wrote:

On 2006-11-08 15:26:35 +0200 Renaud Molla <renaud.molla@wanadoo.fr> wrote:

Enrico:
What do you mean by [[self openGLContext] flushBuffer] does the trick?

I mean that an implementation of -drawRect: like this:

- (void)drawRect:(NSRect)rect
{
  glClearColor(0, 0, 0, 0);
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1.0f, 0.85f, 0.35f);
  glBegin(GL_TRIANGLES);
  glVertex3f(0.0,  0.6, 0.0);
  glVertex3f(-0.2, -0.3, 0.0);
  glVertex3f(0.2, -0.3 ,0.0);
  glEnd();
  glFlush();

  /* add this line */
  [[self openGLContext] flushBuffer];
}

will work without the need of a timer.

If this is a double-buffered context then -flushBuffer issues a call to glFlush() (at least it should...), and thus glFlush() should not be called at all. if it is a single-buffered context then - flushBuffer is a nop and glFlush() has to be called! At least if the GNUstep implementations behaves like Cocoa ;-)

HTH,

-Phil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]