Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Includes.h"
- HINSTANCE module;
- void D3DApp::DrawScene()
- {
- if (m_Minimized)
- return;
- if (m_targetApplication != GetForegroundWindow())
- return;
- assert(m_pImmediateDeviceContext);
- assert(m_pSwapChain);
- float clearColor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
- float blend[4] = { 0 };
- m_pImmediateDeviceContext->ClearRenderTargetView(m_pRenderTargetView, reinterpret_cast<const float*>(&clearColor));
- DrawString(XMFLOAT2(0,20), Colors::White,0.8f, false,"%s", "Test"); //draw text in upper left
- XMVECTOR pos1 = { m_width / 2, m_height / 2 + 5 }; //draw small line in center
- XMVECTOR pos2 = { m_width / 2, m_height / 2 - 5 };
- DrawLine(pos1, pos2, Colors::Red);
- DrawCircle(pos1, Colors::Green, 70, 30); //draw small circle in center
- HR(m_pSwapChain->Present(0, 0));
- }
- DWORD WINAPI DXThread(LPVOID lpargs)
- {
- /*This thread is where the overlay runs, RunOverlay is
- an infinite loop that handles the windows messages and such*/
- D3DApp app("Overlay",600,600,module,"Battlefield 4",4);
- app.MakeWindow();
- app.InitializeDX();
- app.SetToTarget();
- std::cout << "Made it to DX init \n";
- return app.RunOverlay();
- }
- BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
- {
- if (dwAttached == DLL_PROCESS_ATTACH)
- {
- module = hModule;
- HANDLE hThread2 = CreateThread(NULL, NULL, DXThread, NULL, NULL, NULL);
- CloseHandle(hThread2);
- //PresentHook = new CVMTHookManager64((DWORD64**)DxRenderer::GetInstance()->m_pScreen->m_pSwapChain);
- //oPresent = (tPresent)PresentHook->dwGetMethodAddress(8);
- //PresentHook->dwHookMethod((DWORD64)hkPresent, 8);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment