|Project:||The Open Toolkit library|
Some forms of GL.ReadPixels() suggest user that allocating width*height array of given type would be sufficient. This is not correct with the default pixelstore alignment (4).
Further, GL.ReadPixels does "GCHandle pixels_ptr = GCHandle.Alloc(pixels, GCHandleType.Pinned)".
It is unclear if the alignment of pixels_ptr matches with the alignment of pixels.
It could be useful to add note about the default pixel store alignment and its consequences when an access violation exception is noticed in GL.ReadPixels.
Alternatively GL.ReadPixels could silently add extra alignment for the default pixel store alignment.