/** 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/drivers/common/opengl/ogldrawsurface.cpp

*/

#include "sgx/graphics/graphics.hpp"
#include "drivers/common/opengl/opengl.hpp"

void CDriverOpenGLDrawSurface::drawLineTo(const tPOINT x, const tPOINT y) {
	CSGXGraphicsEngine::get()->drawLine2D(m_fLastX, m_fLastY, x, y);
	CSGXDrawSurface::drawLineTo(x,y);
}


void CDriverOpenGLDrawSurface::fillQuad(const tPOINT x1, const tPOINT y1, const tPOINT x2, const tPOINT y2, const tPOINT x3, const tPOINT y3, const tPOINT x4, const tPOINT y4) {
	CSGXDrawSurface::fillQuad(x1, y1, x2, y2, x3, y3, x4, y4);

	// apply m_Xform

		CSGXGraphicsEngine::get()->setTransform(m_Xform.m);
		CSGXGraphicsEngine::get()->drawRect2D(x1, y1, x2, y2, x3, y3, x4, y4);
}

void CDriverOpenGLDrawSurface::fillPolygon(const sgxVector<sgxPoint2i> &ptList) {
	if (m_UseColorFill) {
	}

	if (m_pTexture) {
		CSGXGraphicsEngine::get()->setTransform(m_Xform.m);
		CSGXGraphicsEngine::get()->drawPolygon2D(ptList);
	}

}


