5 Replies - 5605 Views - Last Post: 22 August 2009 - 07:28 AM Rate Topic: -----

#1 James_Alex  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 156
  • Joined: 21-August 09

How to use "D3DXCreateBox" and "D3DXCreateText" ?

Posted 21 August 2009 - 03:36 PM

ok as you see in the title i like to use "D3DXCreateBox" and "D3DXCreateText" to create a text and a box into a game scree
but i don't know how to to use it and how to set it in the desired window name(game name) there isen't any HWND in the function
so please can someone give me an example of how to use it
and plz if this functions are not for creating texts in a game screen can someone plz give me the right one(to create a text and a box) ?
thx

This post has been edited by James_Alex: 21 August 2009 - 03:39 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How to use "D3DXCreateBox" and "D3DXCreateText" ?

#2 jeff666  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 193
  • Joined: 30-December 08

Re: How to use "D3DXCreateBox" and "D3DXCreateText" ?

Posted 22 August 2009 - 04:04 AM

View PostJames_Alex, on 21 Aug, 2009 - 02:36 PM, said:

so please can someone give me an example of how to use it


Why don't you copy the Microsoft samples from DX SDK ?!!!
Was This Post Helpful? 0
  • +
  • -

#3 James_Alex  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 156
  • Joined: 21-August 09

Re: How to use "D3DXCreateBox" and "D3DXCreateText" ?

Posted 22 August 2009 - 04:29 AM

cuz i need juste one example of using it plz

This post has been edited by James_Alex: 22 August 2009 - 04:30 AM

Was This Post Helpful? 0
  • +
  • -

#4 debjit625  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 51
  • View blog
  • Posts: 446
  • Joined: 06-September 08

Re: How to use "D3DXCreateBox" and "D3DXCreateText" ?

Posted 22 August 2009 - 05:03 AM

Hey what hwnd its DirectX you are drawing on device that you got before
LPDIRECT3DDEVICE9 device = NULL;//A pointer to IDirect3DDevice9 interface.


here you see the "device" thats the stuff you are going to handle yes offcourse after creating it with CreateDevice() function.
So i am assumming that you are having your device properly initialized
D3DXCreateBox(
  LPDIRECT3DDEVICE9 pDevice,
  FLOAT Width,
  FLOAT Height,
  FLOAT Depth,
  LPD3DXMESH * ppMesh,
  LPD3DXBUFFER * ppAdjacency
);


See the functions parameters the first one is LPDIRECT3DDEVICE9 pDevice
it the device i was telling you about it before ,second parameter is the width of the box normally in X axis,third is the height normally in Y axis,fourth parameter is for depth that lhow long will be the box along Z axis,fifth parameter is the address of the pointer of ID3DXMesh interface how to create this just do this
ID3DXMesh *mesh = NULL;


Note when before exit application delete the mesh or else their will be memory leak.
ok now for the last parameter dont think just give it NULL.
For example create a square box of 10 units Width,Height and Depth use 10.
D3DXCreateBox(device,10,10,10,&mesh,NULL);



OK now you have to render it ,I think you know ,after BeginScene add this code.
mesh->DrawSubset(0);



This draws your box on the DirectX device which is on windows hwnd

If you understood this then you will be able to create the Text also as its clear their is no need of Hwnd in these case

You must ask all these in Game Programing Forum

This post has been edited by debjit625: 22 August 2009 - 05:09 AM

Was This Post Helpful? 1
  • +
  • -

#5 James_Alex  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 156
  • Joined: 21-August 09

Re: How to use "D3DXCreateBox" and "D3DXCreateText" ?

Posted 22 August 2009 - 05:19 AM

thx for your help but
i got these problemes when compilling, i think linking problemes
1>main.obj : error LNK2019: unresolved external symbol _D3DXCreateBox@24 referenced in function "int __cdecl DrawOnSC(char * const,int,int,int,int,struct tagRECT &,struct HDC__ * &,struct HWND__ * &,int &)" (?DrawOnSC@@YAHQADHHHHAAUtagRECT@@AAPAUHDC__@@AAPAUHWND__@@AAH@Z)
1>C:\Documents and Settings\........\JA_Cheat_Mod_DLL.dll : fatal error LNK1120: 1 unresolved externals

why i got it ?
Was This Post Helpful? 0
  • +
  • -

#6 debjit625  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 51
  • View blog
  • Posts: 446
  • Joined: 06-September 08

Re: How to use "D3DXCreateBox" and "D3DXCreateText" ?

Posted 22 August 2009 - 07:28 AM

You didnt add the directx lib to your project.From Properties go to Linker option then their in "Additional Dependencies" add these files
"d3dxof.lib dxguid.lib d3dx9d.lib d3d9.lib winmm.lib" with out cotta.I am assumming that you are using DirectX 9.0c with VSC++ Express.
Was This Post Helpful? 1

Page 1 of 1