コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }