Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: EXC_BAD_INSTRUCTION on glFlush

  1. #1
    Intern Newbie
    Join Date
    Jul 2012
    Posts
    41

    EXC_BAD_INSTRUCTION on glFlush

    I have code:
    Code :
        glLoadIdentity();
        visibleRect = [self visibleRect];
        glViewport(0, 0, NSWidth(visibleRect), NSHeight(visibleRect));
        glMatrixMode(GL_PROJECTION);
        glFrustum(NSMinX(visibleRect), NSMaxX(visibleRect), NSMinY(visibleRect), NSMaxY(visibleRect), 0.1, 100);
        glTranslatef(0,0,zoomValue);
        glClearColor(0.93, 0.93, 0.93, 1.0);
        glClear(GL_COLOR_BUFFER_BIT);
     
        glEnable(GL_TEXTURE_2D);
        glBindTexture(GL_TEXTURE_2D, texture);
        glBegin(GL_QUADS);
        glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f, 0.0f);
        glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f, height);
        glTexCoord2f(1.0f, 1.0f); glVertex2f(width, height);
        glTexCoord2f(1.0f, 0.0f); glVertex2f(width, 0.0f);
        glEnd();
        glBindTexture(GL_TEXTURE_2D, 0);
     
        glFlush(); //Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

    And I get Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) error at glFlush line.
    Why does this error appears?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,102
    In OpenGL an error can be from some previousfunction call. Use glGetError at stratagic spots to limit the scope of functions that might be wrong

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •