Draw2DLine only with EDT_SOFTWARE?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Criamon
Posts: 9
Joined: Fri Mar 26, 2004 10:41 am

Draw2DLine only with EDT_SOFTWARE?

Post by Criamon »

Hi,

I want to draw a simple 2D line.

Code: Select all

int main()
{
  IrrlichtDevice *device = createDevice(video::EDT_SOFTWARE,core::dimension2d<s32>(512, 384));
  device->setWindowCaption(L"Irrlicht Engine - 2D Graphics Demo");
  IVideoDriver* driver = device->getVideoDriver();

  while(device->run() && driver) {
    if (device->isWindowActive()) {
      driver->beginScene(true, true, video::SColor(0,122,65,171));
      SColor color = SColor(0,255,0,0);
      driver->draw2DLine(core::position2d<s32>(50,50), core::position2d<s32>(164, 125), video::SColor(0,255,0,0));
 			driver->endScene();
    }
  }
  device->drop();
  return 0;
}
This code works only with EDT_SOFTWARE. EDT_DIRECTX8 or EDT_OPENGL does not work (the 2d example, where this code basically comes from works with hardware accelleration. But the line isn't drawn there either).

Criamon
GForce MX200, current NVidia Drivers, Windows 2000
PadrinatoR
Posts: 50
Joined: Tue Mar 09, 2004 9:53 pm
Location: Spain

Post by PadrinatoR »

I've tested that code and I have the same problem.

AMD XP 2800+ 512Mb DDR400 ATI R9600XT Omega Drivers 2.5.30 WinXP SP1
There are only 10 types of people: those who understand binary and those who don't

--------------------------------------------

Image
Criamon
Posts: 9
Joined: Fri Mar 26, 2004 10:41 am

Post by Criamon »

it get's even worse when you use Draw3dLine. Results are different for every engine. And none of them looks ok :(

Criamon
AticAtac
Posts: 29
Joined: Mon Mar 22, 2004 2:46 pm
Location: Germany

Post by AticAtac »

I implemented 2D Line for DirectX :

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=1870
Zaelsius
Posts: 38
Joined: Sat Aug 23, 2003 12:02 pm
Location: Alicante, Spain
Contact:

Post by Zaelsius »

Both OpenGL and DirectX9 API's support line drawing, but I think DirectX 8 does not support simple line drawing calls. In DX9 there are D3DX functions that can achieve that easily, but can't remember about DX8(may be just drawing geometry in screen space in wireframe mode could do the trick... :-/)

In any case I would drop the DX8 device and take full advantage of Dx9 and OGL line drawing, because with them you can even set the width of the lines.
Post Reply