X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmesh.cpp;h=8f7c517b2b5360a57d69bded3aed38d32b9ab58c;hb=cabb833e9b4ca10b9f350f3be6c351dce6a66822;hp=3e9e118ac52e6a9eb40b47345cce0f9692d9b140;hpb=fcd9e657d0c86cfa4c5bb951ccad2ff5f242863a;p=libs%2Fgl.git diff --git a/source/mesh.cpp b/source/mesh.cpp index 3e9e118a..8f7c517b 100644 --- a/source/mesh.cpp +++ b/source/mesh.cpp @@ -31,6 +31,7 @@ void Mesh::init(ResourceManager *rm) vao_id = 0; defer_buffers = true; dirty = true; + disallow_rendering = false; winding = 0; if(rm) @@ -152,7 +153,7 @@ void Mesh::draw() const if(!current()) vertices.apply(); - Bind bind_ibuf(ibuf, ELEMENT_ARRAY_BUFFER); + BindRestore bind_ibuf(ibuf, ELEMENT_ARRAY_BUFFER); Bind bind_winding(winding); for(list::const_iterator i=batches.begin(); i!=batches.end(); ++i) @@ -169,7 +170,6 @@ void Mesh::draw(Renderer &renderer) const } renderer.set_mesh(this); - renderer.set_element_buffer(ibuf); renderer.set_winding_test(winding); for(list::const_iterator i=batches.begin(); i!=batches.end(); ++i) @@ -183,7 +183,7 @@ void Mesh::bind() const if(!vao_id) { unbind(); - vertices.apply(); + vertices.apply(false); } else if(set_current(this)) { @@ -200,7 +200,7 @@ void Mesh::unbind() glBindVertexArray(0); } -Resource::AsyncLoader *Mesh::load(IO::Seekable &io) +Resource::AsyncLoader *Mesh::load(IO::Seekable &io, const Resources *) { return new AsyncLoader(*this, io); }