Results 1 to 2 of 2

Thread: glClear (GL_COLOR_BUFFER_BIT)

  1. #1
    Senior Member Regular Contributor
    Join Date
    Aug 2004
    Location
    Palo Alto, CA
    Posts
    111

    glClear (GL_COLOR_BUFFER_BIT)

    How to clear a portion of an OpenGL window ?

    1) Create window of size 512x256.
    2) glClear(GL_COLOR_BUFFER_BIT), I suppose it clears the entire 512x256 area.
    3) Now how to clear only portion of the window ([0, 256]x[0, 256]) without drawing a dummy quad and set its color to glColorf(0, 0, 0); ?

    Does glClear(GL_COLOR_BUFFER_BIT) clears the entire 512x256 region irrespective of the glViewport(0, 0, 256, 256) ?

  2. #2
    Guest

    Re: glClear (GL_COLOR_BUFFER_BIT)

    Hi there!

    Please see the man pages for glScissor:
    http://www.mevis.de/opengl/glScissor.html

    and glClear:
    http://www.mevis.de/opengl/glClear.html

    Use glScissor to limit the clear to a sub rectangle of the current viewport.

    Regards

Similar Threads

  1. Avoid glClear( GL_COLOR_BUFFER_BIT )?
    By Dark Photon in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 10-13-2011, 04:59 PM
  2. FBOs and GL_COLOR_BUFFER_BIT
    By skynet in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 02-02-2010, 04:19 PM
  3. glClear()
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-22-2005, 10:51 PM
  4. glClear(GL_COLOR_BUFFER_BIT)
    By Robin Forster in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-01-2001, 12:08 AM
  5. Can't glClear()!?!
    By Punchey in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 03-11-2001, 02:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean