I have id
like a variable of a opengl texture identificator. I generate it with glGenTextures (1, &id)
and it works fine. The problem is when i call glGenTextures
function in a different thread. It always return 0 and not generate texture. I think it is because the opengl context is different.
I use SDL for load the image and then pass it to the texture with glTexImage2D
. I'm trying to create a new SDL_GLContext
in the thread to share it with the main thread, but i don't how to make it. I can modify id
inside the thread with id=2
for example, and read and print it, but i can't modify with glGenTextures
and i can't generate the texture that i need.