///////////////////////////////////////////////////////////////////////////////
/// @file DOpenGL-RenderStates.cpp
///
/// @brief class for OpenGL driver renderstate changes
///
/// @author JesusFreak
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date Feb 2002
/// @author JesusFreak
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

// We need some global headers
#include "deGlobalTypes.hpp"
#include "deDriver_priv.hpp"
#include "DOpenGL.hpp"
#include "deBitmap.hpp"

// We need the OpenGL headers
#include <gl\gl.h>		
#include <gl\glu.h>		
#include <gl\glaux.h>	
#include "glext.h"

#define TEXTURESTRUCTID 0x01005354		//"TS",0,1

GLfloat GetOGLTextureOp(IdeRenderTexture::TextureOp Operation)
{
	// Get the OGL equivilant of the renderstate texture operation
	switch(Operation)
	{
		case IdeRenderTexture::TEXTUREOP_DISABLE:
			return GL_REPLACE;

		case IdeRenderTexture::TEXTUREOP_SELECTARG1:
			return GL_REPLACE;

		case IdeRenderTexture::TEXTUREOP_SELECTARG2:
			return GL_REPLACE;

		case IdeRenderTexture::TEXTUREOP_MODULATE:
			return GL_MODULATE;

/*
		case IdeRenderTexture::TEXTUREOP_MODULATE2X:
			return 

		case IdeRenderTexture::TEXTUREOP_MODULATE4X:
			return 
*/
		case IdeRenderTexture::TEXTUREOP_ADD:
			return GL_ADD;

		case IdeRenderTexture::TEXTUREOP_ADDSIGNED:
			return GL_ADD_SIGNED_EXT;

/*
		case IdeRenderTexture::TEXTUREOP_ADDSIGNED2X:
			return 
*/
		case IdeRenderTexture::TEXTUREOP_SUBTRACT:
			return 0x84E7;
/*
		case IdeRenderTexture::TEXTUREOP_ADDSMOOTH:
			return 

		case IdeRenderTexture::TEXTUREOP_BLENDDIFFUSEALPHA:
			return 

		case IdeRenderTexture::TEXTUREOP_BLENDTEXTUREALPHA:
			return 

		case IdeRenderTexture::TEXTUREOP_BLENDTEXTUREALPHAPM:
			return 

		case IdeRenderTexture::TEXTUREOP_BLENDFACTORALPHA:
			return 

		case IdeRenderTexture::TEXTUREOP_BLENDPREVIOUSALPHA:
			return 

		case IdeRenderTexture::TEXTUREOP_PREMODULATE:
			return 

		case IdeRenderTexture::TEXTUREOP_MODULATECOLOR_ADDALPHA:
			return 

		case IdeRenderTexture::TEXTUREOP_MODULATEALPHA_ADDCOLOR:
			return 

		case IdeRenderTexture::TEXTUREOP_MODULATEINVCOLOR_ADDALPHA:
			return 

		case IdeRenderTexture::TEXTUREOP_MODULATEINVALPHA_ADDCOLOR:
			return 

		case IdeRenderTexture::TEXTUREOP_BUMPENVMAP:
			return 

		case IdeRenderTexture::TEXTUREOP_BUMPENVMAPLUMINANCE:
			return 

		case IdeRenderTexture::TEXTUREOP_DOTPRODUCT3:
			return 

		case IdeRenderTexture::TEXTUREOP_MULTIPLYADD:
			return 

		case IdeRenderTexture::TEXTUREOP_LERP:
			return 
			*/
	};

	// Disable it if we don't know what it is
	return GL_DECAL;
}

