Frente
09-04-2005, 04:10 AM
I wrote these code in my program:
LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
LPDIRECT3D9 D3D = NULL;
D3D = Direct3DCreate9( D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp,sizeof(d3dpp));
d3dpp.Windowed = true;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.BackBufferCount = 1;
d3dpp.BackBufferWidth = 640;
d3dpp.BackBufferHeight = 480;
d3dpp.hDeviceWindow = hwnd;
long result = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,&g_pd3dDevice);
But everytime i got result : D3DERR_INVALIDCALL~~
Could anybody help me ?
thx
LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
LPDIRECT3D9 D3D = NULL;
D3D = Direct3DCreate9( D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp,sizeof(d3dpp));
d3dpp.Windowed = true;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.BackBufferCount = 1;
d3dpp.BackBufferWidth = 640;
d3dpp.BackBufferHeight = 480;
d3dpp.hDeviceWindow = hwnd;
long result = D3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,&g_pd3dDevice);
But everytime i got result : D3DERR_INVALIDCALL~~
Could anybody help me ?
thx