Change depth function to <=.
This commit is contained in:
@@ -72,6 +72,7 @@ namespace OpenRA.Platforms.Default
|
|||||||
|
|
||||||
// Depth buffer
|
// Depth buffer
|
||||||
public const int GL_DEPTH_COMPONENT = 0x1902;
|
public const int GL_DEPTH_COMPONENT = 0x1902;
|
||||||
|
public const int GL_LEQUAL = 0x0203;
|
||||||
|
|
||||||
// BlendingFactorDest
|
// BlendingFactorDest
|
||||||
public const int GL_ZERO = 0;
|
public const int GL_ZERO = 0;
|
||||||
@@ -276,6 +277,9 @@ namespace OpenRA.Platforms.Default
|
|||||||
public delegate void BlendFunc(int sfactor, int dfactor);
|
public delegate void BlendFunc(int sfactor, int dfactor);
|
||||||
public static BlendFunc glBlendFunc { get; private set; }
|
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 delegate void Scissor(int x, int y, int width, int height);
|
||||||
public static Scissor glScissor { get; private set; }
|
public static Scissor glScissor { get; private set; }
|
||||||
|
|
||||||
@@ -418,6 +422,7 @@ namespace OpenRA.Platforms.Default
|
|||||||
glDisable = Bind<Disable>("glDisable");
|
glDisable = Bind<Disable>("glDisable");
|
||||||
glBlendEquation = Bind<BlendEquation>("glBlendEquation");
|
glBlendEquation = Bind<BlendEquation>("glBlendEquation");
|
||||||
glBlendFunc = Bind<BlendFunc>("glBlendFunc");
|
glBlendFunc = Bind<BlendFunc>("glBlendFunc");
|
||||||
|
glDepthFunc = Bind<DepthFunc>("glDepthFunc");
|
||||||
glScissor = Bind<Scissor>("glScissor");
|
glScissor = Bind<Scissor>("glScissor");
|
||||||
glPushClientAttrib = Bind<PushClientAttrib>("glPushClientAttrib");
|
glPushClientAttrib = Bind<PushClientAttrib>("glPushClientAttrib");
|
||||||
glPopClientAttrib = Bind<PopClientAttrib>("glPopClientAttrib");
|
glPopClientAttrib = Bind<PopClientAttrib>("glPopClientAttrib");
|
||||||
|
|||||||
@@ -224,6 +224,8 @@ namespace OpenRA.Platforms.Default
|
|||||||
OpenGL.CheckGLError();
|
OpenGL.CheckGLError();
|
||||||
OpenGL.glEnable(OpenGL.GL_DEPTH_TEST);
|
OpenGL.glEnable(OpenGL.GL_DEPTH_TEST);
|
||||||
OpenGL.CheckGLError();
|
OpenGL.CheckGLError();
|
||||||
|
OpenGL.glDepthFunc(OpenGL.GL_LEQUAL);
|
||||||
|
OpenGL.CheckGLError();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DisableDepthBuffer()
|
public void DisableDepthBuffer()
|
||||||
|
|||||||
Reference in New Issue
Block a user