/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/sgx/graphics/mesh/gfxmesh.cpp

*/

#include "sgx/core/core.hpp"
#include "sgx/graphics/graphics.hpp"

void 
CSGXGraphicsEngine::drawMesh(const CStaticMesh &mesh, const sgxMatrix43 &transform)
{
    // Use the cross-platform structure
	sgxVector<sgxGfxPolygon>::const_iterator cit=mesh.m_Polygons.begin();

    for(;cit!=mesh.m_Polygons.end();++cit) {
        drawPolygon((*cit), transform);
    }
}

/*
This conversion routine is generic, since the generic mesh is a collection
of polygons.

A derived graphics driver may elect to either:
1) Override the convertMesh fn and generate one packet for the entire mesh
2) Override the convertPolygon routine and produce texture-oriented data packets

*/
void 
CSGXGraphicsEngine::convertMesh(CStaticMesh &mesh)
{
	// Derived classes can create a driver-specific
	// data block which will get used by the platform-derived
	// class.
	sgxVector<sgxGfxPolygon>::iterator it = mesh.m_Polygons.begin();

	for(;it!=mesh.m_Polygons.end();++it) {
		convertPolygon(*it);
	}
}

void 
CSGXGraphicsEngine::drawAnimatedMesh(const CAnimatedMesh &animmesh, const sgxMatrix43 &transform)
{
	SGX_UNUSED(animmesh);
	SGX_UNUSED(transform);
}

void 
CSGXGraphicsEngine::updateAnimatedMesh(CAnimatedMesh &animmesh, const tREAL32 telaps)
{
	SGX_UNUSED(animmesh);
	SGX_UNUSED(telaps);
}

void 
CSGXGraphicsEngine::convertAnimatedMesh(CAnimatedMesh &animmesh)
{
	SGX_UNUSED(animmesh);
}

