   Drawing Polygons
  I am having some difficulty getting some polygons I am trying to render to work correctly. I worked out all the compilier errors. It just doesnt display anything when I run the program. Here is my code...#define VERTEXFVF ( D3DFVF_TEX1 | D3DFVF_SPECULAR | D3DFVF_XYZRHW  )//Texture HolderIDirect3DTexture9 *pTexture = NULL;//Vertex BufferIDirect3DVertexBuffer9 *pd3dVertexBuffer = NULL;//Pointer To Vertex Buffer MemoryBYTE *ptr;//Vertex Structuretypedef struct {D3DCOLOR specular;FLOAT x, y, z, rhw;FLOAT u, v;} vertexStruct;int screenWidth = 1024;int screenHeight = 768;int tileWidth = 128;int tileHeight = 64;int tilesX = screenWidth / tileWidth;int tilesY = screenHeight / tileHeight;int tileHalfX = tileWidth / 2;int tileHalfY = tileHeight / 2;//Vertex DatavertexStruct Vertex[4];//Texture AlignmentVertex[0].u = 0.0f;Vertex[0].v = 0.0f;Vertex[1].u = 1.0f;Vertex[1].v = 0.0f;Vertex[2].u = 0.0f;Vertex[2].v = 1.0f;Vertex[3].u = 1.0f;Vertex[3].v = 1.0f;//Fill Structurefor(int i = 0; i < 4; i++) {//Specular LightingVertex.specular = D3DCOLOR_RGBA( 0, 0, 0, 255 );//RHW Value Not UsedVertex.rhw = 1.0f;}//Create Vertex Bufferpd3dDevice->CreateVertexBuffer( sizeof( vertexStruct ) * 4, 0, VERTEXFVF, D3DPOOL_MANAGED, &pd3dVertexBuffer, NULL );//Lock Vertex Buffer Memorypd3dVertexBuffer->Lock(0, 0, (void**)&ptr, 0);if( SUCCEEDED( pd3dDevice->BeginScene() ) ) {for(int j = 0; j <= tilesY; j++) {for(int i = 0; i <= tilesX; i++) {int originX = (i * tileWidth);int originY = (j * tileHeight);Vertex[0].x = originX + offsetX;Vertex[1].x = originX + tileHalfX + offsetX;Vertex[2].x = originX + tileHalfX + offsetX;Vertex[3].x = originX + tileWidth + offsetX;Vertex[0].y = originY + tileHalfY + offsetY;Vertex[1].y = originY + offsetY;Vertex[2].y = originY + tileHeight + offsetY;Vertex[3].y = originY + tileHalfY + offsetY;//Load Textureif( FAILED( D3DXCreateTextureFromFile( pd3dDevice, "texture.bmp", &pTexture ) ) ){MessageBox(NULL, "Unable to create texture from file.", "ERROR", MB_OK);return;}//Acquire Textureif( FAILED( pd3dDevice->SetTexture( 0, pTexture ) ) ){MessageBox(NULL, "Unable to set texture.", "ERROR", MB_OK);return;}//Set Stream Sourcepd3dDevice->SetStreamSource( 0, pd3dVertexBuffer, 0, sizeof( vertexStruct ) );//Set Vertex Formatpd3dDevice->SetFVF( VERTEXFVF );//Draw Polygonpd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 );//Release Texturepd3dDevice->SetTexture( 0, NULL );}}}//End Scenepd3dDevice->EndScene();//Unlock Vertex Buffer Memorypd3dVertexBuffer->Unlock();//Release Vertex Buffer COM Objectpd3dVertexBuffer->Release();
  Not even one reply? I noticed that I was forgetting a viewport and the projection and view matrix but it still is not displaying correctly...Any ideas would be greatly appreciated.   