Change depth function to <=.

This commit is contained in:
Paul Chote
2015-10-01 18:55:54 +01:00
parent 0538f0c66e
commit ecebb2a844
2 changed files with 7 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ namespace OpenRA.Platforms.Default
// Depth buffer
public const int GL_DEPTH_COMPONENT = 0x1902;
public const int GL_LEQUAL = 0x0203;
// BlendingFactorDest
public const int GL_ZERO = 0;
@@ -276,6 +277,9 @@ namespace OpenRA.Platforms.Default
public delegate void BlendFunc(int sfactor, int dfactor);
public static BlendFunc glBlendFunc { get; private set; }
public delegate void DepthFunc(int func);
public static DepthFunc glDepthFunc { get; private set; }
public delegate void Scissor(int x, int y, int width, int height);
public static Scissor glScissor { get; private set; }
@@ -418,6 +422,7 @@ namespace OpenRA.Platforms.Default
glDisable = Bind<Disable>("glDisable");
glBlendEquation = Bind<BlendEquation>("glBlendEquation");
glBlendFunc = Bind<BlendFunc>("glBlendFunc");
glDepthFunc = Bind<DepthFunc>("glDepthFunc");
glScissor = Bind<Scissor>("glScissor");
glPushClientAttrib = Bind<PushClientAttrib>("glPushClientAttrib");
glPopClientAttrib = Bind<PopClientAttrib>("glPopClientAttrib");

View File

@@ -224,6 +224,8 @@ namespace OpenRA.Platforms.Default
OpenGL.CheckGLError();
OpenGL.glEnable(OpenGL.GL_DEPTH_TEST);
OpenGL.CheckGLError();
OpenGL.glDepthFunc(OpenGL.GL_LEQUAL);
OpenGL.CheckGLError();
}
public void DisableDepthBuffer()