GLfloat GetOGLTextureArg(IdeRenderTexture::TextureArg Args)
{
	GLfloat Ret;
	
	Ret = 0;

	//see what flags are set and set the appropriate d3d flags
	if(Args & IdeRenderTexture::TEXTUREARG_PREVIOUS)
		Ret = GL_PREVIOUS_EXT;
	else if(Args & IdeRenderTexture::TEXTUREARG_DIFFUSE)
		Ret = GL_PRIMARY_COLOR_EXT;
	else if(Args & IdeRenderTexture::TEXTUREARG_SPECULAR)
		Ret = GL_PRIMARY_COLOR_EXT;
	else if(Args & IdeRenderTexture::TEXTUREARG_TEXTURE)
		Ret = GL_TEXTURE;
#pragma todo(TFACTOR)

	//set any modifying flags
	if(Args & IdeRenderTexture::TEXTUREARG_ALPHAREPLICATE)
		Ret = Ret;// | D3DTA_ALPHAREPLICATE;

	if(Args & IdeRenderTexture::TEXTUREARG_COMPLEMENT)
		Ret = Ret;// | D3DTA_COMPLEMENT;

	return Ret;
}

GLenum GetOGLTextureFilter(IdeRenderTexture::TextureFilter Filter)
{
	//return the correct D3D type texture filter
	switch(Filter)
	{
		case IdeRenderTexture::TEXTUREFILTER_POINT:
			return GL_NEAREST;

		case IdeRenderTexture::TEXTUREFILTER_LINEAR:
			return GL_LINEAR;
			
		case IdeRenderTexture::TEXTUREFILTER_ANISOTROPIC:
#pragma message("TODO:Figure out what anisotropic is and get it working.")
			return GL_NEAREST;
			//return D3DTEXF_ANISOTROPIC;
	}

	//default to point-sample
	return GL_NEAREST;
}

GLenum GetTextureUnit(int Stage)
{
	switch(Stage)
	{
		case 0:
			return GL_TEXTURE0_ARB;
			break;
		case 1:
			return GL_TEXTURE1_ARB;
			break;
		case 2:
			return GL_TEXTURE2_ARB;
			break;
		case 3:
			return GL_TEXTURE3_ARB;
			break;
		case 4:
			return GL_TEXTURE4_ARB;
			break;
		case 5:
			return GL_TEXTURE5_ARB;
			break;
		case 6:
			return GL_TEXTURE6_ARB;
			break;
		case 7:
			return GL_TEXTURE7_ARB;
			break;
	}

	return 0;
}

GLenum deOpenGL::GetOGLTextureWrappingMode(IdeRenderTexture::TextureAddress Address)
{
	//return the correct OpenGL texture address flag
	switch(Address)
	{
		case IdeRenderTexture::TEXTUREADDRESS_WRAP:
			return GL_REPEAT;

		case IdeRenderTexture::TEXTUREADDRESS_MIRROR:
			return MirroredTextureWrapFlag;

		case IdeRenderTexture::TEXTUREADDRESS_CLAMP:
			return GL_CLAMP;
	}

	// Default to wrap
	return GL_REPEAT;
}

