
extern "C" {

	IMesh* IrrVideo_IGeometryCreator_createCubeMesh(IGeometryCreator* gc, vector3df* size = 0)
	{
		if (gc)
			return gc->createCubeMesh((size ? *size : vector3df(5.f,5.f,5.f)));
		else return 0;
		
	}

	IMesh* IrrVideo_IGeometryCreator_createHillPlaneMesh(
		IGeometryCreator* gc,
		const core::dimension2d<f32>& tileSize,
		const core::dimension2d<s32>& tileCount,
		video::SMaterial* material, f32 hillHeight,
		const core::dimension2d<f32>& countHills,
		const core::dimension2d<f32>& textureRepeatCount) 
	{
		if (gc)
			return gc->createHillPlaneMesh(tileSize, dimension2du(tileCount), material, hillHeight, countHills, textureRepeatCount);
		else return 0;		
	}

	IMesh* IrrVideo_IGeometryCreator_createPlaneMesh(
		IGeometryCreator* gc,
		const core::dimension2d<f32>& tileSize,
		const core::dimension2d<s32>& tileCount,
		video::SMaterial* material,
		const core::dimension2d<f32>& textureRepeatCount) 
	{
		if (gc)
			return gc->createPlaneMesh(tileSize, dimension2du(tileCount), material, textureRepeatCount);
		else return 0;		
	}
	
	IMesh* IrrVideo_IGeometryCreator_createTerrainMesh(
		IGeometryCreator* gc,
		video::IImage* texture,
		video::IImage* heightmap,
		const core::dimension2d<f32>& stretchSize,
		f32 maxHeight, video::IVideoDriver* driver,
		const core::dimension2d<s32>& defaultVertexBlockSize,
		bool debugBorders=false)
	{
		if (gc)
			return gc->createTerrainMesh(texture, heightmap, stretchSize, maxHeight, driver, dimension2du(defaultVertexBlockSize), debugBorders);
		else return 0;
	}		
	

	IMesh* IrrVideo_IGeometryCreator_createArrowMesh(
		IGeometryCreator* gc,
		const u32 tesselationCylinder = 4,
		const u32 tesselationCone = 8, const f32 height = 1.f,
		const f32 cylinderHeight = 0.6f, const f32 widthCylinder = 0.05f,
		const f32 widthCone = 0.3f, SColor* colorCylinder = 0, SColor* colorCone = 0)
	{
		if (gc)
			return gc->createArrowMesh(tesselationCylinder, tesselationCone, height, cylinderHeight, widthCylinder, widthCone, (colorCylinder ? *colorCylinder : SColor(0xFFFFFFFF)), (colorCone ? *colorCone : SColor(0xFFFFFFFF)));
		else return 0;
	}
	
	IMesh* IrrVideo_IGeometryCreator_createSphereMesh(IGeometryCreator* gc, f32 radius = 5.f,	u32 polyCountX = 16, u32 polyCountY = 16)
	{
		if (gc)
			return gc->createSphereMesh(radius, polyCountX, polyCountY);
		else return 0;
	}

	IMesh* IrrVideo_IGeometryCreator_createCylinderMesh(
		IGeometryCreator* gc,
		f32 radius, f32 length,
		u32 tesselation,
		SColor* color = 0,
		bool closeTop=true, f32 oblique=0.f)
	{
		if (gc)
			return gc->createCylinderMesh(radius, length, tesselation, (color ? *color : SColor(0xffffffff)), closeTop, oblique);
		else return 0;
	}

	IMesh* IrrVideo_IGeometryCreator_createConeMesh(
		IGeometryCreator* gc,
		f32 radius, f32 length, u32 tesselation,
		SColor* colorTop = 0, SColor* colorBottom = 0, f32 oblique=0.f)
	{
		if (gc)
			return gc->createConeMesh(radius, length, tesselation, (colorTop ? *colorTop : SColor(0xffffffff)), (colorBottom ? *colorBottom : SColor(0xffffffff)), oblique);
		else return 0;
	}

	IMesh* IrrVideo_IGeometryCreator_createVolumeLightMesh(
		IGeometryCreator* gc,
		const u32 subdivideU=32, const u32 subdivideV=32,
		SColor* footColor = 0, SColor* tailColor = 0,
		const f32 lpDistance = 8.f, vector3df* lightDim = 0)
	{
		if (gc)
			return gc->createVolumeLightMesh(subdivideU, subdivideV, (footColor ? *footColor : SColor(0xffffffff)), (tailColor ? *tailColor : SColor(0xffffffff)), lpDistance, (lightDim ? *lightDim : vector3df(1.f,1.2f,1.f)));
		else return 0;
	}

	bool IrrVideo_IGeometryCreator_drop(IGeometryCreator* unk)
	{
		if (unk)
			return unk->drop();
		else return 0;
	}
	
	const c8* IrrVideo_IGeometryCreator_getDebugName(IGeometryCreator* unk)
	{
		if (unk)
			return unk->getDebugName();
		else return "";
	}
	
	void IrrVideo_IGeometryCreator_grab(IGeometryCreator* unk)
	{
		if (unk)
			unk->grab();
	}

}