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

On 2006-11-08 15:26:35 +0200 Renaud Molla <[EMAIL PROTECTED]> 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


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

Reply via email to