Jump to content
  • Advertisement
Sign in to follow this  
savail

program shutdown when using D3DXFont

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

Hey
Here is how I initialise the font:
HRESULT hr = D3DXCreateFont(d3dDevice, 30, 0, FW_THIN, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Arial"), &Input::Obj().Font );

here is how I render text:
RECT rct;
SetRect(&rct, t_pos_x, t_pos_y,Input::Obj().ScrWidth+t_pos_x, Input::Obj().ScrHeight);

D3DXVECTOR2 scale_pos = D3DXVECTOR2(0,0);
D3DXVECTOR2 scaling(scale_x, scale_y);
D3DXMATRIX mat;
D3DXMatrixTransformation2D(&mat,NULL,0.0,&scaling,NULL,0,&scale_pos);
Sprite->SetTransform(&mat);

Font->DrawText(Sprite, text, -1, &rct, DT_CALCRECT, D3DCOLOR_ARGB(a, r, g, b));
Font->DrawText(Sprite, text, -1, &rct, 0, D3DCOLOR_ARGB(a, r, g, b));

D3DXMatrixIdentity(&mat);
Sprite->SetTransform(&mat);

When I run my program simply by compiling it in Visual c++ everything works fine, but when I'm trying to run my program from its exe file the program shutdowns when there's font rendering... What might be the problem with it? D3DXMatrixTransformation2D is not problem, I checked it.
I will be very grateful for help!
Edit:
Here is what my debugger says about errors but I can't figure out what's wrong :|:
> ntdll.dll!7c90120e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7c96ee31()
ntdll.dll!7c96f26e()
ntdll.dll!7c970456()
ntdll.dll!7c94bafc()
d3d9.dll!4fd90404()
d3d9.dll!4fd86e40()
LF.exe!D3DXCore::CSprite::OnResetDevice() + 0x7d bytes C++
LF.exe!D3DXCore::CSprite::Initialize() + 0x273 bytes C++
0012fb14()
usp10.dll!74d55ea3()
usp10.dll!74d55f8b()
usp10.dll!74d55f94()
usp10.dll!74d53db0()
LF.exe!D3DXCore::CFont::Initialize() + 0x6b4 bytes C++
LF.exe!_D3DXCreateFontIndirectA@12() + 0x4c bytes C++
LF.exe!_D3DXCreateFontA@48() + 0x74 bytes C++
LF.exe!Graphics::InitFont() Line 91 C++
msvcr90.dll!785438b3()
msvcr90.dll!785438c5()
LF.exe!__tmainCRTStartup() Line 574 + 0x1d bytes C
kernel32.dll!7c817077()

Share this post


Link to post
Share on other sites
Advertisement
I noticed that only my computer (Windows XP) has problem with that. I checked on my Windows 7 and the font was displayed without errors. However my program there sometimes opens sometimes crashes... I would be very grateful for any advice what could be wrong with my project system etc!

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!