Hello! I'm new here so pls forgive me if this question was already asked.
How should I make dynamically changing textures?
Now if the color of my texture has been changed I siply make a new texture:
private ByteBuffer pixels = //here I change the color;
//Maybe the problem is I put every byte to the ByteBuffer one by one
glBindTexture(GL_TEXTURE_2D, id);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
My problem is it's working, but my performace is really dropped from stabile 60 fps to 4-7 fps.
This drop is because I need to change the color every frame. This texture is smoothly changing from color[n] to color[n+1].
Probably this isn't the right method to do it. Or is it but I'm doing somthig wrong?