GL_RG is an 8-bit per channel format. The values are treated as normalized “floats” where a value of 255 becomes 1.0 and 127 is roughly 0.5. If you want the values to be treated as unsigned chars, use GL_RG8UI. For signed chars, use GL_RG8I. For 32-bit floats, use GL_RG32F, but be advised that using more than 32 bits in total (in this case 64 bits) may cause some performance degradation.
I get a fully red image. But if I use GL_RG, I can get the values. Looking at glTexImage2D:
It uses “mInternalFormat” ( GL_RGBA ) where GL_RG32F should go (according to my understanding of the api docs). And GL_RG32F is not one of the acceptable symbolic values for dataFormat. I assume I am overlooking something simple.