[nostalgia/core/opengl] Disable depth testing once core scene is drawn

This commit is contained in:
Gary Talent 2023-12-20 19:14:42 -06:00
parent 4e4cec1b64
commit 8fa47e961d

View File

@ -463,9 +463,6 @@ static void setSprite(
ox::Error initGfx(
Context &ctx,
InitParams const&initParams) noexcept {
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
const auto bgVshad = ox::sfmt(renderer::bgvshadTmpl, gl::GlslVersion);
const auto bgFshad = ox::sfmt(renderer::bgfshadTmpl, gl::GlslVersion);
const auto spriteVshad = ox::sfmt(renderer::spritevshadTmpl, gl::GlslVersion);
@ -670,12 +667,17 @@ ox::Size drawSize(int scale) noexcept {
void draw(core::Context &ctx, ox::Size const&renderSz) noexcept {
glViewport(0, 0, renderSz.width, renderSz.height);
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderer::drawBackgrounds(ctx, renderSz);
if (ctx.spriteBlocks.tex) {
renderer::drawSprites(ctx, renderSz);
}
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
}
void draw(core::Context &ctx, int scale) noexcept {