mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- better be safe and not call GL_CLIP_DISTANCE functions on old hardware.
This commit is contained in:
parent
3faf5afa3a
commit
066d5c63e2
5 changed files with 24 additions and 17 deletions
|
@ -232,8 +232,21 @@ public:
|
|||
}
|
||||
|
||||
void EnableSplit(bool on)
|
||||
{
|
||||
if (gl.glslversion >= 1.3f)
|
||||
{
|
||||
mSplitEnabled = on;
|
||||
if (on)
|
||||
{
|
||||
glEnable(GL_CLIP_DISTANCE3);
|
||||
glEnable(GL_CLIP_DISTANCE4);
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_CLIP_DISTANCE3);
|
||||
glDisable(GL_CLIP_DISTANCE4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetLightIndex(int n)
|
||||
|
|
|
@ -388,8 +388,6 @@ void GLWall::DoDrawDecals()
|
|||
if (lightlist != NULL)
|
||||
{
|
||||
gl_RenderState.EnableSplit(true);
|
||||
glEnable(GL_CLIP_DISTANCE3);
|
||||
glEnable(GL_CLIP_DISTANCE4);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -405,8 +403,6 @@ void GLWall::DoDrawDecals()
|
|||
|
||||
if (lightlist != NULL)
|
||||
{
|
||||
glDisable(GL_CLIP_DISTANCE3);
|
||||
glDisable(GL_CLIP_DISTANCE4);
|
||||
gl_RenderState.EnableSplit(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -806,11 +806,17 @@ void GLDrawList::DrawSorted()
|
|||
sorted=DoSort(SortNodes[SortNodeStart]);
|
||||
}
|
||||
gl_RenderState.ClearClipSplit();
|
||||
if (gl.glslversion >= 1.3f)
|
||||
{
|
||||
glEnable(GL_CLIP_DISTANCE1);
|
||||
glEnable(GL_CLIP_DISTANCE2);
|
||||
}
|
||||
DoDrawSorted(sorted);
|
||||
if (gl.glslversion >= 1.3f)
|
||||
{
|
||||
glDisable(GL_CLIP_DISTANCE1);
|
||||
glDisable(GL_CLIP_DISTANCE2);
|
||||
}
|
||||
gl_RenderState.ClearClipSplit();
|
||||
}
|
||||
|
||||
|
|
|
@ -226,8 +226,6 @@ void GLSprite::Draw(int pass)
|
|||
{
|
||||
clipping = true;
|
||||
gl_RenderState.EnableSplit(true);
|
||||
glEnable(GL_CLIP_DISTANCE3);
|
||||
glEnable(GL_CLIP_DISTANCE4);
|
||||
}
|
||||
|
||||
secplane_t bottomp = { { 0, 0, -1. }, bottomclip };
|
||||
|
@ -333,8 +331,6 @@ void GLSprite::Draw(int pass)
|
|||
|
||||
if (clipping)
|
||||
{
|
||||
glDisable(GL_CLIP_DISTANCE3);
|
||||
glDisable(GL_CLIP_DISTANCE4);
|
||||
gl_RenderState.EnableSplit(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -339,8 +339,6 @@ void GLWall::RenderTextured(int rflags)
|
|||
else
|
||||
{
|
||||
gl_RenderState.EnableSplit(true);
|
||||
glEnable(GL_CLIP_DISTANCE3);
|
||||
glEnable(GL_CLIP_DISTANCE4);
|
||||
|
||||
for (unsigned i = 0; i < lightlist->Size(); i++)
|
||||
{
|
||||
|
@ -363,8 +361,6 @@ void GLWall::RenderTextured(int rflags)
|
|||
if (low1 <= zbottom[0] && low2 <= zbottom[1]) break;
|
||||
}
|
||||
|
||||
glDisable(GL_CLIP_DISTANCE3);
|
||||
glDisable(GL_CLIP_DISTANCE4);
|
||||
gl_RenderState.EnableSplit(false);
|
||||
}
|
||||
gl_RenderState.SetTextureMode(tmode);
|
||||
|
|
Loading…
Reference in a new issue