#include "StdAfx.h"
#include "DefaultShader.h"

#include "../View3DConfig.h"



void DefaultShader::SetTextureSpecularSeparate(bool enabled)
{
	if (enabled)
		glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
	else
		glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR);
}

void DefaultShader::SetVColorEnabled(bool enabled)
{
	if (enabled && m_Context->m_ViewConfig->m_EnableLighting)
	{
		glEnable(GL_COLOR_MATERIAL);
		glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
	}
	else
	{
		glDisable(GL_COLOR_MATERIAL);
	}
}
