Fonts and Book Source Code

Started by
1 comment, last by bL0wF1sH 19 years, 6 months ago
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?
Advertisement
I'd look at your function declarations then check the MSDN documentation to compare..Seems like something isn't matching up.
I WISH SOMEONE WOULD FIX THE DAMNED LOGIN!
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 :$.
Jason Olson - Software Developer[ Managed World ]

This topic is closed to new replies.

Advertisement