[nostalgia/core/gl] Initialize buffers
This commit is contained in:
parent
f0b359597a
commit
37c3f117fe
@ -9,7 +9,6 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#include <ox/std/bit.hpp>
|
#include <ox/std/bit.hpp>
|
||||||
#include <ox/std/defines.hpp>
|
|
||||||
#include <ox/std/fmt.hpp>
|
#include <ox/std/fmt.hpp>
|
||||||
|
|
||||||
#include <nostalgia/core/config.hpp>
|
#include <nostalgia/core/config.hpp>
|
||||||
@ -37,8 +36,8 @@ struct Background {
|
|||||||
Texture tex;
|
Texture tex;
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
std::array<float, TileCount * BgVertexVboLength> bgVertices;
|
std::array<float, TileCount * BgVertexVboLength> bgVertices = {};
|
||||||
std::array<GLuint, TileCount * BgVertexEboLength> bgElements;
|
std::array<GLuint, TileCount * BgVertexEboLength> bgElements = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GlImplData {
|
struct GlImplData {
|
||||||
@ -145,7 +144,7 @@ static void initBackgroundBufferset(Context *ctx, GLuint shader, Background *bg)
|
|||||||
// vbo layout
|
// vbo layout
|
||||||
auto posAttr = static_cast<GLuint>(glGetAttribLocation(shader, "position"));
|
auto posAttr = static_cast<GLuint>(glGetAttribLocation(shader, "position"));
|
||||||
glEnableVertexAttribArray(posAttr);
|
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<GLuint>(glGetAttribLocation(shader, "vTexCoord"));
|
auto texCoordAttr = static_cast<GLuint>(glGetAttribLocation(shader, "vTexCoord"));
|
||||||
glEnableVertexAttribArray(texCoordAttr);
|
glEnableVertexAttribArray(texCoordAttr);
|
||||||
glVertexAttribPointer(texCoordAttr, 2, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float),
|
glVertexAttribPointer(texCoordAttr, 2, GL_FLOAT, GL_FALSE, BgVertexVboRowLength * sizeof(float),
|
||||||
|
Loading…
Reference in New Issue
Block a user