diff --git a/src/nostalgia/modules/core/src/opengl/gfx.cpp b/src/nostalgia/modules/core/src/opengl/gfx.cpp index 2a5add06..5a220c30 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.cpp +++ b/src/nostalgia/modules/core/src/opengl/gfx.cpp @@ -239,6 +239,7 @@ static void initSpritesBufferset(Context &ctx) noexcept { glEnableVertexAttribArray(texCoordAttr); glVertexAttribPointer(texCoordAttr, 2, GL_FLOAT, GL_FALSE, SpriteVertexVboRowLength * sizeof(float), std::bit_cast(uintptr_t{4 * sizeof(float)})); + glBindVertexArray(0); } static void initBackgroundBufferset( @@ -272,6 +273,7 @@ static void initBackgroundBufferset( glVertexAttribPointer( palBankAttr, 1, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float), std::bit_cast(uintptr_t{6 * sizeof(float)})); + glBindVertexArray(0); } static glutils::GLTexture createTexture( @@ -301,6 +303,7 @@ static void drawBackground(CBB &cbb) noexcept { } glBindTexture(GL_TEXTURE_2D, cbb.tex); glDrawElements(GL_TRIANGLES, static_cast(cbb.elements.size()), GL_UNSIGNED_INT, nullptr); + glBindVertexArray(0); } static void drawBackgrounds( @@ -354,6 +357,7 @@ static void drawSprites(Context &ctx, ox::Size const&renderSz) noexcept { // draw glBindTexture(GL_TEXTURE_2D, sb.tex); glDrawElements(GL_TRIANGLES, static_cast(sb.elements.size()), GL_UNSIGNED_INT, nullptr); + glBindVertexArray(0); } static void loadPalette(