mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- another failed attempt to use GL_CLIP_PLANE. Leave it in because it's closer to what is needed than the old code.
This commit is contained in:
parent
616f84209b
commit
99bfc64af6
1 changed files with 15 additions and 8 deletions
|
@ -342,21 +342,28 @@ void FRenderState::SetClipHeight(float height, float direction)
|
|||
{
|
||||
mClipHeight = height;
|
||||
mClipHeightDirection = direction;
|
||||
#if 1
|
||||
// This still doesn't work... :(
|
||||
if (gl.glslversion < 1.3f) return;
|
||||
#endif
|
||||
if (direction != 0.f)
|
||||
{
|
||||
if (gl.glslversion >= 1.3f) glEnable(GL_CLIP_DISTANCE0);
|
||||
else
|
||||
/*
|
||||
if (gl.glslversion < 1.3f)
|
||||
{
|
||||
// This does not work. Need someone who understands how glClipPlane works...
|
||||
//glEnable(GL_CLIP_PLANE0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadMatrixf(mViewMatrix.get());
|
||||
// Plane mirrors never are slopes.
|
||||
//double d[4] = { 0, direction, 0, -direction * height };
|
||||
//glClipPlane(GL_CLIP_PLANE0, d);
|
||||
double d[4] = { 0, direction, 0, -direction * height };
|
||||
glClipPlane(GL_CLIP_PLANE0, d);
|
||||
glPopMatrix();
|
||||
}
|
||||
*/
|
||||
glEnable(GL_CLIP_DISTANCE0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gl.glslversion >= 1.3f) glDisable(GL_CLIP_DISTANCE0);
|
||||
//else glDisable(GL_CLIP_PLANE0);
|
||||
glDisable(GL_CLIP_DISTANCE0); // GL_CLIP_PLANE0 is the same value so no need to make a distinction
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue