Skip to content

Commit 78cdb9d

Browse files
committed
expose vbo
1 parent dfebd01 commit 78cdb9d

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

include/threepp/renderers/GLRenderer.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace threepp {
3030
class Material;
3131
class Texture;
3232
class GLRenderTarget;
33+
class BufferAttribute;
3334

3435
class GLRenderer {
3536

@@ -167,6 +168,8 @@ namespace threepp {
167168

168169
[[nodiscard]] std::optional<unsigned int> getGlTextureId(Texture& texture) const;
169170

171+
[[nodiscard]] std::optional<unsigned int> getGlBufferId(BufferAttribute& bufferAttribute) const;
172+
170173
void writeFramebuffer(const std::filesystem::path& filename);
171174

172175
~GLRenderer();

src/threepp/renderers/GLRenderer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ struct GLRenderer::Impl {
193193
return textures.getGlTexture(texture);
194194
}
195195

196+
[[nodiscard]] std::optional<unsigned int> getGlBufferId(BufferAttribute& attribute) const {
197+
198+
return attributes.get(&attribute).buffer;
199+
}
200+
196201
void deallocateMaterial(Material* material) {
197202

198203
releaseMaterialProgramReferences(material);
@@ -1468,6 +1473,11 @@ std::optional<unsigned int> GLRenderer::getGlTextureId(Texture& texture) const {
14681473
return pimpl_->getGlTextureId(texture);
14691474
}
14701475

1476+
std::optional<unsigned int> GLRenderer::getGlBufferId(BufferAttribute& buffer) const {
1477+
1478+
return pimpl_->getGlBufferId(buffer);
1479+
}
1480+
14711481
void GLRenderer::writeFramebuffer(const std::filesystem::path& filename) {
14721482

14731483
pimpl_->writeFramebuffer(filename);

0 commit comments

Comments
 (0)