Hi, I'm a beginner in the DX programming.
I'm trying of draw a triangle in a full screen, but I don't where is the error, I only see a full screen display with out the triangle
Can't U help me
private void RenderFrame()
{
m_device.Clear(
ClearFlags.Target, Color.Navy, 1.0f, 0); // Render frame here GraphicsBuffer<PositionColored> m_verts = new GraphicsBuffer<PositionColored>(3);m_verts.Write(
new PositionColored(-2.0f, -2.0f, 5.0f, Color.Red));m_verts.Write(
new PositionColored(0.0f, 2.0f, 5.0f, Color.Green));m_verts.Write(
new PositionColored(2.0f, -2.0f, 5.0f, Color.Blue));m_device.BeginScene();
m_device.SetRenderState(
RenderStates.ZEnable, true);m_device.SetRenderState(
RenderStates.ZBufferWriteEnable, true);m_device.SetRenderState(
RenderStates.AlphaBlendEnable, false); // Render trianglem_device.VertexFormat =
PositionColored.Format;m_device.DrawUserPrimitives(
PrimitiveType.TriangleList, 1, m_verts);m_device.EndScene();
m_device.Present();
}

Don't draw a triangle with april 2006
rage29316
That's a good point, Jon, as long as everybody understands that you MDX 2.0 code will most likely stop working once we release the XNA Framework and remove the MDX 2.0 beta assemblies (well, that's no quite true...if you have the 2.0 assemblies installed, we won't delete them).
bjornstoro
Carefully look at Tutorial 2 (Rendering Vertices) in the DirectX SDK and compare it to what you are doing.
Also, I recommend dropping back to MDX 1.1 instead of 2.0. The 2.0 beta of MDX has been deprecated and will be replaced by the XNA Framework when it's available.
Paul J.M. Settels
Hugo Ribeiro
There could be several things wrong with this sample.
First, you're not clearing the depth buffer, only the target. You need to or in the depth buffer flag to make sure that the old depth buffer doesn't get in the way.
Second, check the winding order, and make sure that you cull out the kind of triangle that's not winding in the way you want.
Third, make sure that your World, View and Projection matrices are good for what you want to do. In this case, you can set World and View to Matrix.Identity, but you have to set a perspective matrix into the Transform.Projection matrix.
Fourth, make sure that the texture units are disabled, so that they don't interfere with the colors you're attempting to pass through. Set ColorOp[0] to Disable.
Fifth, make sure you turn off fixed-function lighting.
kendy