Re: [PyOpenGL-Users] Textures on Bad Hardware
Brought to you by:
mcfletch
From: Almar K. <alm...@gm...> - 2010-09-16 06:39:52
|
On 16 September 2010 02:47, Ian Mallett <geo...@gm...> wrote: > On Tue, Sep 14, 2010 at 1:59 PM, Almar Klein <alm...@gm...>wrote: > >> The pretties way of doing this is checking the openGl version and if its < >> 2.0, you need power-of-two textures. However, I recently encountered a >> system with an ATI card, that did have OpenGl >=2.0, but did NOT support >> non-power-of-two textures. So my current implementation just tries resizing >> the texture if it fails to initialize, or if OpenGl <2.0. >> > I've simply added a global flag to my library that automatically resizes > all textures to a power of two (either automatically up, or to the nearest > level), and then made a note to favor power-of-two textures. It's pretty > lame that Intel does this. > > I don't suppose there's a more useful error that could be thrown here--does > the GL return something helpful in this regard? > I'm not sure if I understand your question correctly. Are you asking for the best way to detect whether power-of-two textures are required on a particular system? Well, what *should* work 100% is checking the opengl version (with glGetString(GL_VERSION)). But since this is not always enough for ATI, and maybe also for Intel, I check after creating a texture, whether the texture is valid (with glIsTexture), and try making it a power-of-two if its not. Cheers, Almar |