I have a texture onto which I render 16 drawings. The texture is 1024×1024 in size and it’s divided into 4×4 “slots”, each 256×256 pixels.
Before I render a new drawing into a slot, I want to clear it so that the old drawing is erased and the slot is totally transparent (alpha=0).
Is there a way to do it with OpenGL or need I just access the texture pixels directly in memory and clear them with memset oslt?
I imagine you’d just update the current texture normally:
Even though you’re replacing every pixel, glTexSubImage2D is faster than recreating a new texture.