本文整理汇总了C#中Common.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Common.Load方法的具体用法?C# Common.Load怎么用?C# Common.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common.Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpriteBatch
/// <summary>
/// Should always be created through Backend.CreateSpriteBatch
/// </summary>
internal SpriteBatch(Backend backend, Renderer.RenderSystem renderSystem, Common.ResourceManager resourceManager)
{
if (backend == null)
throw new ArgumentNullException("backend");
if (renderSystem == null)
throw new ArgumentNullException("renderSystem");
if (resourceManager == null)
throw new ArgumentNullException("resourceManager");
Backend = backend;
Buffer = new BatchBuffer(renderSystem, new Renderer.VertexFormat(new Renderer.VertexFormatElement[]
{
new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Position, Renderer.VertexPointerType.Float, 3, 0),
new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.TexCoord, Renderer.VertexPointerType.Float, 2, sizeof(float) * 3),
new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Color, Renderer.VertexPointerType.Float, 4, sizeof(float) * 5),
}), 32);
Shader = resourceManager.Load<Resources.ShaderProgram>("/shaders/sprite");
ShaderSRGB = resourceManager.Load<Resources.ShaderProgram>("/shaders/sprite", "SRGB");
Quads = new List<QuadInfo>();
for (var i = 0; i < 32; i++)
{
Quads.Add(new QuadInfo());
}
RenderStateAlphaBlend = Backend.CreateRenderState(true, false, false, Renderer.BlendingFactorSrc.SrcAlpha, Renderer.BlendingFactorDest.OneMinusSrcAlpha, Renderer.CullFaceMode.Front);
RenderStateNoAlphaBlend = Backend.CreateRenderState(false, false, false, Renderer.BlendingFactorSrc.Zero, Renderer.BlendingFactorDest.One, Renderer.CullFaceMode.Front);
}