Sign in to follow this  

Programming Source Code Help!!!!

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

This has to do with the source code from Programming Role playing games with DirectX9 second edition. Anyone with that book would know the problem I am talking about but maybe someone could help me who doesnt. Anyways the code i am having trouble with is in Chapter 16 "The Tower". Windows.cpp cGraphics *Graphics; m_Height = m_Font->GetFontCOM()->DrawText(&Graphics, m_Text,sizeof(m_Text), &Rect, DT_CALCRECT | DT_WORDBREAK, 0xFFFFFFFF); They had Drawtext there with another format which is outdated and does not work with DX9. So I updated it with the new DrawText function and it asks for a &Sprite in the first parameter. Now I just defined a sprite to see if it would go but that did not work, I tried NULL as well. Now what I mean by it does not work is the game runs but you don't see the menu, text, and the sprites drag across the screen. In other terms its useless. My question can anyone help me fix this because this line is located Windows.cpp yet anything declared as a sprite is in Graphics.cpp which leaves me with a unidentified sprite if I was to try to call it from the other cpp. Any help would be appreciated!!! Contacts: AIM:LedLoaf Email:LedLoaf@comcast.net PS: If you own the book and have edited the source code yourself please send me it or explain how it could be fixed! Thanks!

Share this post


Link to post
Share on other sites
Yes but see I just made a sprite to see if it would work because I am assuming I need to some how get a defined ID3DXSprite from graphics.cpp to Windows.cpp and put it in that function. In graphics.cpp there is ID3DXSprite assigned too m_Sprite but I can't access that from Windows.cpp

Share this post


Link to post
Share on other sites
Use a get function, such as "ID3DXSprite* cGraphic::SpriteGet()", or create a simple inline wrapper for "Begin()" and "End()" in your sprite.
Also, are you using headers, or just source files???

Share this post


Link to post
Share on other sites

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