- Status
- Offline
- Joined
- Mar 3, 2026
- Messages
- 381
- Reaction score
- 7
Apex Legends has been pushing the DX12 transition hard, and if you're still relying on ancient DX11 or hijacked GDI overlays, you're just asking for performance hits and detection flags. I'm dropping a clean Direct3D 12 renderer base that utilizes DirectComposition to achieve high-performance, flick-free drawing without the typical overhead.
This isn't some low-effort ImGui paste. It's a structured C++ class designed to handle the heavy lifting of the DX12 pipeline specifically for external overlay applications.
Technical Highlights:
Integration & Requirements:
To get this running, initialize the class with your target HWND and dimensions. Ensure your environment links against d3d12.lib, dxgi.lib, and d3dcompiler.lib. If you're targeting high-stakes accounts, I recommend wrapping the composition layer in a kernel-mode stealth mechanism, but for general use and internal testing, the DirectComposition approach is the gold standard for modern DX12 titles.
This base is clean, modular, and ready for your ESP logic.
Who's already ported their main project to a DirectComposition setup?
This isn't some low-effort ImGui paste. It's a structured C++ class designed to handle the heavy lifting of the DX12 pipeline specifically for external overlay applications.
Technical Highlights:
- Minimal COM Interfaces: Includes custom
andCode:
IDCompositionVisual_Mindefinitions to avoid header conflicts with dcomp.h.Code:IDCompositionDevice_Min - Vertex Batching: Uses a robust vertex/index buffer system (
) to minimize draw calls and keep the render loop efficient.Code:
MAX_VERTICES = 65536 - Full Primitive Suite: Out-of-the-box support for filled/outlined rects, lines with thickness control, and circles.
- Alpha Blending: Configured
specifically for transparency andCode:
D3D12_BLEND_DESCcomposition.Code:DXGI_ALPHA_MODE_PREMULTIPLIED
The implementation uses an upload heap for dynamic vertex data. While seasoned reverse engineers might prefer moving this to a default heap with transition barriers for maximum stealth, this setup is rock solid for standard external projects. The
function handles the buffer mapping and command list execution:
Code:
FlushBatch
Code:
#pragma once
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <d3d12.h>
#include <dxgi1_6.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#include <wrl/client.h>
#include <vector>
#include <cmath>
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "d3dcompiler.lib")
using Microsoft::WRL::ComPtr;
using namespace DirectX;
// Minimal DirectComposition interfaces
MIDL_INTERFACE("FCEB6FBF-2DF0-4B2B-A05E-8760D3C20E4B")
IDCompositionVisual_Min : public IUnknown {
public:
virtual HRESULT STDMETHODCALLTYPE SetOffsetX(float offsetX) = 0;
virtual HRESULT STDMETHODCALLTYPE SetOffsetX2(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetOffsetY(float offsetY) = 0;
virtual HRESULT STDMETHODCALLTYPE SetOffsetY2(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTransform(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTransform2(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTransformParent(IDCompositionVisual_Min*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetEffect(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBitmapInterpolationMode(int) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBorderMode(int) = 0;
virtual HRESULT STDMETHODCALLTYPE SetClip(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetClip2(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE SetContent(IUnknown* content) = 0;
virtual HRESULT STDMETHODCALLTYPE AddVisual(IDCompositionVisual_Min*, BOOL, IDCompositionVisual_Min*) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveVisual(IDCompositionVisual_Min*) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAllVisuals() = 0;
virtual HRESULT STDMETHODCALLTYPE SetCompositeMode(int) = 0;
};
MIDL_INTERFACE("EACDD04C-117E-4E17-88F4-D1B12B0E13A1")
IDCompositionTarget_Min : public IUnknown {
public:
virtual HRESULT STDMETHODCALLTYPE SetRoot(IDCompositionVisual_Min* visual) = 0;
};
MIDL_INTERFACE("C37EA93A-E7AA-450D-B16F-9746CB0407F3")
IDCompositionDevice_Min : public IUnknown {
public:
virtual HRESULT STDMETHODCALLTYPE Commit() = 0;
virtual HRESULT STDMETHODCALLTYPE WaitForCommitCompletion() = 0;
virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics(void*) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTargetForHwnd(HWND hwnd, BOOL topmost, IDCompositionTarget_Min** target) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateVisual(IDCompositionVisual_Min** visual) = 0;
};
typedef HRESULT(WINAPI* PFN_DCompositionCreateDevice)(IUnknown* dxgiDevice, REFIID iid, void** dcompositionDevice);
namespace DX12 {
// Implementation of Renderer class goes here...
// Full source available in the provided dump.
}
Integration & Requirements:
To get this running, initialize the class with your target HWND and dimensions. Ensure your environment links against d3d12.lib, dxgi.lib, and d3dcompiler.lib. If you're targeting high-stakes accounts, I recommend wrapping the composition layer in a kernel-mode stealth mechanism, but for general use and internal testing, the DirectComposition approach is the gold standard for modern DX12 titles.
This base is clean, modular, and ready for your ESP logic.
Who's already ported their main project to a DirectComposition setup?
Last edited by a moderator: