Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glGenTexture weirdness



> I'm using glGenTexture to generate a texture ID:
>
> GLuint theTextureID = 0;
> ::glGenTexture(1, &theTextureID);
> ThrowIf_(glGenTexture != 0 && ::glGetError() == GL_NO_ERROR);
>
> The odd thing is that it isn't setting theTextureID variable (I've used
> other values aside from '0') and yet glGetError() isn't returning an error.
> Anyone seen this behavior?

yes, when there is no current context set, the gl calls are no-ops, and
nothing much happens.

actually getting a value back is indication that you have a valid
texture name (the 0 name is reserved so you can test against this).

In the docs you'll note that the function only sets the error state when
passed a negative count or when called between a glBegin()/glEnd() pair.

=td=




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.