* PROCESS THE RENDER INFORMATION PACKET * for(int polygon = 0; polygon < 6; ++polygon) { //mat = DirectX.Matrix.Transformation2D(new DirectX.Vector2(renderInformation.Corners.Width / 2, renderInformation.Corners.Height / 2), 0f, renderInformation.Scale, new DirectX.Vector2(renderInformation.Corners.Width / 2, renderInformation.Corners.Height / 2), 0f, new DirectX.Vector2(renderInformation.X, renderInformation.Y)); mat = DirectX.Matrix.Transformation2D(new DirectX.Vector2(0, 0), 0f, renderInformation.Scale, new DirectX.Vector2(0, 0), renderInformation.Rotation, new DirectX.Vector2(renderInformation.X, renderInformation.Y)); float x = 0; float y = 0; float tu = 0; float tv = 0; Color color = Color.White; if(polygon % 6 == 0) { vector.X = renderInformation.Corners.Left; vector.Y = renderInformation.Corners.Bottom; vector.TransformCoordinate(mat); x = vector.X; y = vector.Y; tu = renderInformation.TexturePoints.Left; tv = renderInformation.TexturePoints.Bottom; color = renderInformation.Color; } else if(polygon % 6 == 1) { vector.X = renderInformation.Corners.Left; vector.Y = renderInformation.Corners.Top; vector.TransformCoordinate(mat); x = vector.X; y = vector.Y; tu = renderInformation.TexturePoints.Left; tv = renderInformation.TexturePoints.Top; color = renderInformation.Color; } else if(polygon % 6 == 2) { vector.X = renderInformation.Corners.Right; vector.Y = renderInformation.Corners.Top; vector.TransformCoordinate(mat); x = vector.X; y = vector.Y; tu = renderInformation.TexturePoints.Right; tv = renderInformation.TexturePoints.Top; color = renderInformation.Color; } else if(polygon % 6 == 3) { vector.X = renderInformation.Corners.Left; vector.Y = renderInformation.Corners.Bottom; vector.TransformCoordinate(mat); x = vector.X; y = vector.Y; tu = renderInformation.TexturePoints.Left; tv = renderInformation.TexturePoints.Bottom; color = renderInformation.Color; } else if(polygon % 6 == 4) { vector.X = renderInformation.Corners.Right; vector.Y = renderInformation.Corners.Top; vector.TransformCoordinate(mat); x = vector.X; y = vector.Y; tu = renderInformation.TexturePoints.Right; tv = renderInformation.TexturePoints.Top; color = renderInformation.Color; } else if(polygon % 6 == 5) { vector.X = renderInformation.Corners.Right; vector.Y = renderInformation.Corners.Bottom; vector.TransformCoordinate(mat); x = vector.X; y = vector.Y; tu = renderInformation.TexturePoints.Right; tv = renderInformation.TexturePoints.Bottom; color = renderInformation.Color; } _cache.AddVertex(_device, x, y, tu, tv, color); } * CACHE ADDVERTEX METHOD * public void AddVertex(Direct3D.Device device, float x, float y, float tu, float tv, Color color) { if(_cacheVertices == _cacheCount) Flush(device); _vertices[_cacheVertices].X = x; _vertices[_cacheVertices].Y = y; _vertices[_cacheVertices].Tu = tu; _vertices[_cacheVertices].Tv = tv; _vertices[_cacheVertices].Color = color.ToArgb(); _cacheVertices++; }