public unsafe void BindVertexSamplers( Texture[] textures, Sampler[] samplers ) { var texturePtrs = stackalloc IntPtr[textures.Length]; var samplerPtrs = stackalloc IntPtr[samplers.Length]; for (var i = 0; i < textures.Length; i += 1) { texturePtrs[i] = textures[i].Handle; } for (var i = 0; i < samplers.Length; i += 1) { samplerPtrs[i] = samplers[i].Handle; } Refresh.Refresh_BindVertexSamplers( Device.Handle, Handle, (IntPtr)texturePtrs, (IntPtr)samplerPtrs ); }