I’m developing a program with SDL in C++ using Visual Studio. At the start of the program I create a texture with SDL_TEXTUREACCESS_STREAMING. I then create a 2nd thread passing the SDL_Texture pointer SDL_CreateTexture returns. In the 2nd thread I use SDL_LockTexture with this texture pointer. Depending on what seems timing issues, that’s the end of it, the program hangs, the message loop in the main thread (using SDL_WaitEvent) isn’t producing new events. Sometimes LockTexture works and returns however, and I get the expected result. What could be the cause of this?
EDIT: I tried to create the texture with SDL_TEXTUREACCESS_STATIC, and use SDL_UpdateTexture, but here again, the program hangs most of the time (this time on SDL_UpdateTexture).