[Resolved]Problem with Zorder in ogles branch

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
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

[Resolved]Problem with Zorder in ogles branch

Post by BinMa »

Hi all, I'm now porting a game to android using ogles branch, which draw in mainloop like this

Code: Select all

while(device->run()) {
        driver->beginScene(true, true, SColor(0, 0, 0, 0));
        if(imageManager.tBackGround)
            driver->draw2DImage(imageManager.tBackGround, recti(0, 0, 1024, 640), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
        gMutex.Lock();
        if(dInfo.isStarted) {
            DrawField();
            smgr->drawAll();
        driver->setMaterial(irr::video::IdentityMaterial);
        driver->clearZBuffer();
        }
        gMutex.Unlock();
}
 
DrawBackGround

Code: Select all

void Game::DrawField() {
    matrix4 im = irr::core::IdentityMatrix;
    im.setTranslation(vector3df(0, 0, -0.01f));
    driver->setTransform(irr::video::ETS_WORLD, im);
    //draw field
    driver->setTransform(irr::video::ETS_WORLD, irr::core::IdentityMatrix);
    matManager.mTexture.setTexture(0, imageManager.tField);
    driver->setMaterial(matManager.mTexture);
    driver->drawVertexPrimitiveList(matManager.vField, 4, matManager.iRectangle, 2);
    driver->setMaterial(matManager.mBackLine);
}
 
The background image is always cover on the field image, but works properly on PC (opengl/D3D).
Any advice would be helpful!
Last edited by BinMa on Thu Feb 27, 2014 1:11 am, edited 1 time in total.
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

Re: Problem with Zorder in ogles branch

Post by BinMa »

It's resolved already, the depth test should be disabled explicitly on ogles branch.
Post Reply