Irrlicht vs allegro!

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Burnt

Irrlicht vs allegro!

Post by Burnt »

well i migrating from allegro to irlicht, i plan to start dabbeling in 3d, but the 2d drawing alone is what impressed me

I drew a 15x15 grid of tiles sized 32x32 in 16 bit color depth. I rotated betwen 6 tiles each draw as to give allegro a chance(ive read statechanges are slow in 3d,and setting a texture is a state change right?) Well heres the results

IrrlichtGL:920+ fps
IrrlichtDX8: 390+ fps
Allegro(video bitmaps,full accel) 490+ fps

Whats up with the dx8 version? I remember seeing a tilemap engine in dx8 blitting full screen 640x480 and getting over 700 fps on this machine..
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Hm, very interesting. I also would have thought, that DX is faster. Maybe the driver of your GfX-adapter doesn't like DX. :)
Burnt

..

Post by Burnt »

Actually it normally likes dx more then it liks opengl, im using a radeon 9000. I think theres something up with your 2d blitting in dx8...
Burnt

heres the code

Post by Burnt »

Code: Select all

#include <irrlicht.h>
using namespace irr;
int main()
{  
    IrrlichtDevice *device = createDevice(video::DT_OPENGL,core::dimension2d<s32>(640,480),false,true);
    video::IVideoDriver* driver = device->getVideoDriver();
    video::ITexture* images[6];
    images[0] = driver->getTexture("test.bmp");
     driver->makeColorKeyTexture(images[0],video::SColor(255,255,0,255));
         images[1] = driver->getTexture("test1.bmp");
     driver->makeColorKeyTexture(images[1],video::SColor(255,255,0,255));
         images[2] = driver->getTexture("test2.bmp");
     driver->makeColorKeyTexture(images[2],video::SColor(255,255,0,255));
         images[3] = driver->getTexture("test3.bmp");
     driver->makeColorKeyTexture(images[3],video::SColor(255,255,0,255));
         images[4] = driver->getTexture("test4.bmp");
     driver->makeColorKeyTexture(images[4],video::SColor(255,255,0,255));
         images[5] = driver->getTexture("test5.bmp");
     driver->makeColorKeyTexture(images[5],video::SColor(255,255,0,255));
     gui::IGUIFont* font = device->getGUIEnvironment()->getBuildInFont();
     int fps = driver->getFPS();
 
      int lastFPS = -1;
         wchar_t tmp[1024];
    while(device->run() && driver)
     {            
        int p=0;
          driver->beginScene(true, true,  video::SColor(0,122,65,171));
          for(int y=0;y<480;y+=32)
          {
          for(int x=0;x<480;x+=32)
          {
              p++;
              if(p==6)p=0;
              driver->draw2DImage(images[p], core::position2d<s32>(x,y),    core::rect<s32>(0,0,32,32), 0,     video::SColor(255,255,255,255), true);
          }
          }
              fps = driver->getFPS();
  if (lastFPS != fps)
  {
     swprintf(tmp, 1024,L"fps:%i", fps);
     lastFPS = fps;
  }
      font->draw(tmp,        core::rect<s32>(490,10,520,50),        video::SColor(255,255,255,255));
    driver->endScene();
    }
  device->drop();
  return 0;
}

o ya incase ur intrested in testing heres Irrlicht

O i used draw sprite for simplicity mighta got a few more fps for allegro using blit.. but irrlicht is using masking to..
Burnt

..

Post by Burnt »

Ignore the last bit of text i copy and pasted it from a previous post on another board.
Burnt

...

Post by Burnt »

Im no 3d programmer or anything but ur CVideoDirectX8::draw2DImage is frigging huge, i remember seeing several on gamedev.net and none are even close to that size...

Also shouldnt it check the current render state before changing it? what if it changes it to the same thing... same deal with the vertex shader... and what if its using the same texture twice... its still switching...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

It checks the Renderstate before doing that, setRenderStates2DMode does this. You are right, maybe there is still too much overhead.. But 390 fps are still ok for me. :)
Burnt

Post by Burnt »

Ya its ok for me to but im thinking for people with slower graphics cards
Post Reply