/***************************************************************/
//
//
//		DirectX	[ cameragl.cpp ]
//
//											Author	kazuki tanaka
//											Date	2017 6/15
/*---------------------------------------------------------------
■Update : 2017/6/15
			cameragl.cppの作成

/*---------------------------------------------------------------
	Include File
---------------------------------------------------------------*/

#include "cameragl.h"

#include "system_component.h"

#include "rendereropengl.h"

/*---------------------------------------------------------------
	Macro Difinition
---------------------------------------------------------------*/


/*----------------------------------------------------------------
	static member variable Initialize 
----------------------------------------------------------------*/





// CameraGL Constructor
CameraGL::CameraGL( const std::string& name )
	: Camera( name )
{

	// Menber Clear Process

}

// CameraGL Destructor
CameraGL::~CameraGL( )
{

	// Do Nothing!!

}

// CameraGL Initialize
void CameraGL::Init( void )
{

	// Initialize Process
	Camera::Init();

}

// CameraGL Uninitialize
void CameraGL::Uninit( void )
{

	// Uninitialize Process


}

// CameraGL Update
void CameraGL::Update( void )
{

	// Update Process


}

// CameraGL Set
void CameraGL::Set( void )
{

	// Set Process
	static unsigned int angle;

	// 2D用マトリクス
	glMatrixMode( GL_PROJECTION );
	glPushMatrix( );
	glLoadIdentity( );

	gluPerspective( 
		fov,
		aspect,
		nearClip,
		farClip );

	glMatrixMode( GL_MODELVIEW );
	glPushMatrix( );
	glLoadIdentity( );

	Color diffuse( 1, 1, 1, 1 );
	Color emission( 0, 0, 0, 0 );
	float shine = 0.3f;

	// マテリアル設定
	glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, (float*)&diffuse );		// GL_AMBIENT
	glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, (float*)&emission );		// GL_EMISSION
	glMaterialfv( GL_FRONT_AND_BACK, GL_SHININESS, &shine );				// GL_SHININESS


    gluLookAt(
		pos.x, pos.y, pos.z,
		posAt.x, posAt.y, posAt.z,
		vecUp.x, vecUp.y, vecUp.z);


}





