Trouble with D3DXSPRITE_ALPHABLEND and Draw()
Hey guys, new to the forum. Anyway, I have written a program to animate a sprite with transpatency support with the help of a book. But see, I keep getting these two erros:
'D3DXSPRITE_ALPHABLEND' : undeclared identifier
'Draw' : function does not take 5 parameters
In fact, I loaded and ran the example program in the book as it is, and I still get these same errors. Why am I getting these errors? How can I fix this thing?
Heres the chunk of code does the drawing:
if (d3ddev->BeginScene())
{
d3ddev->StretchRect(back, NULL, backbuffer, NULL, D3DTEXF_NONE);
sprite_handler->Begin(D3DXSPRITE_ALPHABLEND);
D3DXVECTOR3 position((float)kitty.x, (float)kitty.y, 0);
sprite_handler->Draw(
kitty_image[kitty.curframe],
NULL,
NULL,
&position,
D3DCOLOR_XRGB(255,255,255));
sprite_handler->End();
d3ddev->EndScene();
}
Which version of the DXSDK do you have installed? The ID3DXSprite interface has undergone some changes over the years, so it is quite possible that you are using a version different that the book was written with.
For the current revision of the DXSDK though, that code does look ok.
For the current revision of the DXSDK though, that code does look ok.
check this tutorial out. It comes with source code as well. http://www.toymaker.info/Games/html/2d_animation.html
Quote:Original post by DeepPurple25
Well, I am using DirectX9b. Am I suppose to use DirectX9c?
Yea, DX9b is pretty old. I would recommend upgrading to a newer SDK.
Damn it. I upgraded DirectX and it doesn't compile at all. I installed the
"Microsoft DirectX 9.0 SDK (Summer 2004)" version of DX into my computer. The directory is:
"C:\ProgramFiles\Microsoft DirectX 9.0 SDK (Summer 2004)"
and the error I get sais that the "d3d9.h" is unidentified, meaning it cant find the DX library. So where should I move the whole DX library to? and should I rename it?
"Microsoft DirectX 9.0 SDK (Summer 2004)" version of DX into my computer. The directory is:
"C:\ProgramFiles\Microsoft DirectX 9.0 SDK (Summer 2004)"
and the error I get sais that the "d3d9.h" is unidentified, meaning it cant find the DX library. So where should I move the whole DX library to? and should I rename it?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement