I'm using @AnWu template which is amazing, well it's not really a template but you can use it as is as you have imgui, sampapi and some other plugins so it's nice, thing is to hook Present and Reset it does it like this :
Perhaps I saw some people that somehow don't have permission to d3d9.dll thus failing to hook anything, that's why I tried to do it directly from gta sa pointer to d3d9 interface aka:
And it does work good, thing is that whenever I alt+tab the game basically exits, what I saw different from the other hook method is that in the original code onLost and onReset get both called but doing it directly with d3d9 interface only onLost does get called, I'm out of ideas so if anyone can give me a hand, it would be amazing.
Thanks!
ImGui-Scoreboard/src/PluginRender.cpp at main · AnWuPP/ImGui-Scoreboard
Contribute to AnWuPP/ImGui-Scoreboard development by creating an account on GitHub.
github.com
C++:
DWORD pDevice = *reinterpret_cast<DWORD*>(0xC97C28);
void** vTable = *reinterpret_cast<void***>(pDevice);
hookPresent.set_dest(vTable[17]);
hookPresent.before.connect(std::bind(&PluginRender::onPresent, this, _1, _2, _3, _4, _5, _6));
hookPresent.install();
hookReset.set_dest(vTable[16]);
hookReset.before.connect(std::bind(&PluginRender::onLost, this, _1, _2, _3));
hookReset.after.connect(std::bind(&PluginRender::onReset, this, _1, _2, _3, _4));
hookReset.install();
And it does work good, thing is that whenever I alt+tab the game basically exits, what I saw different from the other hook method is that in the original code onLost and onReset get both called but doing it directly with d3d9 interface only onLost does get called, I'm out of ideas so if anyone can give me a hand, it would be amazing.
Thanks!