public static void TexImage2D <T>(OpenGL.TextureTarget target, Int32 level, OpenGL.PixelInternalFormat internalFormat, Int32 width,
                                          Int32 height, Int32 border, OpenGL.PixelFormat format, OpenGL.PixelType type, T[] data)
            where T : struct
        {
            GCHandle data_ptr = GCHandle.Alloc(data, GCHandleType.Pinned);

            try { Delegates.glTexImage2D(target, level, internalFormat, width, height, border, format, type, data_ptr.AddrOfPinnedObject()); }
            finally { data_ptr.Free(); }
        }
 private static extern void glReadPixels(int x, int y, int width, int height, OpenGL.PixelFormat format, OpenGL.PixelType type, IntPtr data);