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..
Irrlicht vs allegro!
heres the code
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..
...
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...
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...