Skip to content
Snippets Groups Projects
llgl.cpp 51.2 KiB
Newer Older
{
#ifdef GL_ARB_sync
	if (mSync)
	{
		while (glClientWaitSync(mSync, 0, FENCE_WAIT_TIME_NANOSECONDS) == GL_TIMEOUT_EXPIRED)
		{ //track the number of times we've waited here
			static S32 waits = 0;
			waits++;
		}
	}
#endif
}

Graham Linden's avatar
Graham Linden committed
LLGLSPipelineSkyBox::LLGLSPipelineSkyBox()
: mAlphaTest(GL_ALPHA_TEST)
, mCullFace(GL_CULL_FACE)
, mSquashClip()
{ 
    if (!LLGLSLShader::sNoFixedFunction)
    {
        glDisable(GL_LIGHTING);
        glDisable(GL_FOG);
        glDisable(GL_CLIP_PLANE0);
    }
}
Graham Linden's avatar
Graham Linden committed
LLGLSPipelineSkyBox::~LLGLSPipelineSkyBox()
{
    if (!LLGLSLShader::sNoFixedFunction)
    {
        glEnable(GL_LIGHTING);
        glEnable(GL_FOG);
        glEnable(GL_CLIP_PLANE0);
    }
}
Graham Linden's avatar
Graham Linden committed
LLGLSPipelineDepthTestSkyBox::LLGLSPipelineDepthTestSkyBox(bool depth_test, bool depth_write)
: LLGLSPipelineSkyBox()
, mDepth(depth_test ? GL_TRUE : GL_FALSE, depth_write ? GL_TRUE : GL_FALSE, GL_LEQUAL)
{

}

LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_write)
: LLGLSPipelineDepthTestSkyBox(depth_test, depth_write)    
, mBlend(GL_BLEND)
{ 
    gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
#if LL_WINDOWS
// Expose desired use of high-performance graphics processor to Optimus driver
extern "C" 
{ 
    _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; 
}