chiahsien / iphonewavefrontloader

Automatically exported from code.google.com/p/iphonewavefrontloader
1 stars 0 forks source link

When using textures GL_BLEND and GL_TEXTURE_2D are not disabled #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load object with texture into test app
2. See how objects without textures are messed up

See OpenGLTexture3D 's method initWithFilename on line 19 and 70

Please provide any additional information below.
Quick fix was to add to OpenGLWaveFrontObject.m

if (textureCoords != NULL)
    {
        glEnableClientState(GL_TEXTURE_COORD_ARRAY);
        glEnable(GL_TEXTURE_2D);
        glEnable(GL_BLEND);
        glTexCoordPointer(valuesPerCoord, GL_FLOAT, 0, textureCoords);
    }

and in the place then disable 

    if (textureCoords != NULL)
    {
        glDisableClientState(GL_TEXTURE_COORD_ARRAY);
        glDisable(GL_TEXTURE_2D);
        glDisable(GL_BLEND);
    }

Original issue reported on code.google.com by matti.r...@gmail.com on 1 Aug 2009 at 5:56

GoogleCodeExporter commented 8 years ago
Massive! This has fixed the issue I reported in #15 - normal behavior has 
returned. Thank you.

Original comment by dgwilson65@gmail.com on 1 Aug 2009 at 10:00