コード例 #1
0
        public override void UpdateColor(TracyEnergy.Simba.Data.Keywords.impl.GridBlockProperty property)
        {
            float[] textures      = GetTextureCoords(property);
            int     gridCellCount = this.DataSource.DimenSize;

            unsafe
            {
                IntPtr pointer = this.colorBuffer.MapBuffer(MapBufferAccess.WriteOnly);
                var    array   = (HexahedronTexCoord *)pointer;
                for (int gridIndex = 0; gridIndex < gridCellCount; gridIndex++)
                {
                    array[gridIndex].SetCoord(textures[gridIndex]);
                }
            }
            this.colorBuffer.UnmapBuffer();
        }
コード例 #2
0
        public override void UpdateColor(TracyEnergy.Simba.Data.Keywords.impl.GridBlockProperty property)
        {
            float[] textures      = GetTextureCoords(property);
            int     gridCellCount = this.DataSource.DimenSize;

            OpenGL.BindBuffer(BufferTarget.ArrayBuffer, this.colorBufferPtr.BufferId);
            IntPtr pointer = OpenGL.MapBuffer(BufferTarget.ArrayBuffer, MapBufferAccess.WriteOnly);

            unsafe
            {
                var array = (HexahedronTexCoord *)pointer;
                for (int gridIndex = 0; gridIndex < gridCellCount; gridIndex++)
                {
                    array[gridIndex].SetCoord(textures[gridIndex]);
                }
            }
            OpenGL.UnmapBuffer(BufferTarget.ArrayBuffer);
            OpenGL.BindBuffer(BufferTarget.ArrayBuffer, 0);
        }