deBoolean deOpenGL::SetTextureState(IdeRenderTexture *State)
{
	IdeBitmapProxy		*BitmapProxy;
	IdeBitmap			*Bitmap;
	TextureEntry		*TexEntry;
	GLuint				Texture;
	long				Stage;
	
	//set texture information

	//lock the renderstate
	if(!State->Lock())
		return deFALSE;

	//go thru all 8 texture stages
	for(Stage = 0; Stage < 8; Stage++)
	{
		glClientActiveTextureARB(GetTextureUnit(Stage));
		BitmapProxy = State->GetBitmap(Stage);
		if (BitmapProxy)
			Bitmap = BitmapProxy->GetBitmap();
		else
			Bitmap = NULL;
		if(Bitmap)
		{
			TexEntry = (TextureEntry*)Bitmap->GetDriverData(m_UniqueID);
			if(TexEntry)
			{
				//we have a texture entry, verify the ID, if valid then modify the pointer
				//otherwise, exit
				if(TexEntry->ID != TEXTURESTRUCTID)
				{
					State->Unlock();
					return deFALSE;
				}
			}
			else
			{
				//add the bitmap
				if (!AddBitmap(Bitmap))
				{
					return deFALSE;
				}
				TexEntry = (TextureEntry*)Bitmap->GetDriverData(m_UniqueID);
				if(!TexEntry)
				{
					State->Unlock();
					return deFALSE;
				}
			}

			//it is valid, modify the pointer. this way texture can be null and we still
			//send the right value to SetTexture
			Texture = TexEntry->Texture;

			//set a few renderstates
			//set how it will look for U
			glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GetOGLTextureWrappingMode(State->GetTextureAddressU(Stage)));

			//set how it will look for V
			glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GetOGLTextureWrappingMode(State->GetTextureAddressV(Stage)));

			glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GetOGLTextureFilter(State->GetTextureMinFilter(Stage)));
			glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GetOGLTextureFilter(State->GetTextureMagFilter(Stage)));

			glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE_EXT);
		
			if(State->GetColorOperation(0) == IdeRenderTexture::TEXTUREOP_DISABLE)
			{
				glDisable(GL_TEXTURE_2D);
				break;
			}

			if(State->GetColorOperation(Stage) == IdeRenderTexture::TEXTUREOP_DISABLE)
			{
				// Disable the texture
				glDisable(GL_TEXTURE_2D);
			}
			else
			{
				// Set the texture
				glBindTexture(GL_TEXTURE_2D,Texture);

				// Enable the texture
				glEnable(GL_TEXTURE_2D);

				// RGB Blending Settings
				glTexEnvf(GL_TEXTURE_ENV,GL_COMBINE_RGB_EXT,GetOGLTextureOp(State->GetColorOperation(Stage)));
				glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE0_RGB_EXT,GetOGLTextureArg(State->GetColorArg(Stage,1)));
				glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE1_RGB_EXT,GetOGLTextureArg(State->GetColorArg(Stage,2)));
				glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE2_RGB_EXT,GetOGLTextureArg(State->GetColorArg(Stage,4)));
				glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND0_RGB_EXT,GL_SRC_COLOR);
				glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND1_RGB_EXT,GL_SRC_COLOR);

				// Alpha Blending Settings
				glTexEnvf(GL_TEXTURE_ENV,GL_COMBINE_ALPHA_EXT,GetOGLTextureOp(State->GetAlphaOperation(Stage)));
				glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE0_ALPHA_EXT,GetOGLTextureArg(State->GetAlphaArg(Stage,1)));
				glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE1_ALPHA_EXT,GetOGLTextureArg(State->GetAlphaArg(Stage,2)));
				glTexEnvf(GL_TEXTURE_ENV,GL_SOURCE2_ALPHA_EXT,GetOGLTextureArg(State->GetAlphaArg(Stage,3)));
				glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND0_ALPHA_EXT,GL_SRC_ALPHA);
				glTexEnvf(GL_TEXTURE_ENV,GL_OPERAND1_ALPHA_EXT,GL_SRC_ALPHA);

				#pragma message("TODO: Texture Ops")

				if(State->GetAlphaOperation(Stage) == IdeRenderTexture::TEXTUREOP_DISABLE)
				{
					//glDisable(GL_BLEND);
				}
				else
				{
					//glEnable(GL_BLEND);
				}
			
			}
		}
					
	}

	//Unlock the renderstate
	if(!State->Unlock())
		return deFALSE;

	return deTRUE;
}

