PDA

View Full Version : glPushAttrib save active texture unit?



Nutty
07-31-2002, 12:58 PM
Quick question.

It seems glPushAttrib(GL_ALL_ATTRIB_BITS); doesn't save which is the currently active texture unit. Is this correct?

cheers.

PH
07-31-2002, 01:28 PM
Correct, there's a client state version of that glPushClientAttrib(..).

EDIT: I think http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by PH (edited 07-31-2002).]

Nutty
07-31-2002, 01:31 PM
hmmmm.. so glPushClientAttrib saves client states like active texture units eh? How do I know what a client state, and whats a server state?

PH
07-31-2002, 01:33 PM
I made a mistake - glActiveTexture(..) is a server state where as glClientActiveTexture(..) is a client state.

I'm actually looking at the GL1.4 spec right now ( it says which group things belong to ).

Nutty
07-31-2002, 01:37 PM
Hmmm.. well glPushAttrib(ALL), doesn't save the glActiveTextureUnit value on my system here.

Unless its a bug.

PH
07-31-2002, 01:39 PM
I'll try it on my Radeon 8500 and see what it does...just a sec.

PH
07-31-2002, 01:44 PM
Done, it works for me.

Nutty
07-31-2002, 01:48 PM
hmmmmm..

you sure you used ALL attrib bits? and glActiveTextureUnit function?

Matt??

I'm using 30.30 drivers on gf4 if anyones interested.

Nutty

PH
07-31-2002, 01:53 PM
This is the test I used,




int Test;
glActiveTextureARB( GL_TEXTURE2_ARB );
glPushAttrib( GL_ALL_ATTRIB_BITS );

glActiveTextureARB( GL_TEXTURE3_ARB );
glGetIntegerv( GL_ACTIVE_TEXTURE_ARB, &Test );
printf( "Before 0x%X\n", Test );

glPopAttrib();
glGetIntegerv( GL_ACTIVE_TEXTURE_ARB, &Test );
printf( "After 0x%X\n", Test );



And the result,

Before 0x84C3 ( == GL_TEXTURE3_ARB )
After 0x84C2 ( == GL_TEXTURE2_ARB )

Nutty
07-31-2002, 02:00 PM
With the same code I get.

0x84C3
0x84C3

The same value twice. It's either a bug, or its not called for in the spec.

PH
07-31-2002, 02:06 PM
It's a bug - have a look at Table 6.17 in the GL1.4 spec. It says that GL_ACTIVE_TEXTURE is part of the attribute group 'texture' which means it should be pushed/poped. Also, some info on pages 214/5.

mcraighead
07-31-2002, 06:55 PM
This is a known bug that will be fixed in a future driver release.

- Matt

knackered
07-31-2002, 11:21 PM
Originally posted by mcraighead:
This is a known bug that will be fixed in a future driver release.

- Matt

Known now, you mean? http://www.opengl.org/discussion_boards/ubb/wink.gif

Eric
07-31-2002, 11:41 PM
Just out of curiosity, is it fixed in 30.82?

Regards.

Eric