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
......@@ -881,7 +881,7 @@ namespace scene
will be countHills.X * countHills.Y hills.
\param textureRepeatCount: Defines how often the texture will be repeated in
x and y direction.
\return Null if the creation failed. The reason could be that you
return Null if the creation failed. The reason could be that you
specified some invalid parameters or that a mesh with that name already
exists. If successful, a pointer to the mesh is returned.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
......
This diff is collapsed.
......@@ -70,7 +70,8 @@ IImageWriter* createImageWriterPPM();
//! constructor
CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& 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
setDebugName("CNullDriver");
......@@ -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))
return false;
if (mb->getVertexCount()<500) //todo: tweak and make user definable
if (mb->getVertexCount()<MinVertexCountForVBO)
return false;
return true;
......@@ -1941,9 +1942,6 @@ bool CNullDriver::setClipPlane(u32 index, const core::plane3df& plane, bool enab
//! 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)
{
// not necessary
......@@ -1959,5 +1957,11 @@ ITexture* CNullDriver::createRenderTargetTexture(const core::dimension2d<u32>& s
return tex;
}
void CNullDriver::setMinHardwareBufferVertexCount(u32 count)
{
MinVertexCountForVBO = count;
}
} // end namespace
} // end namespace
......@@ -523,6 +523,10 @@ namespace video
//! Returns the graphics card vendor name.
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.
virtual void setAllowZWriteOnTransparent(bool flag)
{ AllowZWriteOnTransparent=flag; }
......@@ -633,6 +637,7 @@ namespace video
CFPSCounter FPSCounter;
u32 PrimitivesDrawn;
u32 MinVertexCountForVBO;
u32 TextureCreationFlags;
......@@ -640,14 +645,13 @@ namespace video
f32 FogEnd;
f32 FogDensity;
SColor FogColor;
SExposedVideoData ExposedData;
bool LinearFog;
bool PixelFog;
bool RangeFog;
bool AllowZWriteOnTransparent;
SExposedVideoData ExposedData;
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