solution for deprecated glPushAttrib/glPopAttrib ...

With NVidia’s driver, it deals well with the legacy opengl code like:
glPushAttrib/glPopAttrib,
glPushClientAttrib/glPopClientAttrib,
glBegin(GL_TRIANGLES);

glEnd();

But with ATI’s driver, all these kind of functions do not work in default mode.
I wonder if there is a way to enable them or I have to rewrite all these code in modern gl if I want it run on an ATI graphics card.

Thank you so much!

What kind of context do you create ? What OpenGL version do you request ?

glGetString(GL_VERSION) gives me,
OpenGL version: 4.3.13085 Core Profile Forward-Compatible Context FireGL 10.143.2.1

How do you create your context? What OS is the ATI card on?

The issue here is that the default context type should be compatibility, unless you explicitly request a core context at creation time, which means that the deprecated functions (and any legacy programs that may use other deprecated functions) will continue to work.

However, drivers on some operating systems don’t give you this behaviour; IIRC under MacOS if you create a 3.x or better context you get core and core only; there is no compatibility option. So the solution if you wish to use deprecated features is to create a 2.1 or 2.0 context.

[QUOTE=mhagain;1288787]How do you create your context? What OS is the ATI card on?

The issue here is that the default context type should be compatibility, unless you explicitly request a core context at creation time, which means that the deprecated functions (and any legacy programs that may use other deprecated functions) will continue to work.

However, drivers on some operating systems don’t give you this behaviour; IIRC under MacOS if you create a 3.x or better context you get core and core only; there is no compatibility option. So the solution if you wish to use deprecated features is to create a 2.1 or 2.0 context.[/QUOTE]

I figure out that I need to set 2.1 context to make ATI driver work in 4.4 Compatibility Profile.
I set the context in Qt
QSurfaceFormat fmt;
fmt.setVersion(2, 1);
fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
fmt.setSamples(4);

Used GLView to check the GL version of this driver. (http://realtech-vr.com/admin/glview)
It starts from 3.0. Latest one is OpenGL 4.4.
But when I set it to be 4.4 or 4.3, the OpenGL version I get during rendering is always “4.4.13085 Core Profile Forward-Compatible Context FireGL 10.143.2.1”
Only when I set it to be 2.1, the version becomes “4.4 Compatibility Profile FireGL …”
Will it really support 2.1 ? Or it’s an invalid version and only with this version number, ATI driver knows it needs turn back to compatibility profile?

Thank you for all the help!

How can I mark this topic as solved?

You just have :wink:

Thank you!