What is the range of OpenGL texture ID?

前端 未结 3 1878
走了就别回头了
走了就别回头了 2020-12-17 17:57

I have an object which owns a property Texture_ID. I need to initialize the value for Texture_ID in constructor, so I want some value unused by OpenGL to present that the te

相关标签:
3条回答
  • 2020-12-17 18:12

    0 is the value you're looking for (to represent an unset texture ID/uncreated texture), as 0 is never a valid texture ID.

    0 讨论(0)
  • 2020-12-17 18:20

    I would rather initialize the texture in the constructor. That way you never have an object in an invalid state.

    0 讨论(0)
  • 2020-12-17 18:20

    0 is the value OpenGL uses for its own default texture. It never returns that value to you and you can use that value for your error checking.

    I would although suggest using -1.

    0 讨论(0)
提交回复
热议问题