Possible ways to retrieve GL texture id

I am currently doing

SDL_GL_BindTexture(tex, nullptr, nullptr);
GLuint textureId = 0;
glGetIntegerv(GL_TEXTURE_BINDING_2D, reinterpret_cast<GLint*>(&textureId));
SDL_GL_UnbindTexture(tex);

when i initialize the texture.
The reason for this is that certain 3rd party libraries use the GLuint for their Image drawing functions.
Using the SDL Renderer along this works fine so far, but it is a bit annoying that i require this wrapper.

Is there a recommended way to get the GL/GLES/… id of an SDL_Texture?

~mkalte

I also have the same question.

It seems that it does not exist

I have used this method, I don’t know how reliable it is but it seems to work for me:

      SDL_GL_BindTexture(SDL_texture, NULL, NULL);
      glGetIntegerv(GL_TEXTURE_BINDING_2D, &GL_texture);

Looking for a solution to the same.
The way mkalte does it works for me too, but seems wastefully unnecessary.