pbuffer and colors


Im drawing lines to a pbuffer, all with different colors, but sometimes they don’t show all in different colors, i’m always sending the same lines with the same colors.

After i draw to the pbuffer i use glCopyTexSubImage2D to copy it to a texture, and glReadPixels to get the color data they both return the same image, even if its right or wrong.
It looks right in most cases, except when the drawing goes out of the pbuffer area, if thats the case, and only sometimes, the lines are draw on the correct place, but with wrong colors