From de45e7a0758deda4d2ed21260e6ff131c420d091 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 18 Jun 2023 17:58:01 -0500 Subject: [PATCH] [nostalgia/core/opengl] Cleanup --- src/nostalgia/modules/core/src/opengl/gfx.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nostalgia/modules/core/src/opengl/gfx.cpp b/src/nostalgia/modules/core/src/opengl/gfx.cpp index f4991f8d..4cc219fe 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.cpp +++ b/src/nostalgia/modules/core/src/opengl/gfx.cpp @@ -346,7 +346,8 @@ ox::Error initGfx( const auto spriteFshad = ox::sfmt(renderer::spritefshadTmpl, glutils::GlslVersion); auto &gctx = static_cast(*ctx); oxReturnError(glutils::buildShaderProgram(bgVshad.c_str(), bgFshad.c_str()).moveTo(&gctx.bgShader)); - oxReturnError(glutils::buildShaderProgram(spriteVshad.c_str(), spriteFshad.c_str()).moveTo(&gctx.spriteShader)); + oxReturnError( + glutils::buildShaderProgram(spriteVshad.c_str(), spriteFshad.c_str()).moveTo(&gctx.spriteShader)); for (auto &bg : gctx.cbbs) { initBackgroundBufferset(ctx, gctx.bgShader, &bg); } @@ -435,6 +436,7 @@ void puts(Context *ctx, int column, int row, ox::CRStringView str) noexcept { setTile(ctx, 0, static_cast(col + i), row, static_cast(charMap[static_cast(str[i])])); } } + void setBgCbb(Context *ctx, unsigned bgIdx, unsigned cbbIdx) noexcept { auto &gctx = static_cast(*ctx); auto &bg = gctx.backgrounds[bgIdx]; @@ -577,9 +579,7 @@ namespace gl { void drawMainView(core::Context *ctx, ox::Size const&renderSz) noexcept { glViewport(0, 0, renderSz.width, renderSz.height); - // clear screen - glClearColor(0, 0, 0, 1); - glClear(GL_COLOR_BUFFER_BIT); + glutils::clearScreen(); auto &gctx = static_cast(*ctx); renderer::drawBackgrounds(&gctx, renderSz); if (gctx.spriteBlocks.tex) {