deBoolean deOpenGL::SetLightState(IdeRenderLight *State)
{
	//make sure no one is modifying the light
	if(!State->Lock())
		return deFALSE;

	GLenum Light;
	switch(State->GetID())
	{
		case 0:
			Light = GL_LIGHT0;
			break;
		case 1:
			Light = GL_LIGHT1;
			break;
		case 2:
			Light = GL_LIGHT2;
			break;
		case 3:
			Light = GL_LIGHT3;
			break;
		case 4:
			Light = GL_LIGHT4;
			break;
		case 5:
			Light = GL_LIGHT5;
			break;
		case 6:
			Light = GL_LIGHT6;
			break;
		case 7:
			Light = GL_LIGHT7;
			break;
		default:
			State->Unlock();
			return deFALSE;
			break;

	}

	//if they are turning it on, set a bunch of params
	if(State->GetStatus())
	{
		//turning a light on, set up a bunch of params
		//set a few params
		float Falloff = State->GetFallOff();
		float Range = State->GetRange();
		float Phi = State->GetPhi();
		float Theta = (float)(State->GetTheta() * (180/DE_PI));

		glMatrixMode (GL_MODELVIEW);
		glLoadIdentity();
		//glScalef(-1.0f,1.0f,1.0f);

		// Set the light's position
		float Position[4];
		State->GetPosition((deVertex *)&Position);

		//set the light type
		switch(State->GetLightType())
		{
			case State->LIGHTTYPE_POINT:
				//glLightf(Light,GL_SPOT_CUTOFF,180);
				//glLightf(Light,GL_SPOT_EXPONENT,0);
				Position[3] = 1.0f;
				break;

			case State->LIGHTTYPE_SPOT:
		//		float Direction[3];
				//State->GetDirection((deVertex *)&Direction);
			//	glLightfv(Light,GL_SPOT_DIRECTION,(const float*)&Direction);
				glLightf(Light,GL_SPOT_EXPONENT,0);
				//glLightf(Light,GL_SPOT_CUTOFF,Phi);
				glLightf(Light,GL_SPOT_CUTOFF,90);
				Position[3] = 0.0f;
				break;

			case State->LIGHTTYPE_DIRECTIONAL:
				glLightf(Light,GL_SPOT_CUTOFF,180);
				glLightf(Light,GL_SPOT_EXPONENT,0);
#pragma message("Lighting code hasn't been tested.")
				Position[3] = 0.0f;
				break;

			default:
				State->Unlock();
				return deFALSE;	//unknown, fail
		}

		glLightfv(Light,GL_POSITION,Position);

		// Get the light's colors
		deColor Ambient,Diffuse,Specular;
		State->GetAmbientColor(&Ambient);
		State->GetDiffuseColor(&Diffuse);
		State->GetSpecularColor(&Specular);

		glLightfv(Light,GL_AMBIENT,(float*)&Ambient);
		glLightfv(Light,GL_DIFFUSE,(float*)&Diffuse);
		glLightfv(Light,GL_SPECULAR,(float*)&Specular);
		
		//get Attenuation
		const float Constant = 1.0f;
		const float Linear = 1.0f/300.0f;
		const float Quadratic = 0.0f;
		/*
		const float Constant = State->GetAttenuation(1);
		const float Linear = State->GetAttenuation(0);
		const float Quadratic = State->GetAttenuation(2);
		
		glLightfv(Light,GL_CONSTANT_ATTENUATION,&Constant);
		glLightfv(Light,GL_LINEAR_ATTENUATION,&Linear);
		glLightfv(Light,GL_QUADRATIC_ATTENUATION,&Quadratic);
		*/
		glLightfv(Light,GL_CONSTANT_ATTENUATION,&Constant);
		glLightfv(Light,GL_LINEAR_ATTENUATION,&Linear);
		glLightfv(Light,GL_QUADRATIC_ATTENUATION,&Quadratic);

		//turn it on
		glEnable(Light);
	
	}
	else
	{
		glDisable(Light);
	}

	State->Unlock();

	return deTRUE;
}

deBoolean deOpenGL::SetMaterialState(IdeRenderMaterial *State)
{
	// Declare some variables to hold the material's info
	deColor Ambient,Diffuse,Emissive,Specular;
	float Power;

	//make sure no one is modifying it
	if(!State->Lock())
		return deFALSE;

	// Get the material's info
	State->GetAmbientColor(&Ambient);
	State->GetDiffuseColor(&Diffuse);
	State->GetEmissiveColor(&Emissive);
	State->GetSpecularColor(&Specular);
	Power = State->GetSpecularPower();

	//set it
	glMaterialfv(GL_FRONT,GL_AMBIENT,(float*)&Ambient);
	glMaterialfv(GL_FRONT,GL_DIFFUSE,(float*)&Diffuse);
	glMaterialfv(GL_FRONT,GL_EMISSION,(float*)&Emissive);
	glMaterialfv(GL_FRONT,GL_SPECULAR,(float*)&Specular);
	glMaterialfv(GL_FRONT,GL_SHININESS,&Power);

#pragma todo(take a look at the corresponding d3d function for material color sources - Assassin)
	//glColorMaterial

	//Unlock it so others can modify it
	State->Unlock();
	return deTRUE;
}

