Edge case in GL_CreateTexture

I was having some problems with creating a texture and then having it draw nothing when I tried to render it.? gDEBugger showed that when it went to bind the texture, it was binding a handle value of 0.? I eventually traced this back to the value 0 being returned from glGenTextures inside GL_CreateTexture.

Turns out I made a dumb mistake: this was all happening inside a script thread, and I didn’t send the graphical code back to the render thread for execution, so glGenTextures was failing with GL_INVALID_OPERATION.? But SDL never caught that, so I didn’t get an error back from the Create Texture operation, which made debugging the issue a lot more work.? It would be nice if it checked the result of glGenTextures just in case anything went wrong, and reported that back to the caller, instead of silently creating an invalid texture.