本文整理汇总了C#中System.Buffer.SetNext方法的典型用法代码示例。如果您正苦于以下问题:C# Buffer.SetNext方法的具体用法?C# Buffer.SetNext怎么用?C# Buffer.SetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Buffer
的用法示例。
在下文中一共展示了Buffer.SetNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddJoint
private int AddJoint (int pointIndex, ref JoinSample joinSample, PenWorkspace ws, Buffer<Vector2> insetBuffer, Buffer<Vector2> outsetBuffer)
{
InsetOutsetCount vioCount = new InsetOutsetCount();
switch (_pen.LineJoin) {
case LineJoin.Miter:
vioCount = _pen.ComputeMiter(ref joinSample, ws);
break;
case LineJoin.Bevel:
vioCount = _pen.ComputeBevel(ref joinSample, ws);
break;
}
if (insetBuffer != null) {
for (int i = 0; i < vioCount.InsetCount; i++)
insetBuffer.SetNext(ws.XYInsetBuffer[i]);
}
if (outsetBuffer != null) {
for (int i = 0; i < vioCount.OutsetCount; i++)
outsetBuffer.SetNext(ws.XYOutsetBuffer[i]);
}
return (_strokeType != StrokeType.Outline) ? AddJoint(pointIndex, vioCount, ws) : 0;
}
示例2: AddStartOrEndPoint
private int AddStartOrEndPoint (int pointIndex, PenWorkspace ws, Buffer<Vector2> positionBuffer, bool ccw)
{
int xyCount = ws.XYBuffer.Index;
if (positionBuffer != null) {
for (int i = 0; i < ws.OutlineIndexBuffer.Index; i++)
positionBuffer.SetNext(ws.XYBuffer[ws.OutlineIndexBuffer[i]]);
}
if (_strokeType == StrokeType.Outline)
return 0;
int baseIndex = _vertexBufferIndex;
_vertexBufferIndex += xyCount;
for (int i = 0; i < xyCount; i++)
_positionData[baseIndex + i] = ws.XYBuffer[i];
for (int i = 0; i < ws.IndexBuffer.Index; i++)
_indexData[_indexBufferIndex++] = (short)(baseIndex + ws.IndexBuffer[i]);
if (_colorData != null) {
for (int i = 0; i < xyCount; i++)
_colorData[baseIndex + i] = _pen.ColorAt(ws.UVBuffer[i], ws.PathLengthScale);
}
if (_textureData != null) {
int texWidth = _pen.Brush.Texture.Width;
int texHeight = _pen.Brush.Texture.Height;
for (int i = baseIndex; i < _vertexBufferIndex; i++) {
Vector2 pos = _positionData[i];
_textureData[i] = new Vector2(pos.X / texWidth, pos.Y / texHeight);
}
}
_jointCCW[pointIndex] = ccw;
return xyCount;
}