1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-03 04:53:35 +00:00

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

View file

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