From 37c3f117fe1c3c49d67c86900fc842c233b4b606 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 30 Mar 2021 02:42:18 -0500 Subject: [PATCH] [nostalgia/core/gl] Initialize buffers --- src/nostalgia/core/userland/gfx_opengl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nostalgia/core/userland/gfx_opengl.cpp b/src/nostalgia/core/userland/gfx_opengl.cpp index cfba5092a..674568dc0 100644 --- a/src/nostalgia/core/userland/gfx_opengl.cpp +++ b/src/nostalgia/core/userland/gfx_opengl.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -37,8 +36,8 @@ struct Background { Texture tex; bool enabled = false; bool updated = false; - std::array bgVertices; - std::array bgElements; + std::array bgVertices = {}; + std::array bgElements = {}; }; struct GlImplData { @@ -145,7 +144,7 @@ static void initBackgroundBufferset(Context *ctx, GLuint shader, Background *bg) // vbo layout auto posAttr = static_cast(glGetAttribLocation(shader, "position")); glEnableVertexAttribArray(posAttr); - glVertexAttribPointer(posAttr, 2, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float), 0); + glVertexAttribPointer(posAttr, 2, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float), nullptr); auto texCoordAttr = static_cast(glGetAttribLocation(shader, "vTexCoord")); glEnableVertexAttribArray(texCoordAttr); glVertexAttribPointer(texCoordAttr, 2, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float),