[Help]Drawbox D3D9

Posts 1–12 of 12 · Page 1 of 1
[Help]Drawbox D3D9
Hello guys,
Im sorry for bothering.
But im tryingto code D3D9.
now im trying to put a drawbox with rectangle around my menu.
Now i use the follow code to do that ->
Code:
      DrawBox(x-3,((y-2)+(titleheight)),totwidth+6,((totheight+4)-(titleheight)),D3DCOLOR_ARGB(125,183,0,0),D3DCOLOR_ARGB(255, 255, 0,0),pDev);
Now if i compile this into my base i got the following errors:
Code:
1>.\d3dmenu.cpp(115) : error C2065: 'titleheight' : undeclared identifier
1>.\d3dmenu.cpp(115) : error C2065: 'totwidth' : undeclared identifier
1>.\d3dmenu.cpp(115) : error C2065: 'totheight' : undeclared identifier
1>.\d3dmenu.cpp(115) : error C2065: 'titleheight' : undeclared identifier
Im using this Menu:
Code:
class D3D9Menu
{
public:
	D3D9Menu(char *Title = 0)
	{
		Mtitle=Title;	 
		Mpos=0;			
		Mmax=0;		
		Mxofs =150.0f;	
		Mysize=15.0f;	
		Mvisible=1;		
		MENU=(tMENU **)malloc(4*MENUMAXITEMS);
		for (int i=0; i<MENUMAXITEMS; i++) MENU[i]=(tMENU *)malloc(sizeof(tMENU));
	}
	~D3D9Menu() {
		for (int i=0; i<MENUMAXITEMS; i++) free(MENU[i]);
		free(MENU);
	}

	int		Mmax;
	tMENU		**MENU;
	void AddItem(char *txt, char **opt, int *var, int maxvalue);
	void AddFolder(char *txt, char **opt, int *var, int maxvalue);
	void AddCategory(char *txt, char **opt, int *var, int maxvalue);
	void MenuShow(float x, float y,	ID3DXFont*  pFont1, LPDIRECT3DDEVICE9 pDevice);
	void AddText (char *txt, char *opt="");
	void MenuNav(void);
	void DrawTextR(int x,int y,DWORD color,char *text, ID3DXFont*  pFont1);
	void DrawTextL(int x,int y,DWORD color,char *text, ID3DXFont*  pFont1);
	void DrawTextC(int x,int y,DWORD color,char *text, ID3DXFont*  pFont1);

private:
	
	char	*Mtitle;
	int 	Mpos;
	float	Mxofs;	  
	float	Mysize;	 
	int		Mvisible;
	int		YPOS;
};
#endif
ive been trying to fix this for hours, but i cant seem to figure out wich of those ones i should replace with "'totwidth","'totheight",..

Thanks for helping.
I'm pretty sure that error simply means you haven't even declared those variables. . .
you just copied and pasted a base without knowing how to use it. Good job.

how about you declare them, not like a leecha like you knows how to.
Spend 1 minute reading the first page of the cplusplus.com C++ tutorial.

It will teach you how to declare a variable.
This thread makes me sad.
This thread makes me want to cry D;
This thread requires a close.
This thread is funny.
Quote Originally Posted by WrLord39 View Post

Now if i compile this into my base
This threads are proofs that the Threadstarters are liArs!!!
Quote Originally Posted by doofbla View Post
This threads are proofs that the Threadstarters are liers!!!
This proves that most people can't spell liar
ok Spell: L - I - A - R
ty
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us