Thread: Re: [PyOpenGL-Users] glTexImage2d size
Brought to you by:
mcfletch
From: Jonathan H. <jh...@sp...> - 2006-11-20 16:56:38
|
Jon wrote: > AFAIK the ability to support non-power-of-2 (NPO2 or NPOT) textures is a > card-specific thing, and hence their OpenGL driver thing. > > I _think_ NPO2 texture support is supposed to be a standard feature of OpenGL > 2.X, but I don't think all cards support it. I also understand that this is the case, but I don't have a reference handy. In any case, I think the right thing to do is to test for the presence of the GL_ARB_texture_non_power_of_two extension. This is what I do: try: from OpenGL.GL.ARB.texture_non_power_of_two import glInitTextureNonPowerOfTwoARB except: # not defined in PyOpenGL 2.0.0.44 def glInitTextureNonPowerOfTwoARB(): return False # call this after glInit() card_handles_NPOT = glInitTextureNonPowerOfTwoARB() Jonathan. |