#ifndef _CGLLIGHT_H_
#define _CGLLIGHT_H_

#include "../App/EngineH.h"
#include "../GLDef.h"
#include "../Math/Math3D.h"


class C_GLLIGHT_0
{
private :
	GLenum tLIGHT;
	CVector4 position;
	CVector3 color;
	
public :
	void Init(GLenum LIGHT);
	void Draw();
	inline void SetPosition(CVector4 v){position=v;}
	inline void SetPosition(float x,float y,float z,float w)
	{
		position.x = x;
		position.y = y;
		position.z = z;
		position.w = w;
		GLfloat pole[] = {position.x, position.y, position.z, position.w};
		glLightfv(tLIGHT,GL_POSITION,pole);
	}
	inline void SetColor(CVector3 v){color=v;}
	inline void SetColor(float x,float y,float z)
	{
		color.x = x;
		color.y = y;
		color.z = z;
		GLfloat pole_color[] = {color.x,color.y,color.z};
		glLightfv(tLIGHT, GL_DIFFUSE, pole_color);
	}
	inline CVector4 GetPosition(){return position;}
	inline void SetStav(bool b)
	{
		if(b) glEnable(tLIGHT);
		else glDisable(tLIGHT);
	}

};

#endif //_CGLLIGHT_H_