/** 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/gfxcamera.cpp

*/

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

//
// Camera control in the engine
//
void
CSGXGraphicsEngine::setCamera(const sgxVector3 &from, const sgxVector3 &to)
{
	setCamera(0, CSGXCamera(from, to));
}

void
CSGXGraphicsEngine::setCamera(const CSGXCamera &camera)
{
	setCamera(0, camera);
}

void
CSGXGraphicsEngine::setCamera(tUINT32 camera_view, const CSGXCamera &camera)
{
	sgxAssert(camera_view < m_ViewCamera.size());
	m_ViewCamera[camera_view].setState(camera);
	// The information in m_ViewCamera is copied into a platform-specific
	// struct by the gfx driver during beginScene. This is to stop the camera
	// position and the camera-related vars (e.g. frustum) getting out of sync
	// if the camera is changed mid-update/draw.
}

void
CSGXGraphicsEngine::getCamera(CSGXCamera &camera) const
{
	getCamera(0, camera);
}

void
CSGXGraphicsEngine::getCamera(tUINT32 camera_view, CSGXCamera &camera) const
{
	sgxAssert(camera_view < m_ViewCamera.size());
	camera = m_ViewCamera[camera_view].getState();
}

void 
CSGXGraphicsEngine::set2DCamera(const sgxVector2 &atPosition, const sgxVector2 &upVector) {
	SGX_UNUSED(atPosition);
	SGX_UNUSED(upVector);
}

