Skip to content

Add RAII / scoped gl::VboMesh attrib mapping #756

Open
@richardeakin

Description

@richardeakin

Currently you need to call something like:

auto mappedPosIter = mVboMesh->mapAttrib3f( geom::Attrib::POSITION );
// ... modify mapped data buffer
mappedPosIter.unmap();

But it is easy to forget to call the unmap(), and also inconvenient. It would be nice to have something like:

auto mappedPosIter = mVboMesh->scopedMapAttrib3f( geom::Attrib::POSITION );

That automatically unmapped when it went out of scope. Or perhaps a ScopedVboMeshMap, etc. Complications come up around dealing with the different data types, vec2, vec3, etc...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions