public UniformBufferObject CreateUniformBlock(string uniformBlockName, BufferObjectHint hint)
        {
            UniformBlockBinding uniformBlockBinding = GetUniformBlock(uniformBlockName);

            if (uniformBlockBinding == null)
            {
                throw new ArgumentException("no uniform block with such name", "uniformBlockName");
            }

            UniformBufferObject uniformBuffer = new UniformBufferObject(hint);

            uniformBuffer.Create(uniformBlockBinding.DataSize);

            return(uniformBuffer);
        }
        public void CreateUniformBlock(string uniformBlockName, UniformBufferObject uniformBuffer)
        {
            if (uniformBuffer == null)
            {
                throw new ArgumentNullException("uniformBuffer");
            }

            UniformBlockBinding uniformBlockBinding = GetUniformBlock(uniformBlockName);

            if (uniformBlockBinding == null)
            {
                throw new ArgumentException("no uniform block with such name", "uniformBlockName");
            }

            // Create/Update
            uniformBuffer.Create(uniformBlockBinding.DataSize);
        }