Jump to content
  • Advertisement
Sign in to follow this  
cossy74

Fonts and Book Source Code

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

Hi, recently i purchase the second edition RPG with DirectX and am having trouble compiling the programes. I can compile most of the programmes but when i get to a font example i get the following errors... --------------------Configuration: Font - Win32 Debug-------------------- Compiling... WinMain.cpp c:\personal\programming\bookcode\chap02\font\winmain.cpp(138) : error C2664: 'D3DXCreateFontIndirectA' : cannot convert parameter 2 from 'struct tagLOGFONTA *' to 'const struct _D3DXFONT_DESCA *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\personal\programming\bookcode\chap02\font\winmain.cpp(171) : error C2039: 'Begin' : is not a member of 'ID3DXFont' c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\d3dx9core.h(294) : see declaration of 'ID3DXFont' c:\personal\programming\bookcode\chap02\font\winmain.cpp(172) : error C2660: 'DrawTextA' : function does not take 5 parameters c:\personal\programming\bookcode\chap02\font\winmain.cpp(173) : error C2039: 'End' : is not a member of 'ID3DXFont' c:\program files\microsoft directx 9.0 sdk (summer 2004)\include\d3dx9core.h(294) : see declaration of 'ID3DXFont' Error executing cl.exe. Font.exe - 4 error(s), 0 warning(s) Having looked at the Documentation on MSDN for the 'D3DXCreateFontIndirectA' function seems correct in that number of parameters, The ID3DXFont interface does not have a begin or end function and the DrawTextA takes 6 parameters not 5. But having looked at the following archived article on MDSN, http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/d3dx/interfaces/id3dxfont/_id3dxfont.asp This gives the ID3DXFont interface having the Begin and End functions, and also the DrawText does take 5 not 6 parameters. I have downloaded the DirectX SDK 9.0 (summer 2004) edition and installed this on my machine. All i can think of is that i am running the wrong versionof the SDK. But using the SDK that can on the CD( Summer 2003 by memory) still has the same problems. Can Anyone Point me in the right direction?

Share this post


Link to post
Share on other sites
Advertisement
This is due to the changes made from DirectX 9.0b and 9.0c. Unfortunately, I bet the code from the book is compiled against the 9.0b SDK and you probably have the 9.0c SDK (which contains breaking changes from 9.0b). ID3DXFont no longer contains Begin and End methods and the parameters for DrawText have changed. If you look in the 9.0c SDK for samples of using ID3DXFont, you should find what you need. Sorry about that :$.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!