public void AssignBuffer <T>(T[] array) { var h = System.Runtime.InteropServices.GCHandle.Alloc(array, System.Runtime.InteropServices.GCHandleType.Pinned); OpenGL.glBindTexture(target, handle); OpenGL.glTexImage2D(target, 0, int_fmt, width, height, 0, fmt, type, h.AddrOfPinnedObject()); OpenGL.glGenerateMipmap(target); h.Free(); }
internal void AssignTexture(IntPtr ptr) { OpenGL.glBindTexture(target, handle); OpenGL.glTexImage2D(target, 0, (int)int_fmt, width, height, 0, (uint)fmt, (uint)type, ptr); OpenGL.glGenerateMipmap(target); }