本文整理汇总了C#中IRenderer.SetMode方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderer.SetMode方法的具体用法?C# IRenderer.SetMode怎么用?C# IRenderer.SetMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderer
的用法示例。
在下文中一共展示了IRenderer.SetMode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public void Draw(IRenderer r, Node n)
{
if (Age > LifeTime)
return;
r.SetMode(RenderMode.Draw3D);
r.SetMaterial(Mat);
r.BindTexture(Mat.diffusemap.Id);
r.UseShader(Shader);
r.SetUniform(Shader.GetUniformLocation("Alpha"), new float[] { CurrentAlpha });
float s = CurrentSize / 2;
Matrix4 m = BaseMatrix * Matrix4Extensions.FromScale(s, s, s);
r.PushMatrix();
r.MultMatrix(m);
r.Draw(Vertices, PrimitiveType.QUADS, 0, 4, null);
r.PopMatrix();
}
示例2: Draw
public void Draw(IRenderer r)
{
r.SetMode(RenderMode.Draw2D);
foreach (Entry e in Lines)
{
string text = e.Text;
//float[] v = anim.GetValues("pos", e.Time);
//Vector2 pos = new Vector2(v[0], v[1]);
//float s = anim.GetValues("size", e.Time)[0];
mf.Draw(r, text, e.CurrentPosition.X, e.CurrentPosition.Y, new Color4f(1, 1, 1), false, e.CurrentSize * 0.667f, e.CurrentSize);
}
}
示例3: Draw
public void Draw(IRenderer r, Node n)
{
CreateBuffers();
Material mq = Material.CreateSimpleMaterial(Root.Instance.ResourceManager.LoadTexture("revenant.tga"));
mq.twosided = true;
mq.wire = true;
r.SetMode(RenderMode.Draw3D);
r.SetMaterial(mq);
IEffect e = (IEffect)Root.Instance.ResourceManager.Load("shaders/simple.cgfx", typeof(IEffect));
float[] modelview = new float[16];
float[] projection = new float[16];
r.GetMatrix(modelview, projection);
Matrix4 m1 = Matrix4Extensions.FromFloats(modelview);
Matrix4 m2 = Matrix4Extensions.FromFloats(projection);
Matrix4 m3 = m2*m1;
e.SetParameter(e.GetParameter("mvp"), Matrix4Extensions.ToFloats(m3));
e.SetParameter(e.GetParameter("mv"), modelview);
e.SetParameter(e.GetParameter("Color"), new float[] {1,0,0,1 });
e.BeginPass(0);
foreach (Md5Mesh m in Meshes)
{
m.Draw(r,n);
}
e.EndPass(0);
}
示例4: Draw
public void Draw(IRenderer r, Node n)
{
r.SetMode(RenderMode.Draw3D);
foreach (Surface s in Surfaces)
{
r.SetMaterial(s.Material);
r.Draw(s.Vbuffer, PrimitiveType.TRIANGLES, 0, s.Ibuffer.buffer.Length, s.Ibuffer);
}
}
示例5: DrawInternal
public override void DrawInternal(IRenderer r, RectangleF rect)
{
base.DrawInternal(r, rect);
r.SetMode(RenderMode.Draw3DPointSprite);
r.UseShader(Shader);
r.Draw(PointBuffer, PrimitiveType.POINTS, 0, Count, null);
r.SetMode(RenderMode.Draw2D);
}