Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why would glIsEnabled not work?

14 views
Skip to first unread message

Kenny Tilton

unread,
Sep 26, 2004, 11:41:19 PM9/26/04
to
Hi, just a newby here. i am trying to debug some odd behavior with
textures but when I tried using glIsEnabled to validate things
(GL_TEXTURE_2D, in fact) it seems to be giving me bogus results: it
returns GL_FALSE (0) even when the texture rendering is working. I get
this also from glGetBooleanv using that mechanism. I also get GL_FALSE
from glIsTexture on working texture IDs. Here is a code snippet:

glGetIntegerv( GL_TEXTURE_2D_BINDING_EXT, &activeTextureID);
assert( glGetError() == GL_NO_ERROR );

if( activeTextureID != glTextureID) // glTextureID is an int
{
GLint a;
glEnable( GL_TEXTURE_2D );
assert( glGetError() == GL_NO_ERROR );

//assert( glIsEnabled( GL_TEXTURE_2D ) == GL_TRUE); // fails!
glBindTexture( GL_TEXTURE_2D, (GLuint)glTextureID);
assert( glGetError() == GL_NO_ERROR );
glGetIntegerv( GL_TEXTURE_2D_BINDING_EXT, &a);
//assert( a == glTextureID ); // nope, should be
if ( glIsTexture( (GLuint) glTextureID) == GL_TRUE) // nope, should be

I am running Windows XP Home on a Dell Inspiron 5150 laptop with a
Mobile radeon 9000, and compiling with VC++6 and linking against the MS
OpenGL DLLs.

Is there some way I might have screwed up these simple query functions?
I will look for other ways to debug, meanwhile.

kenny

--
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

fungus

unread,
Sep 27, 2004, 12:46:52 AM9/27/04
to
Kenny Tilton wrote:
> Hi, just a newby here. i am trying to debug some odd behavior with
> textures but when I tried using glIsEnabled to validate things
> (GL_TEXTURE_2D, in fact) it seems to be giving me bogus results:

> Is there some way I might have screwed up these simple query functions?
>

DO you have an active render context?


--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.

Governments, like diapers, should be changed often,
and for the same reason.

Kenny Tilton

unread,
Sep 27, 2004, 10:42:55 PM9/27/04
to

fungus wrote:
> Kenny Tilton wrote:
>
>> Hi, just a newby here. i am trying to debug some odd behavior with
>> textures but when I tried using glIsEnabled to validate things
>> (GL_TEXTURE_2D, in fact) it seems to be giving me bogus results:
>
>
>> Is there some way I might have screwed up these simple query functions?
>
>
> DO you have an active render context?

Doh! Nope. Thanks. I have this declarative hack which initializes things
at its own discretion. I have now modified that to make sure the OpenGL
stuff does not get touched unless the right render context is active.

The query functions now work as expected, and some of the odd texture
behavior has gone away. Not all, but now at least I will be able to
debug more easily.

Thx again, kenny

0 new messages