Jump to content
  • Advertisement
Sign in to follow this  
Rozik

Please help with simple rendering

This topic is 4809 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

Hello all! I am trying to do a very simple tutorial but i cant compile it. THis is the code:
LPD3DXSPRITE sprite=NULL;

If (SUCCEEDED(D3DXCreateSprite(device,&sprite))
{
     // created OK
}

m_sprite->Begin(0);

// Build our matrix to rotate, scale and position our sprite
D3DXMATRIX mat;
// out, scaling centre, scaling rotation, scaling, rotation centre, rotation, translation
D3DXMatrixTransformation2D(&mat,NULL,0.0,&scaling,&spriteCentre,rotation,&trans);

// Tell the sprite about the matrix
m_sprite->SetTransform(&mat);

// Draw the sprite 
m_sprite->Draw(m_texture,NULL,NULL,NULL,0xFFFFFFFF));

// Thats it
m_sprite->End();
I get 4 Compiler errors out of this even though my book and an online tutorial has the code exactly like this The errors are: SetTransform is no element of ID3DXSprite ID3DXSprite::Begin function does not accept 1 Arguments ID3DXSprite::Draw function does not accept 5 Arguments Could not find D3DXMatrixTransformation2D My includes are: d3d9.h d3dx9.h d3d9.lib d3dx9.lib If anyone has a clue on what i am doing wrong pleas elet me know! I tried to read up for 2 days now and all i can find tells me that my code is correct. Thx in advance! Rozik

Share this post


Link to post
Share on other sites
Advertisement
A few important questions:

1. What book is this from? more importantly how old, and what SDK is on the CD?

2. What SDK are you using? ID3DXSprite and/or D3DX has changed a lot since some of the common books were published.

3. Which compiler are you using? you should, ideally, be using VC++ 2002, 2003 or 2005.

D3DXMatrixTransformation2D() does exist it seems, although no particular information on which SDK it was introduced in... which is odd [oh]

Jack

Share this post


Link to post
Share on other sites
Thx for the response:)


The Book is called DirectX 9 User Interfaces Design and Implementation
It has DirectX 9.0 SDK on the CD which i am useing too.
And i am useing Microsoft Visual Studio .NET 2003

Share this post


Link to post
Share on other sites
Well nm i got it:)
I installed the SDK on the CD and now it works even though mine said it was 9.0 too

no clue what the diffrence is

Thx for the efford:)

Share this post


Link to post
Share on other sites
Quote:
Original post by Rozik
I installed the SDK on the CD and now it works even though mine said it was 9.0 too

no clue what the diffrence is

Thx for the efford:)

Off the top of my head there have been 8 versions/revisions/refreshes of the DirectX 9.0 SDK. All of them carry the basic "DirectX 9.0 SDK" title, but usually have (in brackets) the release name after them.

Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!