Simple OpenGL texture map not working?

后端 未结 7 1351
天命终不由人
天命终不由人 2020-12-31 19:31

I\'m trying to figure out texture mapping in OpenGL and I can\'t get a simple example to work.

The polygon is being drawn, though it\'s not textured but just a soli

7条回答
  •  爱一瞬间的悲伤
    2020-12-31 20:18

    Some random ideas:

    • GL_COLOR_MATERIAL might be enabled
    • change "glTexEnvf" to "glTexEnvi" and see if that helps
    • if texName1 is 0 after glGenTextures you might not have an active OpenGL context

    For error checking I recommend writing a small function that prints readable output for the most common results from glGetErrors and use that to find the line that creates the error. Another possibility would be to use something like GLIntercept, BuGLe or gDEBugger.

提交回复
热议问题