/// <summary> /// [Event] DrawTimer interval elapsed. /// </summary> /// <remarks> /// This is the main draw function of windows used in this renderer - all drawing logic /// should go in this method! /// </remarks> private void DrawTimer_Tick(object sender, System.EventArgs e) { CurrentContext.Clear(Color.Black); // This bit is for testing purposes to make sure drawing happens correctly. for (int tri = 0; tri < VertexData.Length; tri += 6) { float[] floatBuffer = new float[3 * 2]; // 3 points of 2 dimensions Point[] realPoints = new Point[3]; Array.Copy(VertexData, tri, floatBuffer, 0, 6); for (int point = 0; point < 3; point++) { realPoints[point] = new Point( (int)(floatBuffer[point * 2] * InitialSize.Width), (int)(floatBuffer[point * 2 + 1] * InitialSize.Height) ); } CurrentContext.DrawPolygon(Pens.Blue, realPoints); } SwapBuffers(); }