Results 1 to 2 of 2

Thread: glPushAttrib problem

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2000
    Morrisville, NC

    glPushAttrib problem


    There seems to be some weirdness with glPushAttrib. When I do glPushAttrib(GL_ALL_ATTRIB_BITS) I don't get what I expect on the screen. But if I only mask out the values that I know I need with glPushAttrib(GL_CURRENT_BIT | GL_ENABLE_BIT) I get what I'm supposed to.

    I get no errors from glGetError and glGet(GL_ATTRIB_STACK_DEPTH) returns a 0 (in case I was overflowing the stack).

    I'll be using the less expensive GL_CURRENT_BIT | GL_ENABLE_BIT, but was wondering if pushing all of the attributes was a known problem.



  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2001

    Re: glPushAttrib problem

    AFAIK glPushAttrib() in itself doesn't modify the way things get rendered.
    Only after a glPopAttrib() can things start behaving unexpectedly, if the preceding glPushAttrib() didn't properly cover all subsequent state changes.

    Verify that you have exactly the same number of Pushes and Pops and that you are not exceeding the MAX_ATTRIB_STACK_DEPTH nor underflowing the stack (i.e. popping before pushing).


Similar Threads

  1. glPushAttrib and GL_INVALID_OPERATION
    By giucam in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 07-07-2012, 08:22 AM
  2. glPushAttrib ?
    By DarkShadow44 in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 02-01-2010, 10:53 AM
  3. Effect of using glPushAttrib
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-29-2005, 12:36 AM
  4. glPushAttrib flicker
    By in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 07-13-2005, 07:55 PM
  5. Why glPushAttrib?
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-08-2005, 08:55 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