Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/main.cpp b/src/main.cpp
- index 91bb311..1cf469a 100644
- --- a/src/main.cpp
- +++ b/src/main.cpp
- @@ -30,7 +30,7 @@ class TextRenderer
- pgl::Program &program;
- pgl::Program &backgroundProgram;
- pgl::vao vao, backgroundVao;
- - pgl::data::vbo vbo;
- + pgl::storage::vbo vbo;
- pgl::data::vbo backgroundVbo;
- pgl::data::ebo ebo, backgroundEbo;
- pgl::Texture &texture;
- @@ -168,7 +168,7 @@ public:
- box.push_back(glm::vec4(vec.x + letterSpacing*i, vec.y, 0, 0));
- }
- }
- - vbo.bufferData(box, GL_STREAM_DRAW);
- + vbo.bufferData(box, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
- ebo.bind();
- std::vector<GLuint> boxIndices {};
- for(size_t i = 0; i < text.size(); ++i)
- @@ -180,7 +180,7 @@ public:
- }
- ebo.bufferData(boxIndices, usage);
- }
- - glm::vec4* box = reinterpret_cast<glm::vec4*>(vbo.mapBuffer(GL_WRITE_ONLY));
- + glm::vec4* box = reinterpret_cast<glm::vec4*>(vbo.getMappedPtr());
- for(size_t i = 0; i < text.size(); ++i)
- {
- char letterX = (this->text[i] - ' ') % 10;
- @@ -198,7 +198,6 @@ public:
- box[(i*4)+3].z = letterX*charPosX;
- box[(i*4)+3].w = (letterY*charPosY)+charHeight;
- }
- - vbo.unmapBuffer();
- updateModel();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement