Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Combat Arms Hacks & Cheats › Combat Arms Hack Coding / Programming / Source Code › Custom Classes: DX.h (text, boxes, circle, text highlight and more)

Custom Classes: DX.h (text, boxes, circle, text highlight and more)

Posts 1–5 of 5 · Page 1 of 1
supercarz1991
supercarz1991
Custom Classes: DX.h (text, boxes, circle, text highlight and more)
Diggin through My Documents, found a source code for a menu from none other than Drunken Cheetah himself. Don't know how i got it or from where..But the dip hook works, and the menu is of course sexy as hell...found this in it, figured i'd share because its actually some cool effects for ESP and menus

DX.h
Code:
class CCanvas
{
public:
	//Engine Specific 
	virtual void Init(void* Pram)=0;
	virtual void Begin()=0;
	virtual bool IsValid()=0;
	virtual void End()=0;
	virtual void Reset()=0;
	virtual void Text(char* text,int x, int y, DWORD color)=0;
	virtual int TextWidth(char* text)=0;
	virtual int TextHeight(char* text)=0;
	virtual void Line(float x1,float y1,float x2,float y2,DWORD color)=0;
	virtual void FillGradient(float x,float y,float w,float h,DWORD color1,DWORD color2,DWORD color3,DWORD color4)=0;
	virtual void Poly(POINT* points,int count,DWORD color)=0;

	//Extras
	void Fill(float x,float y,float w,float h,DWORD color)
	{
		FillGradient(x,y,w,h,color,color,color,color);
	}
	void FillCentered(float x,float y,float w,float h,DWORD color)
	{
		FillGradient(x-w/2,y-h/2,w,h,color,color,color,color);
	}
	void Textf(int x, int y, DWORD color, const char *fmt, ...)
	{
		if (!IsValid()) return;
		static char buffer[1024];
		va_list va_alist;
		va_start (va_alist, fmt);
		//_vsnprintf(buffer, sizeof(buffer), fmt, va_alist);
		vsnprintf(buffer, sizeof(buffer), fmt, va_alist);
		va_end (va_alist);
		Text(buffer,x,y,color);
	}
	void TextCenteredf(int x, int y, DWORD color, const char *fmt, ...)
	{
		if (!IsValid()) return;
		static char buffer[1024];
		va_list va_alist;
		va_start (va_alist, fmt);
		vsnprintf(buffer, sizeof(buffer), fmt, va_alist);
		va_end (va_alist);
		Text(buffer,x-TextWidth(buffer)/2,y,color);
	}

	void Circle(int x, int y, int r, int s, DWORD color)
	{
		if (!IsValid()) return;
		float Step = 3.14159265*2.0/s;
		for (float a=0; a < 3.14159265*2.0; a += Step)
		{
			float x1 = r * cos(a) + x;
			float y1 = r * sin(a) + y;
			float x2 = r * cos(a+Step) + x;
			float y2 = r * sin(a+Step) + y;
			Line(x1,y1,x2,y2,color);
		}
	}
	void Box(int x, int y, int w, int h, DWORD color)
	{
		if (!IsValid()) return;
		Line(x,y,x+w,y,color);
		Line(x+w,y,x+w,y+h,color);
		Line(x+w,y+h,x,y+h,color);
		Line(x,y+h,x,y,color);
	}
	void BoxCentered(int x, int y, int w, int h, DWORD color)
	{
		if (!IsValid()) return;
		Box(x-w/2,y-h/2,w,h,color);
	}

	int Width,Height;
};
extern CCanvas* pCanvas;

class CDX9Canvas : public CCanvas
{
	struct CUSTOMVERTEX
	{
		FLOAT x, y, z, rhw; // The transformed position for the vertex.
		DWORD color;        // The vertex color.
	};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)

	LPD3DXFONT pFont;
	LPDIRECT3DDEVICE9 pDevice;
	IDirect3DStateBlock9 *pSB;

	bool bValid;

	CUSTOMVERTEX Line_Batch[5000];
	CUSTOMVERTEX Fill_Batch[16000];
	int Line_Index;
	int Fill_Index;

public:
	CDX9Canvas()
	{
		bValid = false;
		pDevice = NULL;
		pFont = NULL;
		pSB = NULL;
		Line_Index = 0;
		Fill_Index = 0;
	}

	virtual void Init(void* Pram)
	{
		pDevice = (LPDIRECT3DDEVICE9)Pram;
	}
	virtual void Begin()
	{
		bValid = false;

		if (!pDevice)return;
		if (!pSB)
		{
			if (pDevice->CreateStateBlock(D3DSBT_ALL,&pSB) != D3D_OK) return;
		}
		if (!pFont)
		{
			if (D3DXCreateFont(pDevice,14, 0, FW_NORMAL, 1, FALSE, DEFAULT_CHARSET,OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,"Arial",&pFont) != D3D_OK) return;
		}

		Line_Index = 0;
		Fill_Index = 0;
		pSB->Capture();

		bValid = true;
	}
	virtual bool IsValid()
	{
		return bValid;
	}
	virtual void End()
	{
		if (bValid)
		{
			SetupDrawing();
			if (Line_Index>0) pDevice->DrawPrimitiveUP(D3DPT_LINELIST,Line_Index/2,Line_Batch,sizeof(CUSTOMVERTEX));
			if (Fill_Index>0) pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST,Fill_Index/3,Fill_Batch,sizeof(CUSTOMVERTEX));
			pSB->Apply();
		}
		bValid = false;
		Line_Index = 0;
		Fill_Index = 0;
	}
	virtual void Reset()
	{
		if (pFont)
		{
			pFont->Release();
			pFont = NULL;
		}
		if (pSB)
		{
			pSB->Release();
			pSB = NULL;
		}
		bValid = false;
	}

	void SetupDrawing()
	{
		pDevice->SetTexture(0,NULL);  
		pDevice->SetTexture(1,NULL);  

		pDevice->SetVertexShader(NULL);
		pDevice->SetPixelShader(NULL);

		//pDevice->SetRenderState( D3DRS_ALPHATESTENABLE ,FALSE );
		//pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE ,FALSE );
		pDevice->SetRenderState( D3DRS_ZENABLE,D3DZB_FALSE );
		pDevice->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
		pDevice->SetRenderState( D3DRS_SHADEMODE ,D3DSHADE_GOURAUD );
		pDevice->SetRenderState( D3DRS_ZWRITEENABLE ,FALSE );
		pDevice->SetRenderState( D3DRS_SRCBLEND ,D3DBLEND_ONE );
		pDevice->SetRenderState( D3DRS_DESTBLEND ,D3DBLEND_ZERO );
		pDevice->SetRenderState( D3DRS_CULLMODE ,D3DCULL_NONE );
		pDevice->SetRenderState( D3DRS_ZFUNC ,D3DCMP_LESSEQUAL );
		pDevice->SetRenderState( D3DRS_FOGENABLE ,FALSE );
		pDevice->SetRenderState( D3DRS_SPECULARENABLE ,FALSE );
		pDevice->SetRenderState( D3DRS_STENCILENABLE ,FALSE );
		pDevice->SetRenderState( D3DRS_CLIPPING ,FALSE );
		pDevice->SetRenderState( D3DRS_LIGHTING ,FALSE );
		pDevice->SetRenderState( D3DRS_COLORVERTEX ,TRUE );
		pDevice->SetRenderState( D3DRS_CLIPPLANEENABLE ,0 );

		pDevice->SetFVF(D3DFVF_CUSTOMVERTEX);
	}
	virtual void Text(char* text,int x, int y, DWORD color)
	{
		if (!IsValid()) return;
		color |= 0xFF000000;
		RECT pos;
		SetRect(&pos,x,y,0,0);
		pFont->DrawTextA(NULL,text,-1,&pos,DT_NOCLIP,color);
	}
	virtual int TextWidth(char* text)
	{
		if (!IsValid()) return strlen(text)*8;
		RECT pos;SetRect(&pos,0,0,0,0);
		pFont->DrawTextA(NULL,text,-1,&pos,DT_CALCRECT,0);
		return pos.right;
	}
	virtual int TextHeight(char* text)
	{
		if (!IsValid()) return 12;
		RECT pos;SetRect(&pos,0,0,0,0);
		pFont->DrawTextA(NULL,text,-1,&pos,DT_CALCRECT,0);
		return pos.bottom;
	}
	virtual void Line(float x1,float y1,float x2,float y2,DWORD color)
	{
		if (!IsValid()) return;
		CUSTOMVERTEX v[2];
		SetVert(&v[0], x1,y1,color);
		SetVert(&v[1], x2,y2,color);
		SetupDrawing();
		pDevice->DrawPrimitiveUP(D3DPT_LINELIST,1,v,sizeof(CUSTOMVERTEX));
	}
	virtual void FillGradient(float x,float y,float w,float h,DWORD color1,DWORD color2,DWORD color3,DWORD color4)
	{
		if (!IsValid()) return;
		CUSTOMVERTEX v[4];
		SetVert(&v[0], x,y,color1);
		SetVert(&v[1], x+w,y,color2);
		SetVert(&v[2], x+w,y+h,color3);
		SetVert(&v[3], x,y+h,color4);
		SetupDrawing();
		pDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN,2,v,sizeof(CUSTOMVERTEX));
	}
	void SetVert(CUSTOMVERTEX* v, float x, float y, DWORD color)
	{
		v->x = x; v->y = y; v->z = 0.0f; v->rhw = 1.0f;
		v->color = color;
	}
	virtual void Poly(POINT* points,int count,DWORD color)
	{
		if (!IsValid()) return;
		if (count<3) return;
		CUSTOMVERTEX* v = new CUSTOMVERTEX[count];
		for (int i=0; i < count;i++)
		{
			SetVert(&v[i], points[i].x,points[i].y,color);
		}
		SetupDrawing();
		pDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN,count-3+1,v,sizeof(CUSTOMVERTEX));
		delete v;
	}

	//Extras
	void Line_Batched(float x1,float y1,float x2,float y2,DWORD color)
	{
		SetVert(&Line_Batch[Line_Index+0], x1,y1,color);
		SetVert(&Line_Batch[Line_Index+1], x2,y2,color);
		Line_Index += 2;
	}
	void FillGradient_Batched(float x,float y,float w,float h,DWORD color1,DWORD color2,DWORD color3,DWORD color4)
	{
		SetVert(&Fill_Batch[Fill_Index+0], x,y,color1);
		SetVert(&Fill_Batch[Fill_Index+1], x+w,y,color2);
		SetVert(&Fill_Batch[Fill_Index+2], x+w,y+h,color3);

		SetVert(&Fill_Batch[Fill_Index+3], x,y,color1);
		SetVert(&Fill_Batch[Fill_Index+4], x+w,y+h,color3);
		SetVert(&Fill_Batch[Fill_Index+5], x,y+h,color4);
		Fill_Index += 6;
	}
	void Fill_Batched(float x,float y,float w,float h,DWORD color)
	{
		FillGradient_Batched(x,y,w,h,color,color,color,color);
	}
	void FillCentered_Batched(float x,float y,float w,float h,DWORD color)
	{
		FillGradient_Batched(x-w/2,y-h/2,w,h,color,color,color,color);
	}
	void Circle_Batched(int x, int y, int r, int s, DWORD color)
	{
		float Step = 3.14159265*2.0/s;
		for (float a=0; a < 3.14159265*2.0; a += Step)
		{
			float x1 = r * cos(a) + x;
			float y1 = r * sin(a) + y;
			float x2 = r * cos(a+Step) + x;
			float y2 = r * sin(a+Step) + y;
			Line_Batched(x1,y1,x2,y2,color);
		}
	}
	void Box_Batched(int x, int y, int w, int h, DWORD color)
	{
		Line_Batched(x,y,x+w,y,color);
		Line_Batched(x+w,y,x+w,y+h,color);
		Line_Batched(x+w,y+h,x,y+h,color);
		Line_Batched(x,y+h,x,y,color);
	}
	void BoxCentered_Batched(int x, int y, int w, int h, DWORD color)
	{
		Box_Batched(x-w/2,y-h/2,w,h,color);
	}

};
CCanvas* pCanvas = NULL;
#1 · 14y ago
MR
MrLionBr
Looks like works greatly. But, it's from you, certainly it works xD

Good job man! =D
#2 · 14y ago
supercarz1991
supercarz1991
Quote Originally Posted by MrLionBr View Post
Looks like works greatly. But, it's from you, certainly it works xD

Good job man! =D
probablyy doesn't lol
#3 · 14y ago
IB
iBazzoCA
What does it do?
#4 · 14y ago
kolec94
kolec94
Quote Originally Posted by iBazzoCA View Post
What does it do?
its a custom class if u dont know wat to do with it ur in the wrong section
#5 · 14y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • [Info]Text Box ClassBy NOOBJr in Combat Arms Coding Help & Discussion
    23Last post 15y ago
  • [Help]Basic Text Box[Solved]By FlashDrive in Visual Basic Programming
    3Last post 16y ago
  • [Help]Print Text Box [Solved]By zmansquared in Visual Basic Programming
    7Last post 16y ago
  • Need help saving info in text boxes pleaseBy bayley60 in Visual Basic Programming
    10Last post 16y ago
  • Login Screen text box problemsBy xArms in CrossFire Help
    2Last post 15y ago

Tags for this Thread

None