hallo ich bin neu hier und noch anfänger und habe auch gleich mal eine frage
ich habe mit irrlicht 3d folgendes zu testzwecken geschrieben.
ich habe ein bild was per mausposition eingeladen wird aber sofern die maus das bild die porsition wieder verläst löscht das bild nicht.
Ich möchte damit später einen Button simulieren der aus zwei bildern besteht und diese funktion soll die mousehover funktion sein .
hier mal der code .
Code:
#include <irrlicht.h>
#include "driverChoice.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_DIRECT3D9, dimension2d<u32>(840, 680), 16,false, false, false, 0);
if (!device)
return 1;
device->setWindowCaption(L"Maustest und Bild anzeige");
IVideoDriver* driver = device->getVideoDriver();
IGUIEnvironment* env = device->getGUIEnvironment();
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
env->drawAll();
irr::core::position2d<s32> Coords = device->getCursorControl()->getPosition();
int x = Coords.X;
int y = Coords.Y;
if(x > 400 && x < 500 &&
y > 400 && y < 500)
{
env->addImage(driver->getTexture("op-mo.png"),position2d<int>(300,300));
}
/* else
{
IGUIElement::remove(); // IGUIEnvironment::clear();
}*/
device->setWindowCaption(Caption.c_str());
driver->endScene();
}
device->drop();
return 0;
}
jedes mal wenn ich IGUIElement::remove(); oder IGUIEnvironment::clear(); (zeile 47) einsetze bekomme ich immer die meldung :
Code:
...\maustest\main.cpp(60) : error C2352: 'irr::gui::IGUIElement::remove': Unzulässiger Aufruf einer nicht statischen Memberfunktion .
Warum geht das nicht ?
kann mir da einer weiterhelfen ?