本文整理汇总了C#中RenderHelper.RenderUserPrimitive方法的典型用法代码示例。如果您正苦于以下问题:C# RenderHelper.RenderUserPrimitive方法的具体用法?C# RenderHelper.RenderUserPrimitive怎么用?C# RenderHelper.RenderUserPrimitive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderHelper
的用法示例。
在下文中一共展示了RenderHelper.RenderUserPrimitive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
/// <summary>
/// Draws the box.
/// </summary>
/// <param name="render">The render.</param>
/// <param name="view">The viewing matrix.</param>
/// <param name="projection">The projection matrix.</param>
public void Draw(RenderHelper render, Matrix view, Matrix projection)
{
if (Visible)
{
if (verts.Count == 0)
return;
//// Setup the effect.
effect.View = view;
effect.Projection = projection;
render.RenderUserPrimitive<VertexPositionColor>(effect,PrimitiveType.LineList, verts.ToArray(), 0, verts.Count() / 2);
}
}
示例2: Draw
public void Draw(RenderHelper render,ICamera2D cam)
{
render.SetSamplerState(SamplerState.AnisotropicWrap,0);
render.PushRasterizerState(RasterizerState.CullNone);
_basicEffect.Projection = cam.SimProjection;
_basicEffect.View = cam.SimView;
render.RenderUserPrimitive(_basicEffect,PrimitiveType.TriangleList, _borderVerts, 0, 8);
render.PopRasterizerState();
}
示例3: Draw
/// <summary>
/// Draws the box.
/// </summary>
/// <param name="render">The render.</param>
/// <param name="view">The viewing matrix.</param>
/// <param name="projection">The projection matrix.</param>
public void Draw(RenderHelper render, Matrix view, Matrix projection)
{
if (Visible)
{
//// Setup the effect.
effect.View = view;
effect.Projection = projection;
verts[0].Position = StartPoint;
verts[0].Color = Color;
verts[1].Position = EndPoint;
verts[1].Color = Color;
render.RenderUserPrimitive<VertexPositionColor>(effect,PrimitiveType.LineList, verts, 0, verts.Count() / 2);
}
}