コード例 #1
0
ファイル: DataBuffer.cs プロジェクト: falbertp/SharpDX
 /// <summary>
 /// Sets the specified value.
 /// </summary>
 /// <param name="positionInBytes">Relative position in bytes from the beginning of the buffer to set the data to.</param>
 /// <param name="value">The value.</param>
 public void Set(int positionInBytes, Half3 value)
 {
     unsafe
     {
         *((Half3 *)(_buffer + positionInBytes)) = value;
     }
 }
コード例 #2
0
ファイル: DataStream.cs プロジェクト: conankzhang/fez
 public unsafe void Write(Half3 value)
 {
     if (!this._canWrite)
     {
         throw new NotSupportedException();
     }
     *(Half3 *)(this._buffer + this._position) = value;
     this._position += 6L;
 }
コード例 #3
0
ファイル: DataStream.cs プロジェクト: conankzhang/fez
        public unsafe Half3 ReadHalf3()
        {
            if (!this._canRead)
            {
                throw new NotSupportedException();
            }
            Half3 half3 = *(Half3 *)(this._buffer + this._position);

            this._position += 6L;
            return(half3);
        }
コード例 #4
0
 /// <summary>
 /// Writes the specified value.
 /// </summary>
 /// <remarks>
 /// In order to provide faster read/write, this operation doesn't check stream bound.
 /// A client must carefully not read/write above the size of this datastream.
 /// </remarks>
 /// <param name="value">The value.</param>
 public void Write(Half3 value)
 {
     if (!_canWrite)
     {
         throw new NotSupportedException();
     }
     unsafe
     {
         *((Half3 *)(_buffer + _position)) = value;
         _position += 2 * 3;
     }
 }
コード例 #5
0
        /// <summary>
        /// Reads a Half3.
        /// </summary>
        /// <remarks>
        /// In order to provide faster read/write, this operation doesn't check stream bound.
        /// A client must carefully not read/write above the size of this datastream.
        /// </remarks>
        /// <returns>an Half3 from the stream</returns>
        public Half3 ReadHalf3()
        {
            unsafe
            {
                if (!_canRead)
                {
                    throw new NotSupportedException();
                }

                Half3 value = *((Half3 *)(_buffer + _position));
                _position += 2 * 3;
                return(value);
            }
        }
コード例 #6
0
 public unsafe void Set(int positionInBytes, Half3 value)
 {
     *(Half3 *)(this._buffer + positionInBytes) = value;
 }