Border Oluşturma:
Mause:
Kare:
Code:
void DrawBorder( float x, float y, float w, float h, DWORD color1, DWORD color2, LPDIRECT3DDEVICE9 pDevice )
{
DXUT_SCREEN_VERTEX vertices[6] =
{
x + w, y, 0.0f, 1.0f, color2, 0,0,
x + w, y + h, 0.0f, 1.0f, color2, 0,0,
x, y + h, 0.0f, 1.0f, color2, 0,0,
x, y + h, 0.0f, 1.0f, color1, 0,0,
x, y, 0.0f, 1.0f, color1, 0,0,
x + w, y, 0.0f, 1.0f, color1, 0,0,
};
pDevice->DrawPrimitiveUP( D3DPT_LINESTRIP, 5, vertices, sizeof(DXUT_SCREEN_VERTEX) );
}
Code:
void DrawMouse(DWORD color,LPDIRECT3DDEVICE9 pDevice)
{
POINT myCursor;
GetCursorPos(&myCursor);
ScreenToClient(GetForegroundWindow(),&myCursor);
int cList[6] = {8,6,4,3,2,1};
for(int i=0;i<6;i++)
DrawRect(myCursor.x+i+2,myCursor.y+i+2,2,cList[i],Orange,pDevice);
return;
}
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 );
}