public void VertexPositionColorTextured3D()
 {
     var vertex = new VertexPositionColorTextured(Vector.UnitX, Color.Red, Point.One);
     Assert.AreEqual(vertex.Position, Vector.UnitX);
     Assert.AreEqual(vertex.Color, Color.Red);
     Assert.AreEqual(vertex.TextureCoordinate, Point.One);
 }
Exemplo n.º 2
0
 public override void Draw(VertexPositionColorTextured[] vertices)
 {
     var usedSampler = DisableLinearFiltering ? GetPointSamplerLazy() : GetLinearSamplerLazy();
     device.Context.PixelShader.SetShaderResource(0, NativeResourceView);
     device.Context.PixelShader.SetSampler(0, usedSampler);
     base.Draw(vertices);
 }
Exemplo n.º 3
0
 public override void Draw(VertexPositionColorTextured[] vertices)
 {
     nativeDevice.Textures[0] = NativeTexture;
     nativeDevice.SamplerStates[0] = DisableLinearFiltering ?
         SamplerState.PointClamp :
         SamplerState.LinearClamp;
     base.Draw(vertices);
 }
Exemplo n.º 4
0
 public override void DrawVertices(VerticesMode mode, VertexPositionColorTextured[] vertices)
 {
     CheckCreatePositionColorTextureBuffer();
     device.SetData(positionColorUvVertexBuffer, vertices, vertices.Length);
     drawShader.Apply();
     BindVertexBuffer(positionColorUvVertexBuffer, VertexPositionColorTextured.SizeInBytes);
     if (lastIndicesCount == -1)
         DoDraw(mode, vertices.Length);
     else
         DoDrawIndexed(mode, lastIndicesCount);
     AfterDraw();
 }
Exemplo n.º 5
0
 public override void DrawVertices(VerticesMode mode, VertexPositionColorTextured[] vertices)
 {
     CheckCreatePositionColorTextureBuffer();
     positionColorUvVertexBuffer.SetData(vertices, 0, vertices.Length, SetDataOptions.Discard);
     BindVertexBuffer(positionColorUvVertexBuffer);
     if (lastTexture != device.NativeDevice.Textures[0])
     {
         ApplyEffect(true);
         lastTexture = device.NativeDevice.Textures[0];
     }
     if (lastIndicesCount == -1)
         DoDraw(mode, vertices.Length);
     else
         DoDrawIndexed(mode, vertices.Length, lastIndicesCount);
 }
Exemplo n.º 6
0
 public override void Draw(VertexPositionColorTextured[] vertices)
 {
     GL.Enable(EnableCap.Texture2D);
     GL.BindTexture(TextureTarget.Texture2D, glHandle);
     base.Draw(vertices);
 }