#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
using namespace std;
SAMPFUNCS *SF = new SAMPFUNCS();
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride,
CONST RGNDATA *pDirtyRegion)
{
if (SUCCEEDED(SF->getRender()->BeginRender()))
{
SF->getRender()->DrawBox(500, 500, 25, 25, D3DCOLOR_ARGB(255, 0, 255, 0));
SF->getRender()->EndRender();
};
return true;
};
void CALLBACK cmd_show_info_player(std::string param)
{
Present();
};
void CALLBACK mainloop()
{
static bool init = false;
if (!init)
{
SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_PRESENT, Present);
SF->getSAMP()->registerChatCommand("ren", cmd_show_info_player);
}
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
{
switch (dwReasonForCall)
{
case DLL_PROCESS_ATTACH:
SF->initPlugin(mainloop, hModule);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}