I am trying to draw pixels on a given texture, when I move my mouse around. Something similar to drawing program, but with layers.
How do I expand my texture so that its dimension matches my window size (e.g. 1280 x 1080), this is mainly because I’d like to click anywhere on the window, and it will update the pixel.
In OpenGL textures get their size set upon creation. You can’t change the size afterwards. But you can create a new texture and copy the contents of the old one to it. For that you bind the old texture as a framebuffer object (FBO) color attachment and render the old texture into it.