disabling depth buffer for 2d

This commit is contained in:
DaniTheSkunk 2022-11-25 00:51:42 +00:00
parent 44f5325f4e
commit e4d090dbd9
1 changed files with 3 additions and 2 deletions

View File

@ -145,7 +145,6 @@ public class Window extends BaseWindow {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
//glDepthFunc(GL_GREATER);
glfwSetWindowSizeCallback(window, this::windowSizeCallback); glfwSetWindowSizeCallback(window, this::windowSizeCallback);
glfwSetMouseButtonCallback(window, this::mouseButtonCallback); glfwSetMouseButtonCallback(window, this::mouseButtonCallback);
@ -349,6 +348,7 @@ public class Window extends BaseWindow {
textureAtlas.update(); textureAtlas.update();
glClearColor(0.f, 0.f, 0.f, 0.0f); glClearColor(0.f, 0.f, 0.f, 0.0f);
glClear(GL_DEPTH_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT);
glDepthFunc(GL_ALWAYS);
//glBegin(GL_TRIANGLES); //glBegin(GL_TRIANGLES);
return renderContext; return renderContext;
} }
@ -360,8 +360,9 @@ public class Window extends BaseWindow {
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glViewport(0, 0, size.getX(), size.getY()); glViewport(0, 0, size.getX(), size.getY());
textureAtlas.update(); textureAtlas.update();
glClearColor(0.f, 1.f, 0.f, 1.0f); glClearColor(0.f, 0.f, 0.f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthFunc(GL_LESS);
//glBegin(GL_TRIANGLES); //glBegin(GL_TRIANGLES);
glUniformMatrix4fv(program3D.getUniformLocation("projection"), glUniformMatrix4fv(program3D.getUniformLocation("projection"),
true, true,