I can write a draw_triangle function in DirectX, it is no so difficult, there is also an example already in the samples folder.

But the problem is Triangles can not be used for drawing bodies because they have no necessary features such as materials, normals, lighting, collision detection, clipping and so on.

Code:
#include <acknex.h>
#include <default.c>
#include <d3d9.h>

// define a 2D vertex struct
typedef struct VERTEX_FLAT { 
	float x,y,z; 
	float rhw; 
	D3DCOLOR color; 
} VERTEX_FLAT;
#define D3DFVF_FLAT (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)


function main()
{ 
	vec_set(screen_color,vector(1,1,1)); // black nontransparent screen

// define and preset the triangle
   VERTEX_FLAT vf[3];
   vf[0].color = 0xFFFF0000; // the red corner
   vf[1].color = 0xFF0000FF; // the blue corner
   vf[2].color = 0xFF00FF00; // the green corner
   vf[0].rhw = vf[1].rhw = vf[2].rhw = 1.0; // no perspective
   
// define three corner vectors   
   VECTOR v[3];
   vec_set(v[0],vector(100,100,0));
   vec_set(v[1],vector(400,100,0));
   vec_set(v[2],vector(400,400,0));

// define the rotation center
	VECTOR center;
	vec_set(center,vector(250,250,0));
	
	wait(1); //wait until the D3D Device is opened after the first frame

// draw a red/blue/green rotating triangle
	var angle = 0;
	while(1) 
	{
// rotate the corner vectors
		int i;
		for (i=0; i<3; i++)
		{
			VECTOR vTemp;
			vec_diff(vTemp,v[i],center);
			vec_rotate(vTemp,vector(angle,0,0));
			vec_add(vTemp,center);
			vf[i].x = vTemp.x;
			vf[i].y = vTemp.y;
			vf[i].z = 0;
		}
		angle += 10*time_step;
		
// open the scene and get the active D3D device
	   LPDIRECT3DDEVICE9 pd3dDev = (LPDIRECT3DDEVICE9)draw_begin();
	   if (!pd3dDev) return;
	
// set some render and stage states
	   pd3dDev->SetRenderState(D3DRS_ALPHABLENDENABLE,FALSE);
	   pd3dDev->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE);
	   pd3dDev->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG2);
	
// now draw the triangle
	   pd3dDev->SetFVF(D3DFVF_FLAT);
	   pd3dDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN,1,(LPVOID)vf,sizeof(VERTEX_FLAT));
	
		wait(1);
	}
}