Archived

This topic is now archived and is closed to further replies.

CD3DFont is not working why???need help...

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

I have included CD3DFont.h file in my project but its giving me compling errors nresolved external symbol "public: long __thiscall CD3DFont::DrawTextA(float,float,unsigned long,char *,unsigned long)" (?DrawTextA@CD3DFont@@QAEJMMKPADK@Z) mycam.obj : error LNK2001: unresolved external symbol "public: __thiscall CD3DFont::CD3DFont(char *,unsigned long,unsigned long)" (??0CD3DFont@@QAE@PADKK@Z) while i am doing everything as how i read in tutorial please guide me thanks. farhan

Share this post


Link to post
Share on other sites
thanks, now i got my error and now text is displaying as well but now i am facing another problem that when i close the application it doesnt close as how it should have to, but it is closing in abnormal way....seems like doesnt letting go all the resources but i am confuse what am i missing?????????

here is my code

Init_D3D();

My_Font = new CD3DFont( _T("Arial"), 12, D3DFONT_BOLD );

My_Font->InitDeviceObjects(dDevice);

My_Font->RestoreDeviceObjects();


while (TRUE)
{


if(FAILED(dDevice->Clear(0,0,D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(0,0,0),1.0f,0)))
{MessageBox(hwnd,"Clearing buffer CLASS HAS PROBLEM","WARN",MB_OK);
return 0;}

if(SUCCEEDED(dDevice->BeginScene()))
{

D3DXMatrixLookAtLH(&view,&D3DXVECTOR3(Cam_UPX,0.0f,Cam_UPZ2),
&D3DXVECTOR3(Cam_UPX,Cam_UPY,0.0f),
&D3DXVECTOR3(0.0f,1.0f,0.0f));


dDevice->SetTransform(D3DTS_VIEW,&view);




dDevice->SetTexture(0,texture);
//Put Some texture from my texture interface pointer
dDevice->SetVertexShader(D3DFVF_XYZ|D3DFVF_TEX1 | D3DFVF_NORMAL| D3DFVF_DIFFUSE );
//TEXTURE: When we use texture then we should tell it by Tex1
dDevice->SetStreamSource(0,verbuff, sizeof(farhan_World));



dDevice->SetTexture(0,texture);

RotateY(1.0f,10.0f,1.0f);
//D3DXMatrixTranslation(&world,0.0,0.0f,0.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 4);

RotateY(10.0f,6.0f,10.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 4);


D3DXMatrixTranslation(&world,2.0,0.0f,0.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 4);


D3DXMatrixTranslation(&world,5.0,0.0f,3.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


dDevice->SetTexture(0,texturehome);
D3DXMatrixTranslation(&world,5.0,0.0f,3.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,-2.0,0.0f,7.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,3.0,0.0f,10.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,9.0,0.0f,1.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,-6.0,0.0f,-10.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);




D3DXMatrixTranslation(&world,-12.0,0.0f,7.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,-9.0,0.0f,-10.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,4.0,0.0f,13.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);


D3DXMatrixTranslation(&world,10.0,0.0f,-10.0f);
dDevice->SetTransform(D3DTS_WORLD,&world);
dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 6, 12);




My_Font->DrawText(2,0, D3DCOLOR_ARGB(255,255,255,0),"Farhanhbk");

dDevice->EndScene();
}

///////////////////////in end iam cleaning the stuff like below

My_Font->DeleteDeviceObjects();
SAFE_DELETE( My_Font );

thanks in advance



[edited by - farhanx on April 23, 2004 11:37:46 AM]

Share this post


Link to post
Share on other sites