I cannot figure out why this OpenGL code turns all glColor() calls into double their value. If I do glColor4b($80,$80,$80,$80) i get white pixels drawn. If I do $04,$04,$04,$04 I get $08 pixels draws. Everything gets doubled. I cannot understand why. What am I doing wrong or missing?
Any ideas/suggestions greatly appreciated. I know it's not the reading of the pixel that is in error. It's the actual drawing of it.
Local TestPixel:Int=$0 'Initialize as if black $00000000 Local TestPixel2:Int=$0 'Initialize as if black $00000000 'Try glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE) glColor4b($80,$80,$80,$80) glBegin(GL_QUADS) 'Draw two quads in the left corners glVertex2i(0,0) glVertex2i(0,2) glVertex2i(2,2) glVertex2i(2,0) 'Draw the first quad, anticlockwise glVertex2i(0,GameClientHeight-2) glVertex2i(0,GameClientHeight) glVertex2i(2,GameClientHeight) glVertex2i(2,GameClientHeight-2) 'Draw the second quad, anticlockwise glEnd() glFinish() 'Make sure all rendering is totally finished before we test glReadPixels(0,0,1,1,GL_RGBA,GL_UNSIGNED_BYTE,Varptr(TestPixel)) 'Get first pixel, all components glReadPixels(0,GameClientHeight-1,1,1,GL_RGBA,GL_UNSIGNED_BYTE,Varptr(TestPixel2)) 'Get second pixel, all components Print "TestPixel: "+Hex$(TestPixel) Print "TestPixel2: "+Hex$(TestPixel2) EnablePolledInput Flip WaitKey
Any ideas/suggestions greatly appreciated. I know it's not the reading of the pixel that is in error. It's the actual drawing of it.