Draw2DLine

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
i2k

Draw2DLine

Post by i2k »

Hi all;

I write this and nothing be not got :

________________________________________________________

driver->draw2DLine(core::position2d<s32>(20,20),
core::position2d<s32>(40,40),
video::SColor(255,255,255,255));
________________________________________________________

PLZ HELP.

________________________

Is it Beforehand thanked.
RESPECTFULLY YOURS i2k
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

Is your code including an loop like

Code: Select all

while ((device) && (device->run()))
{
 smgr->beginScene(...);
 smgr->drawAll(...);
 gui->drawAll(...);
 smgr->endScene(...);
}
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
i2k

Post by i2k »

Don't care does not work
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Try setting the material of the driver before drawing

Code: Select all

video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);

driver->draw2DLine(...);
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

Perhaps you forgot to create a camera (or the camera has another target, so you can't see the line)
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
i2k

Post by i2k »

Peter Müller wrote:Perhaps you forgot to create a camera (or the camera has another target, so you can't see the line)
But this works without any there cameras :

_______________________________________________________

driver->draw2DRectangle(video::SColor(255,255,255,255),
core::rect<s32>(140, 80, 140+50, 80+50));
_______________________________________________________
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

really, didn't know that
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Oh, by the way, draw2DLine is only supported by the software renderer in irrlicht 0.6. But AticAtac posted an implementation for directx9 here:

http://irrlicht.sourceforge.net/phpBB2/ ... ctx9#10116

It's a bit tricky but it works!

jox
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

@jox:
I tried it out with DX9, all worked.
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
Post Reply