Search code examples
c++openglglsltexture2dopengl-4

GL_TEXTURE_BINDING_2D for glBindImageTexture?


Is there a function to get the currently bound image texture?

I can get the currently bound texture for glBindTexture with glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound_texture);.

Does something similar exist for glBindImageTexture?


Solution

  • § 8.26.1 Image Unit Queries

    The state required for each image unit is summarized in table 23.45 and may be queried using the indexed query commands in that table. The initial values of image unit state are described above for BindImageTexture.

    The enum you probably want is GL_IMAGE_BINDING_NAME.