deBoolean deOpenGL::SetRenderState(const IdeRenderState *State)
{
	//go call a function to set the states for each render state and return
	//if it worked or not

	//check that the state is not null so John doesn't crash the driver
	if(!State)
		return deFALSE;

	IdeRenderState::Type type = State->GetRSType();
	switch(type)
	{
	case IdeRenderState::TYPE_TEXTURE:
		return SetTextureState((IdeRenderTexture *)(State->GetRSInterface(type)));
		
	case IdeRenderState::TYPE_LIGHT:
		return SetLightState((IdeRenderLight *)(State->GetRSInterface(type)));
		
	case IdeRenderState::TYPE_MATERIAL:
		return SetMaterialState((IdeRenderMaterial *)(State->GetRSInterface(type)));
	}
	
	//if we got here, we don't know the type, fail
	return deFALSE;
}

deBoolean deOpenGL::SetRenderState(RenderState State, unsigned long Value)
{
	//set a renderstate based on what they want

	//check if the value they are setting is already set, if so, don't set it again
	if(RenderStatesValid && m_RenderStates[State] == Value)
		return deTRUE;

	//set the value
	m_RenderStates[State] = Value;
	
	//figure out which state they want and set the state and value appropriately
	switch(State)
	{
		case RENDER_ZENABLE:
			if(Value)
			{
				glEnable(GL_DEPTH_TEST);
			}
			else
			{
				glDisable(GL_DEPTH_TEST);
			}
			break;

		case RENDER_ZWRITESENABLE:
			glDepthMask((GLboolean)Value);
			break;

		case RENDER_FILLMODE:
			if(Value == FILL_POINT)
				glPolygonMode(GL_FRONT_AND_BACK,GL_POINT); 
			else if(Value == FILL_SOLID)
					glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); 
			else if(Value == FILL_WIREFRAME)
					glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); 			
			break;

		case RENDER_SHADEMODE:
			
			//set the render based on the value
			if(Value == SHADE_FLAT)
				glShadeModel(GL_FLAT);
			else if(Value == SHADE_GOURAUD)
				glShadeModel(GL_SMOOTH);
			break;

		case RENDER_ALPHATESTENABLE:
			if(Value)
			{
				glEnable(GL_ALPHA_TEST);
			}
			else
			{
				glDisable(GL_ALPHA_TEST);
			}
			break;

		case RENDER_ALPHAREF:
			AlphaRef = (float)Value/256.0f;
			glAlphaFunc(AlphaFunction,AlphaRef);
			break;

		case RENDER_ALPHAFUNCTION:
			// Set the alpha function used
			if(Value == COMPARE_NEVER)
				AlphaFunction = GL_NEVER;
			else if(Value == COMPARE_LESS)
				AlphaFunction = GL_LESS;
			else if(Value == COMPARE_EQUAL)
				AlphaFunction = GL_EQUAL;
			else if(Value == COMPARE_LESSEQUAL)
				AlphaFunction = GL_LEQUAL;
			else if(Value == COMPARE_GREATER)
				AlphaFunction = GL_GREATER;
			else if(Value == COMPARE_GREATEREQUAL)
				AlphaFunction = GL_GEQUAL;
			else if(Value == COMPARE_NOTEQUAL)
				AlphaFunction = GL_NOTEQUAL;
			else if(Value == COMPARE_ALWAYS)
				AlphaFunction = GL_ALWAYS;			
			else
				return deFALSE;
			glAlphaFunc(AlphaFunction,AlphaRef);
			break;
			
		case RENDER_ALPHABLENDENABLE:
			if(Value)
			{
			
				glEnable(GL_BLEND);
			}
			else
			{
				glDisable(GL_BLEND);
			}
			break;

		case RENDER_SOURCEBLEND:
		case RENDER_DESTBLEND:
			//set the type
			GLenum * Factor;
			if(State == RENDER_SOURCEBLEND)
				Factor = &SrcBlendFactor;
			else
				Factor = &DestBlendFactor;

			//figure out the type of blending
			if(Value == BLEND_ZERO)
				*Factor = GL_ZERO;
			else if(Value == BLEND_ONE)
				*Factor = GL_ONE;
			else if(Value == BLEND_SOURCE)
				*Factor = GL_SRC_COLOR;
			else if(Value == BLEND_INVERSESOURCE)
				*Factor = GL_ONE_MINUS_SRC_COLOR;
			else if(Value == BLEND_SOURCEALPHA)
				*Factor = GL_SRC_ALPHA;
			else if(Value == BLEND_INVERSESOURCEALPHA)
				*Factor = GL_ONE_MINUS_SRC_ALPHA;
			else if(Value == BLEND_DEST)
				*Factor = GL_DST_COLOR;
			else if(Value == BLEND_INVERSEDEST)
				*Factor = GL_ONE_MINUS_DST_COLOR;
			else if(Value == BLEND_DESTALPHA)
				*Factor = GL_DST_ALPHA;
			else if(Value == BLEND_INVERSEDESTALPHA)
				*Factor = GL_ONE_MINUS_DST_ALPHA;
			else if(Value == BLEND_SOURCEALPHASAT)
				*Factor = GL_SRC_ALPHA_SATURATE;
			else
				return deFALSE;

			glBlendFunc(SrcBlendFactor,DestBlendFactor); 
			break;

		case RENDER_CULLMODE:
			
			//set the cull mode based on the value passed in
			if(Value == CULL_NONE)
				glDisable(GL_CULL_FACE);
			else if(Value == CULL_CW)
			{
				glEnable(GL_CULL_FACE);
				glFrontFace(GL_CCW);
				glCullFace(GL_BACK);
			}
			else if(Value == CULL_CCW)
			{
				glEnable(GL_CULL_FACE);
				glFrontFace(GL_CW); 
				glCullFace(GL_BACK);
			}		
			break;

		case RENDER_FOGENABLE:
			if(Value)
			{
				glEnable(GL_FOG);
			}
			else
			{
				glDisable(GL_FOG);
			}
			break;

		case RENDER_FOGSTART:
			glFogf(GL_FOG_START,(float)Value);
			break;

		case RENDER_FOGEND:
			glFogf(GL_FOG_END,(float)Value);
			break;

		case RENDER_FOGCOLOR:
