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 9 of 9

Thread: 3.2 core & PushAttrib

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    27

    3.2 core & PushAttrib

    So, PushAttrib is gone. Before I go do things the hard way I just wanted to make sure there isn't already a Better Way.

    Rather than using glPushAttrib() with various flags, if I want to save and restore the settings I'll be changing, should I go about executing a bunch of glGet*, saving the results out, then restoring them afterward? Or is there a different way?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2007
    Location
    Latvia
    Posts
    225

    Re: 3.2 core & PushAttrib

    It is better to not call glGet* functions because of performance reasons. It is better to cache all state you set in client side (in your program), and then use this state to change only that GL state that needs to be actually changed.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    27

    Re: 3.2 core & PushAttrib

    That's fine if I have total control over the program, but what of cases where I'm writing a plugin and my function is called during a draw loop? It's very convenient to PushAttrib() for the settings I will be changing, then pop it when I'm done. Should I then trust that the app my plugin is for will reset its state?

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,725

    Re: 3.2 core & PushAttrib

    Should I then trust that the app my plugin is for will reset its state?
    You should talk to the people who own the application; they will tell you what they expect from their plugins.

    However, glPush/PopAttrib is only "gone" if the application initializing OpenGL asks for a core OpenGL profile of a GL version 3.2 or greater. Otherwise, ARB_compatibility will be available and glPush/PopAttrib will be available.

    I don't know of any program with a plugin architecture that has been written against 3.2 core. Max, Maya, etc all rely on compatibility profiles.

  5. #5
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    27

    Re: 3.2 core & PushAttrib

    Thanks Alfonse.

    In my case it is for Maya and MotionBuilder (particularly the latter) which at present are using 2.1 so it's not an issue as such... yet. I just want to be prepared.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,725

    Re: 3.2 core & PushAttrib

    There's nothing to be prepared for. Maya and MotionBuilder are not going to be rewritten to use only 3.2 core. And if they are, the people behind it will tell you beforehand, as it is a backwards-incompatible change.

  7. #7
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    27

    Re: 3.2 core & PushAttrib

    Hah yeah you're probably right. At least with Maya anyway. I wouldn't be so sure about MotionBuilder, that team is vicious with their API and I wouldn't put it past them to gut and redo the whole thing for 2012.

  8. #8
    Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    352

    Re: 3.2 core & PushAttrib

    Sorry, a bit out of topic, but:
    Maya and MotionBuilder are not going to be rewritten to use only 3.2 core.
    Autodesk annunced Maya 2011 at GDC and guess what?
    New viewport.
    I don't think is openGL 3.x but now I'm not sure that Maya 2012 or 13 will not implement geometry shader or tessellation in viewport.
    Old(current) Maya viewport still use vertex array.
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

  9. #9
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    27

    Re: 3.2 core & PushAttrib

    Hah, that's fine. ViewPort 2.0, if I recall correctly, may even use DirectX. O.o I've been using the Maya 2011 beta for a couple months but haven't had a chance to dig into the details about vp2.0 though.

Posting Permissions

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