Trans parente, aqui está a parte da Base onde fica as configurações do DrawBoxs, DrawRect, Font e Blah Blah Blah...
Code:
#include "stdafx.h"
LPD3DXFONT Directx_Font = NULL;
LPDIRECT3DDEVICE9 pDevice;
LPDIRECT3DPIXELSHADER9 BlueSh,RedSh,GreenSh;
bool BlueShad = false;
bool RedShad = false;
bool GreenShad = false;
//..:Cores::..//
const D3DCOLOR Red = D3DCOLOR_ARGB(255,255,0,0); // Vermelho
const D3DCOLOR Green = D3DCOLOR_ARGB(255,127,255,0); // Verde
const D3DCOLOR Orange = D3DCOLOR_ARGB(255,255,140,0); // Laranjado
const D3DCOLOR Blue = D3DCOLOR_ARGB(255,0,0,255); // Azul
const D3DCOLOR Yellow = D3DCOLOR_ARGB(255,255,255,51); // Amarelo
const D3DCOLOR Black = D3DCOLOR_ARGB(255,0,0,0); // Preto
const D3DCOLOR Grey = D3DCOLOR_ARGB(255,112,112,112); // Cinza
const D3DCOLOR DarkGrey = D3DCOLOR_ARGB(180,70,70,70); // Cinza Escuro
const D3DCOLOR Gold = D3DCOLOR_ARGB(255,255,215,0); // Dourado
const D3DCOLOR Pink = D3DCOLOR_ARGB(255,255,192,203); // Rosa
const D3DCOLOR Purple = D3DCOLOR_ARGB(255,128,0,128); // Roxo
const D3DCOLOR White = D3DCOLOR_ARGB(255,255,255,249); // Branco
const D3DCOLOR Cyan = D3DCOLOR_ARGB(255,0,255,255); // Ciano
const D3DCOLOR Magenta = D3DCOLOR_ARGB(255,255,0,255); // Magenta
const D3DCOLOR Teal = D3DCOLOR_ARGB(255,0,255,255); // Carceta
const D3DCOLOR Lime = D3DCOLOR_ARGB(255,198,255,0); // Lima
const D3DCOLOR SkyBlue = D3DCOLOR_ARGB(255,0,180,255); // Azul Celeste
const D3DCOLOR LightGray = D3DCOLOR_ARGB(255,174,174,174); // Cinza Claro
const D3DCOLOR DarkGray = D3DCOLOR_ARGB(255,71,65,64); // Cinza Escuro
const D3DCOLOR Brown = D3DCOLOR_ARGB(255,77,46,38); // Marrom
const D3DCOLOR Shit = D3DCOLOR_ARGB(255,74,38,38); // Marrom Claro
const D3DCOLOR FireBrick = D3DCOLOR_ARGB(255,48,48,0); // Tijolo
//..::Draw Text::..//
void DrawText(int x,int y,DWORD color,char *text, LPDIRECT3DDEVICE9 pDevice){
RECT rect;
SetRect(&rect, x, y, x, y);
Directx_Font->DrawTextA(NULL,text,-1,&rect, DT_LEFT|DT_NOCLIP, color);
}
//..::Draw Rect::..//
void DrawRect(int x,int y,int h,int w,DWORD Color,LPDIRECT3DDEVICE9 pDevice){
D3DRECT rec;
rec.x1 = x;
rec.x2 = x + w;
rec.y1 = y;
rec.y2 = y + h;
pDevice->Clear(1,&rec,D3DCLEAR_TARGET,Color,0,0);
}
//..::Draw Box::..//
void DrawBox(int x,int y,int h,int w,D3DCOLOR Border, D3DCOLOR Fill,LPDIRECT3DDEVICE9 pDevice){
DrawRect(x,y,h,w,Fill,pDevice);
DrawRect(x,y,h,1,Border,pDevice);
DrawRect(x+w,y,h,1,Border,pDevice);
DrawRect(x,y,1,w, Border,pDevice);
DrawRect(x,y+h,1,w+1, Border,pDevice);
DrawRect(x+2,y+2,h-4,2,Border,pDevice);
DrawRect(x+2,y+2,2,w-4, Border,pDevice);
DrawRect(x+w-4,y+2,h-4,2,Border,pDevice);
DrawRect(x+2,y+h-4,2,w-4, Border,pDevice);
}
//..::Fill Box::..//
void FillBox(int x,int y,int h,int w,D3DCOLOR Fill,LPDIRECT3DDEVICE9 pDevice){
DrawRect(x,y,h,w,Fill,pDevice);
}
//..::Draw Mouse::..//
void DrawMouse (LPDIRECT3DDEVICE9 pDevice, int PosX, int PosY){
DrawRect(PosX, PosY, 5, 5, Blue,pDevice);
}
//..::Current Option::..//
void CurrentOption(int x,int y,int h,int w,D3DCOLOR Border,LPDIRECT3DDEVICE9 pDevice){
DrawRect(x,y,h,1,Border,pDevice);
DrawRect(x+w,y,h,1,Border,pDevice);
DrawRect(x,y,1,w, Border,pDevice);
DrawRect(x,y+h,1,w+1, Border,pDevice);
}
//..::Generate Shader::..//
HRESULT GenerateShader(LPDIRECT3DDEVICE9 pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b){
char szShader[ 64 ];
ID3DXBuffer *pShaderBuf = NULL;
sprintf_s(szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b);
D3DXAssembleShader(szShader, sizeof(szShader), NULL, NULL, 0, &pShaderBuf, NULL);
if(FAILED(pDevice->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)))return E_FAIL;
return S_OK;
}
//..::Cross Hair::..//
void CrossHair(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR Colore){
D3DVIEWPORT9 Viewport;
pDevice->GetViewport(&Viewport);
DWORD ScreenX = Viewport.Width / 2;
DWORD ScreenY = Viewport.Height / 2;
D3DRECT rec2 = {ScreenX-9, ScreenY, ScreenX+9, ScreenY+1};
D3DRECT rec3 = {ScreenX, ScreenY-9, ScreenX+1, ScreenY+9};
pDevice->Clear(1, &rec2, D3DCLEAR_TARGET,Colore, 0, 0);
pDevice->Clear(1, &rec3, D3DCLEAR_TARGET,Colore, 0, 0);
}