1.1 Translator conformance: fix texture issues
This fixes three issues:
1. glGet(GL_2d_TEXTURE_BINDING) should be handled by the translator rather
than by OpenGL.
2. glIsTexture shoud return GL_TRUE only if the texture was bound at some
point - add a wasBound member to the TextureData and maintain it.
3. glTexParameter(GL_GENERATE_MIPMAP) did not work. The first problem was
that it was not allowed by our validator - fixed. The next issue is that
this enum is not necessarily supported by the OpenGL implementation - it
is in OpenGL 2.x, but was replaced by an extension in 3.x. So in case the
extension does not exist, and GL_GENERATE_MIPMAP is required, save this info
in a new requiresAutoMipmap member of TextureData and call glGenerateMipmapExt
whenever glTex(Sub)Image2D is called.
There is a theoretical case where neither GL_GENERATE_MIPMAP nor glGenerateMipmap
is supported by the OpenGL implementation - this is not likely to happen, but
if we find such an implementation it might require implementing a mipmap
generation software algorithm (which is bad).
5 files changed