d3d hook help needed
hi i am new in DIRECTX 9
i maked a simple d3d dll code and i got a test application so i can inject my dll to the application and test it
so thats my code:
i need help making the dll main and HOOKING ??
i maked a simple d3d dll code and i got a test application so i can inject my dll to the application and test it
so thats my code:
Code:
#pragma comment(lib, "d3d9.lib")
#include <windows.h>
#include <d3d9.h>
//משתהנים ליצירת הDEVICE
LPDIRECT3D9 m_D3D = NULL;
LPDIRECT3DDEVICE9 m_D3DD = NULL;
void initD3D(HWND hWnd);
void Render(void);
//יצירת החלון -- שלב ה initialize
void initD3D(HWND hWnd) {
m_D3D = Direct3DCreate9( D3D_SDK_VERSION );
// בודקים שהערך שחוזר חיובי
if(m_D3D == NULL)
{
MessageBox(0, L"D3D create failed", L"error", 0);
}
// הגדרת האפשרויות ל החלון
D3DPRESENT_PARAMETERS d3dpm;
ZeroMemory(&d3dpm, sizeof(d3dpm));
d3dpm.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpm.Windowed = TRUE;
d3dpm.SwapEffect = D3DSWAPEFFECT_DISCARD;
// יצירת הDEVICE שירנדר
if(FAILED(m_D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpm, &m_D3DD)))
{
MessageBox(0, L"D3D Device creation failed", L"error", 0);
}
}
void WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch(msg)
{
case WM_PAINT:
Render();
}
}
void Render() {
m_D3DD->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0);
m_D3DD->BeginScene();
m_D3DD->EndScene();
m_D3DD->Present(0,0,0,0);
}