OpenGL Drawing textured model (OBJ) black texture
- by andrepcg
I'm using OpenGL, Glew, GLFW and Glut to create a simple game.
I've been following some tutorials and I have now a good model importer with textures (from ogldev.atspace.co.uk) but I'm having an issue with the model textures.
I have a skybox with a beautiful texture as you can see in the picture
That weird texture behind the helicopter (model) is the heli model that I've applied on purpose to that wall to demonstrate that specific texture is working, but not on the helicopter.
I'll include the files I'm working on so you can check it out.
Mesh.cpp - http://pastebin.com/pxDuKyQa
Texture.cpp - http://pastebin.com/AByWjwL6
Render function + skybox - http://pastebin.com/Vivc9qnT
I'm just calling
mesh->Render();
before the drawSkyBox function, in the render loop.
Why is the heli black when I can perfectly apply its texture to another quad? I've debugged the code and the mesh-render() call is correctly fetching the texture number and passing it to the texture-bind() function.