Git Product home page Git Product logo

overlay's Introduction

Overlay wrapper

An overlay wrapper with ImGui[Win32_Dx11]

Usage

  1. Install dependency Library with vcpkg
vcpkg install imgui imgui[example] xorstr
vcpkg integrate install
  1. Add the following files to your project
  • D3DOverlay.h
  • D3DOverlay.cpp
  • imgui_impl_dx11.cpp
  • imgui_impl_win32.cpp
  1. Add code to your source code
#include "D3DOverlay.h"

using X2295::D3DOverlay;

auto Render(FLOAT aWidth, FLOAT aHeight)->VOID
{
	static bool vIsEnableEsp = FALSE;

	ImGui::Begin("Misc");
	ImGui::Text(xorstr_("Application average %.3f ms/frame (%.1f FPS)"), 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
	ImGui::Checkbox(xorstr_("Enable Esp"), &vIsEnableEsp);
	ImGui::End();
	D3DOverlay::DrawCrossHair(15, ImColor(255, 0, 0));
}

int main()
{
	system("start notepad"); //For test
	Sleep(1000); //Wait for notepad startup
	auto vTargetWindow = FindWindow(xorstr_(_T("Notepad")), xorstr_(_T("Untitled - Notepad"))); //Find target window
	if (IsWindow(vTargetWindow)) //Validate window
	{
		if (D3DOverlay::InitOverlay(xorstr_(_T("xxxxx")), xorstr_(_T("xxxxxxxxxx")))) // Init overlay
		{
			D3DOverlay::SetUserRender(Render); //User custom render
			while (D3DOverlay::MsgLoop() && D3DOverlay::AttachWindow(vTargetWindow)) {}; //Sleep?
			D3DOverlay::UninitOverlay(); //Cleanup overlay
		}
	}
	return 1;
}
  1. Tested on win10 x64 [1809 17763.1158]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.