Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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);
 }