Code:
void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
D3DRECT rec = { x, y, x + w, y + h };
pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}
void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
FillRGB( x, (y + h - px), w, px, BorderColor, pDevice );
FillRGB( x, y, px, h, BorderColor, pDevice );
FillRGB( x, y, w, px, BorderColor, pDevice );
FillRGB( (x + w - px), y, px, h, BorderColor, pDevice );
}
void DrawHealthbar(int x, int y, int w, int h, D3DCOLOR barCol, D3DCOLOR borCol, int hp, int maxhp)
{
FillRGB(x, y, ( hp / (double)maxhp ) * w, h, barCol, pDevice);
DrawBorder(x, y, w, h, borColor, pDevice);
}
DrawHealthbar(15, 15, 125, 15, pMain->gotoInfoClass->iCurrentHealth, pMain->gotoInfoClass->iMaxHealth);
double kills = pMain->gotoInfoClass->gotoStatsClass->iKills, deaths = pMain->gotoStatsClass->gotoStatsClass->iDeaths, kdr;
char *cKDR;
kdr = kills / deaths;
sprintf(cKDR, "Current KDR : %0.02f", kdr);
//etc...
Credits to Gellin for the classes.