#pragma todo(TODO: Renderstate RENDER_FOGCOLOR)
			break;

		case RENDER_CLIPPINGENABLE:
			if(Value)
			{
				glEnable(GL_SCISSOR_TEST);
			}
			else
			{
				glDisable(GL_SCISSOR_TEST);
			}
			break;

		case RENDER_HWLIGHTINGENABLE:
			if(Value)
			{
				glEnable(GL_LIGHTING);
			}
			else
			{
				glDisable(GL_LIGHTING);
			}
			break;

		case RENDER_DITHERENABLE:
			if(Value)
			{
				glEnable(GL_DITHER);
			}
			else
			{
				glDisable(GL_DITHER);
			}
			break;

			
		case RENDER_SPECULARENABLE:
			break;

		case RENDER_SPECULARPERSPECTIVE:
			glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,Value);
			break;

		case RENDER_PERVERTEXCOLOR:
			if(Value)
			{
				glEnable(GL_COLOR_MATERIAL);
			}
			else
			{
				glDisable(GL_COLOR_MATERIAL);
			}
			break;

		default:
			return deFALSE;
	}

	return deTRUE;
}

unsigned long deOpenGL::GetRenderState(RenderState State)
{
	// Return the current status of a renderstate
	return m_RenderStates[State];
}

deBoolean deOpenGL::EnableLight(long LightID, deBoolean Enable)
{
#pragma fixme (dunno what to do here - Assassin)
	return deFALSE;
}

deBoolean deOpenGL::DisableAllLights()
{
#pragma fixme (dunno what to do here - Assassin)
	return deFALSE;
}

