Results 1 to 5 of 5

Thread: equivalent to glPushAttrib()

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    15

    equivalent to glPushAttrib()

    Hello, is there a way to do the same thing that the openGL command glPushAttrib() does ?

    Because I have this problem : I draw an object without texture then I draw a second object with a texture. When my screen is updated (second call to my display function), my first object becomes textured !!

    Thanks for your help.

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: equivalent to glPushAttrib()

    No, there is no such equivalent. You need to keep track of the render states you set and make sure you disable texturing if it was previously enabled when you want to render an untextured object.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    15

    Re: equivalent to glPushAttrib()

    Thanks

  4. #4
    Junior Member
    Join Date
    May 2008
    Posts
    1

    Re: equivalent to glPushAttrib()

    Although you can't call glPushAttrib, you can still preserve the state using glIsEnabled()

    Eg, you could do:

    Code :
    GLboolean was_enabled = glIsEnabled (GL_TEXTURE_2D);
     
    /* do something that might disable/enable texturing */
     
    if (was_enabled)
      glEnable (GL_TEXTURE_2D);
    else
      glDisable (GL_TEXTURE_2D);

  5. #5
    Member
    Join Date
    Sep 2004
    Location
    Montreal
    Posts
    31

    Re: equivalent to glPushAttrib()

    I imagine it is best to track the GL states on your own instead of calling any glGet or glIs function.

Similar Threads

  1. glPushAttrib(GL_TEXTURE_BIT) replacement in opengl-es
    By parul in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 09-24-2008, 11:15 AM
  2. gluLookAt equivalent for Symbian?
    By miranda2112 in forum OpenGL ES general technical discussions
    Replies: 7
    Last Post: 04-06-2005, 01:14 PM

Posting Permissions

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