button.h
Code: Select all
#ifndef PART_CGButton
#define PART_CGButton
#include "irrlicht.h"
using namespace irr;
using namespace core;
using namespace video;
using namespace gui;
using namespace scene;
using namespace io;
namespace CGGUI
{
class CGButton
{
public:
void setPosition(position2d<s32> pos);
position2d<s32> ButtonPos;
rect<s32> ButtonRect;
};
}
#endif
Code: Select all
#include "Button.h"
namespace CGGUI
{
void CGButton::setPosition(position2d<s32> pos)
{
ButtonPos=pos;
}
} //
CGButton* btntest;
then i set
btnTest->setPosition(position2d<s32>(23,23));
it complies ok.but when i run program it crashed, when i comment this line it works fine
//btnTest->setPosition(position2d<s32>(23,23));
what happened?