Commit 1864555d authored by hybrid's avatar hybrid

Added method to alter the minimum vertex count required for a HW buffer to be created.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2132 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d51b2f83
This diff is collapsed.
This diff is collapsed.
...@@ -70,7 +70,8 @@ IImageWriter* createImageWriterPPM(); ...@@ -70,7 +70,8 @@ IImageWriter* createImageWriterPPM();
//! constructor //! constructor
CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize) CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize)
: FileSystem(io), MeshManipulator(0), ViewPort(0,0,0,0), ScreenSize(screenSize), : FileSystem(io), MeshManipulator(0), ViewPort(0,0,0,0), ScreenSize(screenSize),
PrimitivesDrawn(0), TextureCreationFlags(0), AllowZWriteOnTransparent(false) PrimitivesDrawn(0), MinVertexCountForVBO(500), TextureCreationFlags(0),
AllowZWriteOnTransparent(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CNullDriver"); setDebugName("CNullDriver");
...@@ -1406,7 +1407,7 @@ bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb) ...@@ -1406,7 +1407,7 @@ bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb)
if (!mb || (mb->getHardwareMappingHint_Index()==scene::EHM_NEVER && mb->getHardwareMappingHint_Vertex()==scene::EHM_NEVER)) if (!mb || (mb->getHardwareMappingHint_Index()==scene::EHM_NEVER && mb->getHardwareMappingHint_Vertex()==scene::EHM_NEVER))
return false; return false;
if (mb->getVertexCount()<500) //todo: tweak and make user definable if (mb->getVertexCount()<MinVertexCountForVBO)
return false; return false;
return true; return true;
...@@ -1941,9 +1942,6 @@ bool CNullDriver::setClipPlane(u32 index, const core::plane3df& plane, bool enab ...@@ -1941,9 +1942,6 @@ bool CNullDriver::setClipPlane(u32 index, const core::plane3df& plane, bool enab
//! Enable/disable a clipping plane. //! Enable/disable a clipping plane.
//! There are at least 6 clipping planes available for the user to set at will.
//! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.
//! \param enable: If true, enable the clipping plane else disable it.
void CNullDriver::enableClipPlane(u32 index, bool enable) void CNullDriver::enableClipPlane(u32 index, bool enable)
{ {
// not necessary // not necessary
...@@ -1959,5 +1957,11 @@ ITexture* CNullDriver::createRenderTargetTexture(const core::dimension2d<u32>& s ...@@ -1959,5 +1957,11 @@ ITexture* CNullDriver::createRenderTargetTexture(const core::dimension2d<u32>& s
return tex; return tex;
} }
void CNullDriver::setMinHardwareBufferVertexCount(u32 count)
{
MinVertexCountForVBO = count;
}
} // end namespace } // end namespace
} // end namespace } // end namespace
...@@ -523,6 +523,10 @@ namespace video ...@@ -523,6 +523,10 @@ namespace video
//! Returns the graphics card vendor name. //! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() {return "Not available on this driver.";} virtual core::stringc getVendorInfo() {return "Not available on this driver.";}
//! Set the minimum number of vertices for which a hw buffer will be created
/** \param count Number of vertices to set as minimum. */
virtual void setMinHardwareBufferVertexCount(u32 count);
//! Only used by the engine internally. //! Only used by the engine internally.
virtual void setAllowZWriteOnTransparent(bool flag) virtual void setAllowZWriteOnTransparent(bool flag)
{ AllowZWriteOnTransparent=flag; } { AllowZWriteOnTransparent=flag; }
...@@ -633,6 +637,7 @@ namespace video ...@@ -633,6 +637,7 @@ namespace video
CFPSCounter FPSCounter; CFPSCounter FPSCounter;
u32 PrimitivesDrawn; u32 PrimitivesDrawn;
u32 MinVertexCountForVBO;
u32 TextureCreationFlags; u32 TextureCreationFlags;
...@@ -640,14 +645,13 @@ namespace video ...@@ -640,14 +645,13 @@ namespace video
f32 FogEnd; f32 FogEnd;
f32 FogDensity; f32 FogDensity;
SColor FogColor; SColor FogColor;
SExposedVideoData ExposedData;
bool LinearFog; bool LinearFog;
bool PixelFog; bool PixelFog;
bool RangeFog; bool RangeFog;
bool AllowZWriteOnTransparent; bool AllowZWriteOnTransparent;
SExposedVideoData ExposedData;
bool FeatureEnabled[video::EVDF_COUNT]; bool FeatureEnabled[video::EVDF_COUNT];
}; };
......
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