diff --git a/specter/include/specter/Button.hpp b/specter/include/specter/Button.hpp index de65bc462..b5af033fe 100644 --- a/specter/include/specter/Button.hpp +++ b/specter/include/specter/Button.hpp @@ -122,7 +122,7 @@ public: View::setMultiplyColor(color); m_viewVertBlock.m_color = color; if (m_viewVertBlockBuf) - m_viewVertBlockBuf->access() = m_viewVertBlock; + m_viewVertBlockBuf.access() = m_viewVertBlock; m_text->setMultiplyColor(color); if (m_icon) m_icon->setMultiplyColor(color); diff --git a/specter/include/specter/ModalWindow.hpp b/specter/include/specter/ModalWindow.hpp index e0a51342d..53f97dfbf 100644 --- a/specter/include/specter/ModalWindow.hpp +++ b/specter/include/specter/ModalWindow.hpp @@ -36,7 +36,7 @@ private: zeus::CColor m_line2Clear; ViewBlock m_viewBlock; - std::experimental::optional::Token> m_viewBlockBuf; + hecl::UniformBufferPool::Token m_viewBlockBuf; union { struct diff --git a/specter/include/specter/RootView.hpp b/specter/include/specter/RootView.hpp index 20bc4d38e..64448502b 100644 --- a/specter/include/specter/RootView.hpp +++ b/specter/include/specter/RootView.hpp @@ -56,7 +56,7 @@ class RootView : public View VertexBufferBindingSolid m_vertsBinding; ViewBlock m_viewBlock; - std::experimental::optional::Token> m_viewVertBlockBuf; + hecl::UniformBufferPool::Token m_viewVertBlockBuf; SolidShaderVert m_verts[32]; void setArrowVerts(const boo::SWindowRect& rect, SplitView::ArrowDir dir); void setLineVerts(const boo::SWindowRect& rect, float split, SplitView::Axis axis); diff --git a/specter/include/specter/SplitView.hpp b/specter/include/specter/SplitView.hpp index f7d97f8a6..de5ff8083 100644 --- a/specter/include/specter/SplitView.hpp +++ b/specter/include/specter/SplitView.hpp @@ -43,7 +43,7 @@ private: ViewChild m_views[2]; ViewBlock m_splitBlock; - std::experimental::optional::Token> m_splitBlockBuf; + hecl::UniformBufferPool::Token m_splitBlockBuf; TexShaderVert m_splitVerts[4]; int m_clearanceA, m_clearanceB; @@ -104,7 +104,7 @@ public: { View::setMultiplyColor(color); m_splitBlock.m_color = color; - m_splitBlockBuf->access() = m_splitBlock; + m_splitBlockBuf.access() = m_splitBlock; if (m_views[0].m_view) m_views[0].m_view->setMultiplyColor(color); diff --git a/specter/include/specter/TextField.hpp b/specter/include/specter/TextField.hpp index b8ea99113..848876050 100644 --- a/specter/include/specter/TextField.hpp +++ b/specter/include/specter/TextField.hpp @@ -118,7 +118,7 @@ public: View::setMultiplyColor(color); m_viewVertBlock.m_color = color; if (m_viewVertBlockBuf) - m_viewVertBlockBuf->access() = m_viewVertBlock; + m_viewVertBlockBuf.access() = m_viewVertBlock; m_text->setMultiplyColor(color); if (m_errText) m_errText->setMultiplyColor(color); diff --git a/specter/include/specter/TextView.hpp b/specter/include/specter/TextView.hpp index b46605cb6..241bae304 100644 --- a/specter/include/specter/TextView.hpp +++ b/specter/include/specter/TextView.hpp @@ -44,7 +44,7 @@ public: private: size_t m_capacity; - std::experimental::optional::Token> m_glyphBuf; + hecl::VertexBufferPool::Token m_glyphBuf; boo::IVertexFormat* m_vtxFmt = nullptr; /* OpenGL only */ boo::IShaderDataBinding* m_shaderBinding; const FontAtlas& m_fontAtlas; diff --git a/specter/include/specter/Toolbar.hpp b/specter/include/specter/Toolbar.hpp index 51bc27461..f1fc8ef33 100644 --- a/specter/include/specter/Toolbar.hpp +++ b/specter/include/specter/Toolbar.hpp @@ -31,7 +31,7 @@ private: std::vector>> m_children; ViewBlock m_tbBlock; - std::experimental::optional::Token> m_tbBlockBuf; + hecl::UniformBufferPool::Token m_tbBlockBuf; TexShaderVert m_tbVerts[10]; int m_nomGauge = 25; int m_padding = 10; diff --git a/specter/include/specter/Tooltip.hpp b/specter/include/specter/Tooltip.hpp index 44ac98bc4..04d34d23f 100644 --- a/specter/include/specter/Tooltip.hpp +++ b/specter/include/specter/Tooltip.hpp @@ -10,7 +10,7 @@ namespace specter class Tooltip : public View { ViewBlock m_ttBlock; - std::experimental::optional::Token> m_ttBlockBuf; + hecl::UniformBufferPool::Token m_ttBlockBuf; SolidShaderVert m_ttVerts[16]; int m_nomWidth = 25; int m_nomHeight = 25; diff --git a/specter/include/specter/View.hpp b/specter/include/specter/View.hpp index f3bb91aa6..bb56424d6 100644 --- a/specter/include/specter/View.hpp +++ b/specter/include/specter/View.hpp @@ -110,7 +110,7 @@ public: template struct VertexBufferBinding { - std::experimental::optional::Token> m_vertsBuf; + typename hecl::VertexBufferPool::Token m_vertsBuf; boo::IVertexFormat* m_vtxFmt = nullptr; /* OpenGL only */ boo::IShaderDataBinding* m_shaderBinding = nullptr; @@ -118,7 +118,7 @@ public: { if (m_vertsBuf) { - VertStruct* out = m_vertsBuf->access(); + VertStruct* out = m_vertsBuf.access(); for (size_t i=0; iaccess(); + VertStruct* out = m_vertsBuf.access(); for (size_t i=0; i::Token> m_viewVertBlockBuf; + hecl::UniformBufferPool::Token m_viewVertBlockBuf; public: struct Resources @@ -249,7 +249,7 @@ public: { m_viewVertBlock.m_color = color; if (m_viewVertBlockBuf) - m_viewVertBlockBuf->access() = m_viewVertBlock; + m_viewVertBlockBuf.access() = m_viewVertBlock; } virtual int nominalWidth() const {return 0;} diff --git a/specter/lib/Button.cpp b/specter/lib/Button.cpp index 5d6392479..58fa6a2af 100644 --- a/specter/lib/Button.cpp +++ b/specter/lib/Button.cpp @@ -25,7 +25,7 @@ Button::Button(ViewResources& res, View& parentView, commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, 40, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, 40, m_viewVertBlockBuf); return true; }); diff --git a/specter/lib/FontCache.cpp b/specter/lib/FontCache.cpp index d82392cb4..7dc235769 100644 --- a/specter/lib/FontCache.cpp +++ b/specter/lib/FontCache.cpp @@ -394,7 +394,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi, m_token = gf->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { m_tex = - ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, + ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, 1, boo::TextureFormat::RGBA8, texmap.get(), bufSz); return true; }); @@ -479,7 +479,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi, m_token = gf->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { m_tex = - ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, + ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, 1, boo::TextureFormat::I8, texmap.get(), bufSz); return true; }); @@ -603,7 +603,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi, m_token = gf->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { m_tex = - ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, + ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, 1, boo::TextureFormat::RGBA8, texmap.get(), bufSz); return false; }); @@ -688,7 +688,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi, m_token = gf->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { m_tex = - ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, + ctx.newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1, 1, boo::TextureFormat::I8, texmap.get(), bufSz); return true; }); diff --git a/specter/lib/Icon.cpp b/specter/lib/Icon.cpp index b94373fb7..22b7783ed 100644 --- a/specter/lib/Icon.cpp +++ b/specter/lib/Icon.cpp @@ -10,7 +10,7 @@ IconView::IconView(ViewResources& res, View& parentView, Icon& icon) commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertexBinding.init(ctx, res, 4, *m_viewVertBlockBuf, icon.m_tex); + m_vertexBinding.init(ctx, res, 4, m_viewVertBlockBuf, icon.m_tex); return true; }); TexShaderVert verts[] = diff --git a/specter/lib/Menu.cpp b/specter/lib/Menu.cpp index 8cfac13f9..6cb9ad4f7 100644 --- a/specter/lib/Menu.cpp +++ b/specter/lib/Menu.cpp @@ -14,7 +14,7 @@ Menu::Menu(ViewResources& res, View& parentView, IMenuNode* rootNode) commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, 8, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, 8, m_viewVertBlockBuf); return true; }); m_headText.reset(new TextView(res, *this, res.m_mainFont)); @@ -75,7 +75,7 @@ Menu::Menu(ViewResources& res, View& parentView, IMenuNode* rootNode, IMenuNode* commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, 8, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, 8, m_viewVertBlockBuf); return true; }); m_headText.reset(new TextView(res, *this, res.m_mainFont)); @@ -90,7 +90,7 @@ Menu::ContentView::ContentView(ViewResources& res, Menu& menu) commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_hlVertsBinding.init(ctx, res, 4, *m_viewVertBlockBuf); + m_hlVertsBinding.init(ctx, res, 4, m_viewVertBlockBuf); return true; }); diff --git a/specter/lib/ModalWindow.cpp b/specter/lib/ModalWindow.cpp index 8ad727c0d..f68d49caa 100644 --- a/specter/lib/ModalWindow.cpp +++ b/specter/lib/ModalWindow.cpp @@ -295,8 +295,8 @@ ModalWindow::ModalWindow(ViewResources& res, View& parentView, m_windowGfxData = res.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_viewBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory)); - m_vertsBinding.init(ctx, res, 38, *m_viewBlockBuf); + m_viewBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory); + m_vertsBinding.init(ctx, res, 38, m_viewBlockBuf); return true; }); @@ -453,7 +453,7 @@ void ModalWindow::resized(const boo::SWindowRect& root, const boo::SWindowRect& centerRect.location[1] = root.size[1] / 2 - m_height / 2.0; View::resized(root, centerRect); m_viewBlock.setViewRect(root, centerRect); - m_viewBlockBuf->access() = m_viewBlock; + m_viewBlockBuf.access() = m_viewBlock; setLineVerts(m_width, m_height, pf, m_lineTime); setFillVerts(m_width, m_height, pf); diff --git a/specter/lib/RootView.cpp b/specter/lib/RootView.cpp index ea2752f42..e53f42e7f 100644 --- a/specter/lib/RootView.cpp +++ b/specter/lib/RootView.cpp @@ -27,8 +27,8 @@ RootView::SplitMenuSystem::SplitMenuSystem(RootView& rv, boo::IGraphicsDataFacto m_splitActionNode(*this), m_joinActionNode(*this) { ViewResources& res = *rv.m_viewRes; - m_viewVertBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory)); - m_vertsBinding.init(ctx, res, 32, *m_viewVertBlockBuf); + m_viewVertBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory); + m_vertsBinding.init(ctx, res, 32, m_viewVertBlockBuf); zeus::CColor col = {0.0,0.0,0.0,0.5}; for (int i=0 ; i<32 ; ++i) @@ -106,7 +106,7 @@ void RootView::SplitMenuSystem::setArrowVerts(const boo::SWindowRect& rect, Spli m_viewBlock.m_mv[3][1] = 2.0f * (rect.location[1] + (dir == SplitView::ArrowDir::Down ? rect.size[1] : 0)) / float(root.size[1]) - 1.0f; } - m_viewVertBlockBuf->access() = m_viewBlock; + m_viewVertBlockBuf.access() = m_viewBlock; } void RootView::SplitMenuSystem::setLineVerts(const boo::SWindowRect& rect, float split, SplitView::Axis axis) @@ -130,7 +130,7 @@ void RootView::SplitMenuSystem::setLineVerts(const boo::SWindowRect& rect, float m_viewBlock.m_mv[3][0] = (rect.location[0] + split * rect.size[0]) * m_viewBlock.m_mv[0][0] - 1.0f; m_viewBlock.m_mv[3][1] = 2.0f * (rect.location[1] + rect.size[1] / 2.0f) / float(root.size[1]) - 1.0f; } - m_viewVertBlockBuf->access() = m_viewBlock; + m_viewVertBlockBuf.access() = m_viewBlock; } void RootView::destroyed() diff --git a/specter/lib/ScrollView.cpp b/specter/lib/ScrollView.cpp index cb827f532..4014a7314 100644 --- a/specter/lib/ScrollView.cpp +++ b/specter/lib/ScrollView.cpp @@ -13,7 +13,7 @@ ScrollView::ScrollView(ViewResources& res, View& parentView, Style style) commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, 4, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, 4, m_viewVertBlockBuf); return true; }); diff --git a/specter/lib/Space.cpp b/specter/lib/Space.cpp index a21b8b64a..b8a76648d 100644 --- a/specter/lib/Space.cpp +++ b/specter/lib/Space.cpp @@ -40,7 +40,7 @@ Space::CornerView::CornerView(ViewResources& res, Space& space, const zeus::CCol commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertexBinding.init(ctx, res, 34, *m_viewVertBlockBuf); + m_vertexBinding.init(ctx, res, 34, m_viewVertBlockBuf); return true; }); float pf = res.pixelFactor(); diff --git a/specter/lib/SplitView.cpp b/specter/lib/SplitView.cpp index bf2f835b1..fc052710d 100644 --- a/specter/lib/SplitView.cpp +++ b/specter/lib/SplitView.cpp @@ -28,8 +28,8 @@ SplitView::SplitView(ViewResources& res, View& parentView, ISplitSpaceController commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_splitBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory)); - m_splitVertsBinding.init(ctx, res, 4, *m_splitBlockBuf, res.m_splitRes.m_shadingTex); + m_splitBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory); + m_splitVertsBinding.init(ctx, res, 4, m_splitBlockBuf, res.m_splitRes.m_shadingTex); return true; }); } @@ -476,7 +476,7 @@ void SplitView::resized(const boo::SWindowRect& root, const boo::SWindowRect& su m_splitBlock.setViewRect(root, ssub); setVerticalVerts(ssub.size[1]); } - m_splitBlockBuf->access() = m_splitBlock; + m_splitBlockBuf.access() = m_splitBlock; m_splitVertsBinding.load(m_splitVerts); } diff --git a/specter/lib/Table.cpp b/specter/lib/Table.cpp index aebf7c673..94df41f54 100644 --- a/specter/lib/Table.cpp +++ b/specter/lib/Table.cpp @@ -22,7 +22,7 @@ Table::Table(ViewResources& res, View& parentView, ITableDataBinding* data, commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, maxColumns * 6, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, maxColumns * 6, m_viewVertBlockBuf); return true; }); m_scroll.m_view->setContentView(&m_rowsView); @@ -36,7 +36,7 @@ Table::RowsView::RowsView(Table& t, ViewResources& res) commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, SPECTER_TABLE_MAX_ROWS * t.m_maxColumns * 6, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, SPECTER_TABLE_MAX_ROWS * t.m_maxColumns * 6, m_viewVertBlockBuf); return true; }); } diff --git a/specter/lib/TextField.cpp b/specter/lib/TextField.cpp index f8c2f2924..41416a869 100644 --- a/specter/lib/TextField.cpp +++ b/specter/lib/TextField.cpp @@ -11,7 +11,7 @@ TextField::TextField(ViewResources& res, View& parentView, IStringBinding* strBi commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_vertsBinding.init(ctx, res, 41, *m_viewVertBlockBuf); + m_vertsBinding.init(ctx, res, 41, m_viewVertBlockBuf); return true; }); diff --git a/specter/lib/TextView.cpp b/specter/lib/TextView.cpp index 501312465..6e2ce61ef 100644 --- a/specter/lib/TextView.cpp +++ b/specter/lib/TextView.cpp @@ -306,7 +306,7 @@ void TextView::_commitResources(size_t capacity) if (capacity) { - m_glyphBuf.emplace(res.m_textRes.m_glyphPool.allocateBlock(res.m_factory, capacity)); + m_glyphBuf = res.m_textRes.m_glyphPool.allocateBlock(res.m_factory, capacity); boo::IShaderPipeline* shader; if (m_fontAtlas.subpixel()) @@ -314,8 +314,8 @@ void TextView::_commitResources(size_t capacity) else shader = res.m_textRes.m_regular; - auto vBufInfo = m_glyphBuf->getBufferInfo(); - auto uBufInfo = m_viewVertBlockBuf->getBufferInfo(); + auto vBufInfo = m_glyphBuf.getBufferInfo(); + auto uBufInfo = m_viewVertBlockBuf.getBufferInfo(); boo::IGraphicsBuffer* uBufs[] = {uBufInfo.first}; size_t uBufOffs[] = {size_t(uBufInfo.second)}; size_t uBufSizes[] = {sizeof(ViewBlock)}; @@ -550,7 +550,7 @@ void TextView::invalidateGlyphs() { if (m_glyphBuf) { - RenderGlyph* out = m_glyphBuf->access(); + RenderGlyph* out = m_glyphBuf.access(); size_t i = 0; for (RenderGlyph& glyph : m_glyphs) out[i++] = glyph; diff --git a/specter/lib/Toolbar.cpp b/specter/lib/Toolbar.cpp index dd318d5c8..f325408fa 100644 --- a/specter/lib/Toolbar.cpp +++ b/specter/lib/Toolbar.cpp @@ -33,8 +33,8 @@ Toolbar::Toolbar(ViewResources& res, View& parentView, Position tbPos, unsigned commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_tbBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory)); - m_vertsBinding.init(ctx, res, 10, *m_tbBlockBuf, res.m_toolbarRes.m_shadingTex); + m_tbBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory); + m_vertsBinding.init(ctx, res, 10, m_tbBlockBuf, res.m_toolbarRes.m_shadingTex); return true; }); setBackground(res.themeData().toolbarBackground()); @@ -140,7 +140,7 @@ void Toolbar::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) setHorizontalVerts(sub.size[0]); m_vertsBinding.load(m_tbVerts); m_tbBlock.setViewRect(root, sub); - m_tbBlockBuf->access() = m_tbBlock; + m_tbBlockBuf.access() = m_tbBlock; float gaugeUnit = rootView().viewRes().pixelFactor() * SPECTER_TOOLBAR_GAUGE; float yOff = 0.0; diff --git a/specter/lib/Tooltip.cpp b/specter/lib/Tooltip.cpp index ad47ea108..0d74ac943 100644 --- a/specter/lib/Tooltip.cpp +++ b/specter/lib/Tooltip.cpp @@ -18,8 +18,8 @@ Tooltip::Tooltip(ViewResources& res, View& parentView, const std::string& title, commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool { buildResources(ctx, res); - m_ttBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory)); - m_vertsBinding.init(ctx, res, 16, *m_ttBlockBuf); + m_ttBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory); + m_vertsBinding.init(ctx, res, 16, m_ttBlockBuf); return true; }); @@ -84,7 +84,7 @@ void Tooltip::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) float pf = rootView().viewRes().pixelFactor(); setVerts(m_nomWidth, m_nomHeight, pf); m_ttBlock.setViewRect(root, sub); - m_ttBlockBuf->access() = m_ttBlock; + m_ttBlockBuf.access() = m_ttBlock; std::pair margin = m_cornersFilled[0]->queryGlyphDimensions(0); diff --git a/specter/lib/View.cpp b/specter/lib/View.cpp index 485f70b89..a40220765 100644 --- a/specter/lib/View.cpp +++ b/specter/lib/View.cpp @@ -322,8 +322,8 @@ void View::Resources::init(boo::VulkanDataFactory::Context& ctx, const IThemeDat void View::buildResources(boo::IGraphicsDataFactory::Context& ctx, ViewResources& res) { - m_viewVertBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory)); - m_bgVertsBinding.init(ctx, res, 4, *m_viewVertBlockBuf); + m_viewVertBlockBuf = res.m_viewRes.m_bufPool.allocateBlock(res.m_factory); + m_bgVertsBinding.init(ctx, res, 4, m_viewVertBlockBuf); } View::View(ViewResources& res) @@ -348,7 +348,7 @@ void View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) m_bgRect[2].m_pos.assign(sub.size[0], sub.size[1], 0.f); m_bgRect[3].m_pos.assign(sub.size[0], 0.f, 0.f); if (m_viewVertBlockBuf) - m_viewVertBlockBuf->access() = m_viewVertBlock; + m_viewVertBlockBuf.access() = m_viewVertBlock; m_bgVertsBinding.load(m_bgRect); } @@ -360,7 +360,7 @@ void View::resized(const ViewBlock& vb, const boo::SWindowRect& sub) m_bgRect[2].m_pos.assign(sub.size[0], sub.size[1], 0.f); m_bgRect[3].m_pos.assign(sub.size[0], 0.f, 0.f); if (m_viewVertBlockBuf) - m_viewVertBlockBuf->access() = vb; + m_viewVertBlockBuf.access() = vb; m_bgVertsBinding.load(m_bgRect); } @@ -389,8 +389,8 @@ void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ct ViewResources& res, size_t count, const hecl::UniformBufferPool::Token& viewBlockBuf) { - m_vertsBuf.emplace(res.m_viewRes.m_solidPool.allocateBlock(res.m_factory, count)); - auto vBufInfo = m_vertsBuf->getBufferInfo(); + m_vertsBuf = res.m_viewRes.m_solidPool.allocateBlock(res.m_factory, count); + auto vBufInfo = m_vertsBuf.getBufferInfo(); auto uBufInfo = viewBlockBuf.getBufferInfo(); boo::IGraphicsBuffer* bufs[] = {uBufInfo.first}; @@ -425,8 +425,8 @@ void View::VertexBufferBindingTex::init(boo::IGraphicsDataFactory::Context& ctx, const hecl::UniformBufferPool::Token& viewBlockBuf, boo::ITexture* texture) { - m_vertsBuf.emplace(res.m_viewRes.m_texPool.allocateBlock(res.m_factory, count)); - auto vBufInfo = m_vertsBuf->getBufferInfo(); + m_vertsBuf = res.m_viewRes.m_texPool.allocateBlock(res.m_factory, count); + auto vBufInfo = m_vertsBuf.getBufferInfo(); auto uBufInfo = viewBlockBuf.getBufferInfo(); boo::IGraphicsBuffer* bufs[] = {uBufInfo.first};