Code: Select all
class gameFrames:public IEventReceiver
{
private:
DataBank *db;
IVideoDriver* _driver;
ISceneManager* _smgr;
IGUIEnvironment* _guienv;
IrrlichtDevice* _device;
IGUISkin* skin;
IGUIFont* font;
framesWork *fw;
GuiManagement *guiman;
IEventReceiver *_eru_;
int nfGameLevel;
int nowFrame;
int nLoginWork;
bool loadedComplete;
public:
graphic_ARGBUnit *gfARGB;
void valueInit()
{
this->fw=new framesWork();
this->nowFrame=0;
this->loadedComplete=false;
this->db=new DataBank();
this->nfGameLevel=0;
this->nLoginWork=0;
this->skin = _guienv->getSkin();
this->font = _guienv->getFont("datas/font.bmp");
if (this->font)
this->skin->setFont(this->font);
this->skin->setFont(_guienv->getBuiltInFont(), EGDF_TOOLTIP);
this->guiman=new GuiManagement(_guienv);
}
gameFrames(IVideoDriver *_drv,ISceneManager *_smr,IGUIEnvironment *_gui,IrrlichtDevice *_irrDev)
{
this->_driver=_drv;
this->_smgr=_smr;
this->_device=_irrDev;
this->_guienv=_device->getGUIEnvironment();
this->valueInit();
}
gameFrames(IVideoDriver *_drv,ISceneManager *_smr,IGUIEnvironment *_gui,IrrlichtDevice *_irrDev,graphic_ARGBUnit *argbunit)
{
this->_driver=_drv;
this->_smgr=_smr;
this->_guienv=_gui;
this->_device=_irrDev;
this->_guienv=_device->getGUIEnvironment();
this->gfARGB=argbunit;
this->valueInit();
}
void steping(); // game loop
void loopwork()
{
// Draw And Scene Line
this->_driver->beginScene(true, true, SColor(this->gfARGB->getAlpha(),this->gfARGB->getRed(),this->gfARGB->getGreen(),this->gfARGB->getBlue()));
this->_smgr->drawAll();
this->_guienv->drawAll();
this->fw->ppFrame();
}
void finalwork()
{
this->_driver->endScene();
}
void loginWork()
{
_driver->draw2DImage(_driver->getTexture("datas/login_screen.jpg"),core::position2d<s32>(0,0));
if(nLoginWork==0)
{
IGUIButton *lgin=this->_guienv->addButton(rect<s32>(300,300,110,100),0,GUI_BUTTON_LOGINLEVEL_LOGINOK,L"Login",L"Login Now.");
lgin->draw();
nLoginWork++;
}else{
}
}
bool OnEvent(const SEvent &event);
};
it could be compiled well(with no error).
but, button is not displayed on screen.
how to fix my code ?