chiark / gitweb /
Fix object selection on windows 8.
The issue is that the GL_UNSIGNED_INT_8_8_8_8 format is apparently
not supported on some version of windows and leads to a glReadPixels
that returns 0 everywhere which selects the first object only wherever
you click.
The issue with using GL_UNSIGNED_INT is that the result is also different
from linux and windows, for some reason the value on window is mangled
and not all bytes have the correct value. So we are forced to use
GL_UNSIGNED_BYTE and convert the byte into an int to get the position
of the object selected, since GL_UNSIGNED_BYTE seems to have the same
behavior across platforms.
Fixes T24