Sign in to follow this  
dev578

Simulation [Somewhat] Complete

Recommended Posts

As some of you may know, I am doing a car physics simulation in DirectX. It is done for the most part. I thank everyone here on gamedev for all your help, you all helped me out a lot. The physics are fairly basic, and the geometry just ends (so you can drive out in world space:), but that is OK. The conrols are just the arrows to accelerate, decelerate, and turn; the number keys 1-6 to shift gears; and Home and End keys to fly up and down:) If you want to edit the physics constants, do so in CarData.txt, the game parses it when you boot the game up. The only thing that doesn't seem to work is the damn ID3DXFont. It works on some computers, and doesn't work on others. I set it so that on the computers where the font doesn't work, it just doesn't render the text, it does not crash:) This is what is failing on the computers where the font does not work (I had posted this before actually, but never got an answer or figured it out):
if (FAILED(D3DXCreateFont(g_pD3DDevice, 22, 0, FW_NORMAL, 1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, 
ANTIALIASED_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Arial", &g_pFont)))
{
if (FAILED(D3DXCreateFont(g_pD3DDevice, 22, 0, FW_NORMAL, 1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, 
DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Arial", &g_pFont)))
{
g_bText = false;
}
}



I have the game hosted on my OLD geocities site (here), it seems to work well. Enjoy, and if you could possibly figure out why the font only works on some computers, that would be a great help. Again, thank you very much for all the help on this simulation. -Dev578

Share this post


Link to post
Share on other sites
The font works okay on my coumputer,

This is just a total stab in the dark, but maybe the computers where the call to D3DXCreatefont fails doesn't have the Arial font.

Have you tried changing the font from Arial to Times New Roman ?

Here is my call to D3DXCreatefont from one of my old projects, try it and see if it solves your problem

D3DXCreateFont(pd3dDevice,16,8,FW_NORMAL,0,FALSE,ANSI_CHARSET,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_ROMAN,"Times New Roman",
&m_pText);

Share this post


Link to post
Share on other sites

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