本文整理汇总了C#中SFML.Graphics.RenderStates.Marshal方法的典型用法代码示例。如果您正苦于以下问题:C# RenderStates.Marshal方法的具体用法?C# RenderStates.Marshal怎么用?C# RenderStates.Marshal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFML.Graphics.RenderStates
的用法示例。
在下文中一共展示了RenderStates.Marshal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
////////////////////////////////////////////////////////////
/// <summmary>
/// Draw the object to a render target
///
/// This is a pure virtual function that has to be implemented
/// by the derived class to define how the drawable should be
/// drawn.
/// </summmary>
/// <param name="target">Render target to draw to</param>
/// <param name="states">Current render states</param>
////////////////////////////////////////////////////////////
public void Draw(RenderTarget target, RenderStates states)
{
RenderStates.MarshalData marshaledStates = states.Marshal();
if (target is RenderWindow)
{
sfRenderWindow_drawVertexArray(((RenderWindow)target).CPointer, CPointer, ref marshaledStates);
}
else if (target is RenderTexture)
{
sfRenderTexture_drawVertexArray(((RenderTexture)target).CPointer, CPointer, ref marshaledStates);
}
}
示例2: Draw
////////////////////////////////////////////////////////////
/// <summmary>
/// Draw the object to a render target
///
/// This is a pure virtual function that has to be implemented
/// by the derived class to define how the drawable should be
/// drawn.
/// </summmary>
/// <param name="target">Render target to draw to</param>
/// <param name="states">Current render states</param>
////////////////////////////////////////////////////////////
public void Draw(RenderTarget target, RenderStates states)
{
//states.Transform *= Transform; // NetGore custom line
RenderStates.MarshalData marshaledStates = states.Marshal(Transform); // NetGore custom line
if (target is RenderWindow)
{
sfRenderWindow_drawShape(((RenderWindow)target).CPointer, CPointer, ref marshaledStates);
}
else if (target is RenderTexture)
{
sfRenderTexture_drawShape(((RenderTexture)target).CPointer, CPointer, ref marshaledStates);
}
ShapeHelper.AMDShapeRenderFix(target);
}
示例3: Draw
////////////////////////////////////////////////////////////
/// <summmary>
/// Draw the object to a render target
///
/// This is a pure virtual function that has to be implemented
/// by the derived class to define how the drawable should be
/// drawn.
/// </summmary>
/// <param name="target">Render target to draw to</param>
/// <param name="states">Current render states</param>
////////////////////////////////////////////////////////////
public void Draw(RenderTarget target, RenderStates states)
{
states.Transform *= Transform;
RenderStates.MarshalData marshaledStates = states.Marshal();
if (target is RenderWindow)
{
sfRenderWindow_drawText(((RenderWindow)target).CPointer, CPointer, ref marshaledStates);
}
else if (target is RenderTexture)
{
sfRenderTexture_drawText(((RenderTexture)target).CPointer, CPointer, ref marshaledStates);
}
}
示例4: Draw
////////////////////////////////////////////////////////////
/// <summary>
/// Draw primitives defined by a sub-array of vertices
/// </summary>
/// <param name="vertices">Pointer to the vertices</param>
/// <param name="start">Index of the first vertex to use in the array</param>
/// <param name="count">Number of vertices to draw</param>
/// <param name="type">Type of primitives to draw</param>
/// <param name="states">Render states to use for drawing</param>
////////////////////////////////////////////////////////////
public void Draw(Vertex[] vertices, uint start, uint count, PrimitiveType type, RenderStates states)
{
RenderStates.MarshalData marshaledStates = states.Marshal();
unsafe
{
fixed (Vertex* vertexPtr = vertices)
{
sfRenderWindow_drawPrimitives(CPointer, vertexPtr + start, count, type, ref marshaledStates);
}
}
}