A pointer to a GuiControl-inherited class
by Tuomas Sandroos · in Torque Game Engine · 04/27/2007 (9:46 am) · 0 replies
Hi,
I'm trying to get one of my classes to use a pointer of an inherited class of GuiControl to draw some lines to the screen. I have tried to use the primbuilder for now with the help of this page tdn.garagegames.com/wiki/TSE/MovingToGFX. I tried to add the pointer like this:
myclass.h:
CGFX* pGfx; // GuiControl inherited class
myclass.cc:
this->pGfx = new CGFX();
No error in compiling but seems like while debugging that the pGfx pointer hasn't been initialized properly (can't be evaluated). I think I'm getting rusty with my C++, since I can't really tell what's wrong with this.
Also, it seems that I can use the pointer to send data (pGfx->myvariable = 100;) but nothing is transferred. And I do have this gui implemented in script, and I've tried to draw directly from the inherited class which works OK.
Can someone tell what's wrong with this?
I'm trying to get one of my classes to use a pointer of an inherited class of GuiControl to draw some lines to the screen. I have tried to use the primbuilder for now with the help of this page tdn.garagegames.com/wiki/TSE/MovingToGFX. I tried to add the pointer like this:
myclass.h:
CGFX* pGfx; // GuiControl inherited class
myclass.cc:
this->pGfx = new CGFX();
No error in compiling but seems like while debugging that the pGfx pointer hasn't been initialized properly (can't be evaluated). I think I'm getting rusty with my C++, since I can't really tell what's wrong with this.
Also, it seems that I can use the pointer to send data (pGfx->myvariable = 100;) but nothing is transferred. And I do have this gui implemented in script, and I've tried to draw directly from the inherited class which works OK.
Can someone tell what's wrong with this?