Scan texture into memory line by line

Hello guys,

I still have problems with my loading. I want to scan a texture from main memory into the graphics memory line by line.

An example would be a 64x128 image. Everytime my rendering thread displays a frame, I upload 1 line of the picture into memory until I finally have 128 lines uploaded, each with the width of 64 totalling in the original 64x128 image.

This would be fast, and could ensure for example a fluent loading animation, or prefetching of textures before loading a new world/stage/instance/whatever in my computer games without stalling animations or the flow of the game(transparent to the user).

Can someone please help me, I heard this can be done with gl.glTexSubImage2d, but I’m kinda lost…How can this be done in java code with JOGL?