Draw : function does not take 7 parameters

Started by
6 comments, last by ZedFx 19 years, 2 months ago
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.
Kewl Softwarez -Time is what you make of it.
Advertisement
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.
I think it could be that Decembember upgrade of DX9, and the October DX9 is not downloadable cause i can't find it.
Kewl Softwarez -Time is what you make of it.
something obvious which im sure your aware of ...
ID3DXSprite::DrawHRESULT Draw(LPDIRECT3DTEXTURE9 pSrcTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR2 *pScaling, CONST D3DXVECTOR2 *pRotationCenter, FLOAT Rotation, CONST D3DVECTOR2 *pTranslation, D3DCOLOR Color);ID3DXLine::DrawHRESULT Draw(CONST D3DXVECTOR2* pVertexList, DWORD dwVertexListCount, D3DCOLOR Color);


thats my guess
which DX SDK are you using?

October ?
December ?
Feb?
Kewl Softwarez -Time is what you make of it.
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.
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.
Quote:Original post by Deamonslayer
which DX SDK are you using?

October ?
December ?
Feb?
Feb 03, the old one :p

This topic is closed to new replies.

Advertisement