Simple OpenGL texture map not working?

后端 未结 7 1311
天命终不由人
天命终不由人 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:06

    First thing I'd check is the colour material setting, as mentioned by ShadowIce, then check your texture file to ensure it's a reasonable size (i.e. something like 256x256) and an RGB bitmap. If the file has even a slight problem it WILL NOT render correctly, no matter how you try.

    Then, I'd stop trying to just debug that code and instead see what you have different to the tutorial on the NeHe website.

    NeHe is always a good place to check if you're trying to do stuff in OpenGL. Textures are probably the hardest thing to get right, and they only get more difficult as the rest of your GL skills increase.

提交回复
热议问题