Disable depth test in lovr.graphics.fill;

This commit is contained in:
bjorn 2018-03-19 12:47:35 -07:00
parent be699aa132
commit 8e5061f918
1 changed files with 5 additions and 0 deletions

View File

@ -1084,6 +1084,10 @@ void lovrGraphicsFill(Texture* texture) {
1, -1, 0, 0, 0, 0, 1, 0
};
CompareMode mode;
bool write;
lovrGraphicsGetDepthTest(&mode, &write);
lovrGraphicsSetDepthTest(COMPARE_NONE, false);
lovrGraphicsSetDefaultShader(SHADER_FILL);
Material* material = lovrGraphicsGetDefaultMaterial();
lovrMaterialSetTexture(material, TEXTURE_DIFFUSE, texture);
@ -1095,6 +1099,7 @@ void lovrGraphicsFill(Texture* texture) {
lovrMeshSetDrawRange(state.mesh, 0, 4);
lovrMaterialSetTexture(material, TEXTURE_DIFFUSE, NULL);
lovrMeshDraw(state.mesh, NULL, NULL, 1);
lovrGraphicsSetDepthTest(mode, write);
}
// Internal State