Commit c889104a authored by hybrid's avatar hybrid

Add output about available video memory to d3d9 driver.

Allow changing zbuffer enable and write in 2d override material.
Introduce NO_CLIP hints to d3d9 and opengl driver for 2d mode. Since we clip all 2d operations manually, it should be safe to tell the driver to disable clipping here. Might help on slower machines and is generally suggested by the hw vendors. We might introduce a mesh flag for this as well in the future, in order to disable clipping for larger geometry as well.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3736 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3e1e9eea
......@@ -1854,8 +1854,6 @@ void CD3D8Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChan
if (OverrideMaterial2DEnabled)
{
OverrideMaterial2D.Lighting=false;
OverrideMaterial2D.ZBuffer=ECFN_NEVER;
OverrideMaterial2D.ZWriteEnable=false;
setBasicRenderStates(OverrideMaterial2D, LastMaterial, false);
LastMaterial = OverrideMaterial2D;
}
......
......@@ -394,6 +394,8 @@ bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware)
// get caps
pID3DDevice->GetDeviceCaps(&Caps);
os::Printer::log("Currently available Video Memory", core::stringc(pID3DDevice->GetAvailableTextureMem()).c_str());
// disable stencilbuffer if necessary
if (Params.Stencilbuffer &&
(!(Caps.StencilCaps & D3DSTENCILCAPS_DECRSAT) ||
......@@ -2014,6 +2016,7 @@ bool CD3D9Driver::setRenderStates3DMode()
pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)&Matrices[ETS_PROJECTION]));
pID3DDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
pID3DDevice->SetRenderState(D3DRS_CLIPPING, TRUE);
ResetRenderStates = true;
}
......@@ -2569,13 +2572,13 @@ void CD3D9Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChan
m.setTranslation(core::vector3df(-1,1,0));
pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)m.pointer()));
pID3DDevice->SetRenderState(D3DRS_CLIPPING, FALSE);
Transformation3DChanged = false;
}
if (OverrideMaterial2DEnabled)
{
OverrideMaterial2D.Lighting=false;
OverrideMaterial2D.ZBuffer=ECFN_NEVER;
OverrideMaterial2D.ZWriteEnable=false;
setBasicRenderStates(OverrideMaterial2D, LastMaterial, false);
LastMaterial = OverrideMaterial2D;
}
......
......@@ -2514,6 +2514,10 @@ void COpenGLDriver::setRenderStates3DMode()
glLoadMatrixf(Matrices[ETS_PROJECTION].pointer());
ResetRenderStates = true;
#ifdef GL_EXT_clip_volume_hint
if (FeatureAvailable[IRR_EXT_clip_volume_hint])
glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_NICEST);
#endif
}
if (ResetRenderStates || LastMaterial != Material)
......@@ -3168,12 +3172,15 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
LastMaterial = InitMaterial2D;
}
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
#ifdef GL_EXT_clip_volume_hint
if (FeatureAvailable[IRR_EXT_clip_volume_hint])
glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_FASTEST);
#endif
}
if (OverrideMaterial2DEnabled)
{
OverrideMaterial2D.Lighting=false;
OverrideMaterial2D.ZBuffer=ECFN_NEVER;
OverrideMaterial2D.ZWriteEnable=false;
setBasicRenderStates(OverrideMaterial2D, LastMaterial, false);
LastMaterial = OverrideMaterial2D;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment