Hello. While looking at the renderer code for opengl and opengles I’ve noticed that if you create a texture with access flag SDL_TEXTUREACCESS_STREAMING the buffor for the texture is allocated at creation time (SDL_calloc used) and it’s only freed in SDL_DestroyTexture. So, the SDL_LockTexture does nothing but return the pointer to the pixel data and pitch. Considering I want to generate my texture once, or update it rather rarely, wouldn’t it be better to dealloc it on unlock and alloc it again at texture lock ? That’s what I expected to happen actually and I was surprised.
The documentation for SDL_TEXTUREACCESS_STREAMING states that it is intended for use when the texture changes frequently. It implies that SDL_TEXTUREACCESS_STATIC would be more appropriate for your “generate once, or update rather rarely” usage pattern.
Oh yes you are right. Somehow I missed it. Thank you