void
sphere::setPositionSphere(){
D3DXMATRIX matWorld, matScale;
D3DXMatrixIdentity( &matWorld );
D3DXMatrixScaling( &matScale, 0.5f, 0.5f, 0.5f );
D3DXMatrixTranslation( &matWorld, countTarget/10, -0.5, 0.5 );
D3DXMatrixMultiply( &matWorld, &matScale, &matWorld );
D3DDevice->SetTransform( D3DTS_WORLD, &matWorld );
return;}
Thank you.

setting position of sphere
Teenprogrammer
-858994360 = 0xccccc948 hex value, while 0xccccc948 = 3435972936 decimal ...
So it seems like the -858994360 is an invalid code.
after
hr = D3DDevice->SetTransform(D3DTS_WORLD, &matWorld);
u could write
switch(hr)
{
case D3DERR_INVALIDCALL:
...
}
if u look at the SDK docs, this is the only error code returned by this method.
dgavarin
Abu-Bakr
i u have to do shift+f5 i supose u are running in fullscreen mode.
try running in windowed mode and put some breaklines so u can see whats happening.
HRESULT hr;
hr = D3DDevice->SetTransform(D3DTS_WORLD, &matWorld);
.... check value of hr and compare to return codes in the sdk docs ... that might give u an answer.
gddscy
You can use TCHAR * DXGetErrorString9(HRESULT hr) to convert an HRESULT value into a much more helpful string. Look in the SDK documentation for more information on DXGetErrorString9. You will need to include dxerr9.h and dxerr9.lib in your project.
RVRKID
D3DPRESENT_PARAMETERS D3DParams;
D3DDISPLAYMODE D3DDisplayMode;
D3DNew = Direct3DCreate9( D3D_SDK_VERSION );D3DNew->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&D3DDisplayMode);
sizeof(D3DParams));ZeroMemory(&D3DParams,
D3DParams.Windowed = TRUE;
D3DParams.SwapEffect = D3DSWAPEFFECT_DISCARD;D3DParams.BackBufferFormat = D3DDisplayMode.Format;
D3DParams.EnableAutoDepthStencil = TRUE;
D3DParams.AutoDepthStencilFormat = D3DFMT_D16;
D3DParams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
D3DNew->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,&D3DParams,&D3DDevice);
Is there something wrong with it
XOR42
But the return value seems to be invalid ...
Its a decimal error code, so when u lookup the error, it aint found. The error code entered is different from the error code returned in the tool
... i just noticed the Win32 Error lookup tool disapeared from VS in VS2K beta2.
If it is a windows error, that one might return the correct information.
coolazeem
ram alisam
Thanks for the help.
Changing the application to windowed mode helped me to find the message that is coming up. The error is "access violation" in some memory address. The memory address belongs to "D3DDevice".
Also, I cant find out any other function using the D3DDevice simultaneously. The value of "hr" is shown as "-858994360". Any ideas
alejoespinosa
No really, but if there is an access violation error on the D3DDevice, it migh not been initialized correctly.
Rich Tebb
You most likely have an invalid Device. If you're using the DXUT library, then you should set a callback for the DXUTSetCallbackDeviceLost.
Look at how it is solved in the "Simple Sample" (C++) in the DirectX Sample Browser.