Sign in to follow this  

Draw : function does not take 7 parameters

This topic is 4685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

You may be accidentally including an old version of the DirectX headers. Make sure the DirectX SDK include directory is at the top of the list of include directories in your compiler's settings.

Share this post


Link to post
Share on other sites
something obvious which im sure your aware of ...


ID3DXSprite::Draw

HRESULT Draw(LPDIRECT3DTEXTURE9 pSrcTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR2 *pScaling, CONST D3DXVECTOR2 *pRotationCenter, FLOAT Rotation, CONST D3DVECTOR2 *pTranslation, D3DCOLOR Color);


ID3DXLine::Draw

HRESULT Draw(CONST D3DXVECTOR2* pVertexList, DWORD dwVertexListCount, D3DCOLOR Color);



thats my guess

Share this post


Link to post
Share on other sites
Quote:
Original post by Deamonslayer
The Draw Function in Directx 9, is not working can anyone help me out with it?
it says it does not take 7 parameters. but it should.


I was having a similar problem when I'd hit the grand ole' F1 and it told me I only needed less or more parameters. I realized after a bit, that the parameters list, is better read from the actually sdk documentation instead of the .net help files, as they seem to have a serious problem of not updating them as they should.

You should have a help file that was included with the sdk under the start menu, mine says
"Microsost DirectX 9.0 SDK Update..."
Then has a file called
"Direct X Documentation for C++"

I now rely exclusivly on that document as it seems to be the msot uptodate, and doesn't suffere from relational problems.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey, I was just messing with this issue.

The DirectX 8 Sprite interface had a draw function that took 7 parameters, however, in DirectX 9 they changed it to only 5.

HRESULT Draw( LPDIRECT3DTEXTURE9 pTexture,
CONST RECT *pSrcRect,
CONST D3DXVECTOR3 *pCenter,
CONST D3DXVECTOR3 *pPosition,
D3DCOLOR Color
);

Parameter 1 is what you want to draw, a texture you've already loaded. the second one is a RECT telling the draw function which part of the texture to draw (NULL for the whole thing), the 3rd defines the center of the texture in x, y, z coordinates. The 4th tells the function where to draw the texture on the screen, in the same manner as the 3rd parameter. The 3rd and 4th can both be NULL, which makes the center/position the top right corner of the image/screen. The last parameter is a color to leave out of the texture when drawing it, allowing for a transparent color.

Hope that helps.

Share this post


Link to post
Share on other sites

This topic is 4685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this