Skip to main content
GameDev.net gamedev.net
🔒 Locked

Small problem with game engine

Started by cppcdr Jan 9, 2005 at 2:41 PM 12 replies 3.1k views
Original Post
cppcdr
cppcdr
First thing, I'm not sure that I am posting in the right section of the forum. If I am not, I apologise. Second, I have been reading the book called 3D Game Engine Programming by Stefan Zerbst and Oliver Duvel and I have encountered a small problem in chapter six. I am using visual studio 6.0 and when I try to run the game engine, the debugger gives me this: --------------------Configuration: ZFXD3D - Win32 Debug-------------------- Compiling... ZFXD3D_main.cpp c:\documents and settings\first user\desktop\zfxrenderer\zfxd3d\zfxd3d_main.cpp(238) : error C2660: 'D3DXCreateFontA' : function does not take 3 parameters c:\documents and settings\first user\desktop\zfxrenderer\zfxd3d\zfxd3d_main.cpp(267) : error C2039: 'Begin' : is not a member of 'ID3DXFont' c:\dx90sdk\include\d3dx9core.h(296) : see declaration of 'ID3DXFont' c:\documents and settings\first user\desktop\zfxrenderer\zfxd3d\zfxd3d_main.cpp(269) : error C2660: 'DrawTextA' : function does not take 5 parameters c:\documents and settings\first user\desktop\zfxrenderer\zfxd3d\zfxd3d_main.cpp(272) : error C2660: 'DrawTextA' : function does not take 5 parameters c:\documents and settings\first user\desktop\zfxrenderer\zfxd3d\zfxd3d_main.cpp(273) : error C2039: 'End' : is not a member of 'ID3DXFont' c:\dx90sdk\include\d3dx9core.h(296) : see declaration of 'ID3DXFont' ZFXD3D_skinman.cpp c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle' c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found ZFXD3D_vcache.cpp c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle' c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found Error executing cl.exe. ZFXD3D.dll - 9 error(s), 0 warning(s) The errors that I am the most interested in are the ones in relation to the oleauto.h include files. I didn't even include these files in the program! I don't understand why these errors occuring. Thank's in advance for any information.
Mr_Mav
Mr_Mav
You probably have the most recent directx installed in your computer! Some old code related with Fonts interface are obsolete. You'll have to re-code those parts. That happened to me too!
"Outside there are tricks and evil."http://go.to/3dprog
Drew_Benton
Drew_Benton
Quote:
Original post by cppcdr
First thing, I'm not sure that I am posting in the right section of the forum. If I am not, I apologise.

Second, I have been reading the book called 3D Game Engine Programming by Stefan Zerbst and Oliver Duvel and I have encountered a small problem in chapter six.
I am using visual studio 6.0 and when I try to run the game engine, the debugger gives me this:

c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found
ZFXD3D_vcache.cpp
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

ZFXD3D.dll - 9 error(s), 0 warning(s)

The errors that I am the most interested in are the ones in relation to the oleauto.h include files. I didn't even include these files in the program!
I don't understand why these errors occuring.

Thank's in advance for any information.


I found this link of a forum that had the same problems - try to do what they did and see if that fixes the problem.

Quote:

Cornbread
10-10-2004, 03:26 PM
Ok I got Kerry's e-mail and I am guessing more than a few of you are going to have the same problem. It has to do with how I set up my personal Visual C++.

If you get this issue as most of you will go into your project and delete the following files:

StdAfx.cpp
StdAfx.h
you do it by selecting them and then hitting the delete key. Then replace this line at the top of your file:


#include "StdAfx.h"


with:

#include < windows.h >


then go into your "Project" menu

Select "Settings"

When your Project settings dialog comes up

Select the file "MyUtilities.cpp" in the little explorer like window on the left of the dialog

Then select the C/C++ tab

Then select "Precompiled Headers" from the "Category" dropdown

Check the radio button "Not using precompiled headers"

then hit OK and save all files. Then recompile. That should fix the issue.
cppcdr
cppcdr
Thanks for the help! I got rid of the problem concerning the oleauto.h files but I can't seem to find the problem with the DirectX stuff.

In the past, I have read books on how to program with DirectX 9.0 and when-ever I tried to compile, it gave me the same errors. Is there a problem with my version of DirectX, or do the people who write the books use an older version of DirectX and then put DirectX 9.0 programming as the title of the book just to attract attention?

On the CD that comes with the book (3D Game Engine Programming) , there is the DirectX 9.0 update so I assume that since it is on the CD, it should go with the code that is in the book. Anyway.

Mr_Mav. Are you saying that I should get an old version of DirectX and change the code of DirectX 9.0 to match with it? Or should I just use an older version of DirectX?
If so, which one?

Thanks for everything!
Tarviathun
Tarviathun
Maybe you're not including the proper DX9 libraries in your compile.
cppcdr
cppcdr
Which ones should I include?
Big_Bear_Scot
Big_Bear_Scot
I think you need to go the book website I think the problems is the code in the book works with Directx 9(non summer update), and I think you have the summer update installed. I think MS changed the Drawfont function in the summer update.

Here is the link to 3D Engine update website
cppcdr
cppcdr
Thanks for the help guys! As soon as I get home, I will install the updates.
Is the new version of directX fonts better than the old one?

And what are you talking about?
So much for the concept of the COM interface.
Big_Bear_Scot
Big_Bear_Scot
on the issue of the new directx fonts in the summer update, there isn't much difference, the major difference is you don't need to the use the begin and end functions to render your text.

I personally going to try to move away from using the font functions in d3dx9.lib and try to implement my own bitmapped fonts system, the reason I am doing this is because at my University they haven't installed the summer update and in my house I have the updated version. This means that my code works great on my home PC but when I try to compile and run it on the machines in University I get the same errors that cppcdr gets.
cppcdr
cppcdr
So the only difference is the Begin and End functions? Geese!
Do you suggest that I work with the d3dx9.lib functions or should I make my own like you are (in other words, are the fonts from d3dx9.lib worth all of the trouble)?
Big_Bear_Scot
Big_Bear_Scot
Quote:
Original post by cppcdr
So the only difference is the Begin and End functions? Geese! ?


Not the only difference but that the major change, I think the call to the Drawfont function is different, I think it take 6 parameters instead of 5 but I am not sure

Quote:
Original post by cppcdr
Do you suggest that I work with the d3dx9.lib functions or should I make my own like you are (in other words, are the fonts from d3dx9.lib worth all of the trouble)?


I would use the DXFont for getting text on the screen fairly quickly and easily, for example an FPS counter.If you design your implementation in the correct way(IMHO) then you could easily remove DXfont call with your own version.

It also depends on what you want to do ?

If you are following the Zerbst book he only implements a direct3D dll. I am planning to add an OpenGL implementation so I am going make my font rendering as API independent as possible and if I use the DXfont then I am locked into using direct3D.
helix
helix
Quote:
Original post by cppcdr
And what are you talking about?
So much for the concept of the COM interface.


He's referring to how DirectX uses COM interfaces so they can be backwards compatible with older versions but MS broke that in this case.
cppcdr
cppcdr
Why the hell would they do that? Wouldn't they want it to be backwards compatible?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.