Hi, I have an application that I wrote to convert .X files into a format needed for another application. In it I use various DirectX functions such as
The resulting application runs fine on any computer that has the DirectX SDK installed, but failed to initialize the object on an pc without it.Code:LPDIRECT3D9 d3d = NULL; HWND hD3DWnd = NULL; LPDIRECT3DDEVICE9 device = NULL; bool CreateD3D9() { d3d = Direct3DCreate9( D3D_SDK_VERSION ); if (NULL == d3d) return false; WNDCLASSEX wcex = {sizeof(WNDCLASSEX)}; wcex.lpszClassName = "dxwind"; wcex.lpfnWndProc = DefWindowProc; RegisterClassEx(&wcex); HWND hWnd = CreateWindow("dxwind", "", 0, -1,-1,-1,-1, NULL, NULL, 0, 0); if (NULL == hWnd) return false; D3DPRESENT_PARAMETERS d3dpp = {}; d3dpp.hDeviceWindow = hWnd; d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_D24X8; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; HRESULT hr = d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &device); if (FAILED(hr)) return false; return true; }
I am wondering if anyone can point me in the right direction as to what I need to include with the app to enable it to work without people having to install the whole DirectX SDK
Thanks Andrew




Reply With Quote