diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2012-12-06 18:14:47 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:47:49 +0300 |
commit | 06ec326bc42521dcf3a32fba3736ca636dfbd88a (patch) | |
tree | 3bab700564fc5e68f420985e752d0d784af42567 /qt_tstfrm | |
parent | 24dd26625caeccbaadd9a7681422b30d0b303e4b (diff) |
refactored allocation of OpenGL resources in ResourceManager.
Diffstat (limited to 'qt_tstfrm')
-rw-r--r-- | qt_tstfrm/tstwidgets.cpp | 122 |
1 files changed, 51 insertions, 71 deletions
diff --git a/qt_tstfrm/tstwidgets.cpp b/qt_tstfrm/tstwidgets.cpp index c6bd4cf3b3..283b4a4b87 100644 --- a/qt_tstfrm/tstwidgets.cpp +++ b/qt_tstfrm/tstwidgets.cpp @@ -48,77 +48,57 @@ void GLDrawWidget::initializeGL() rmp.m_texFormat = graphics::Data8Bpp; rmp.m_videoMemoryLimit = 20 * 1024 * 1024; - rmp.m_primaryStoragesParams = graphics::ResourceManager::StoragePoolParams(30000 * sizeof(graphics::gl::Vertex), - sizeof(graphics::gl::Vertex), - 50000 * sizeof(unsigned short), - sizeof(unsigned short), - 20, - false, - true, - 1, - "primaryStorage", - false, - false); - - rmp.m_smallStoragesParams = graphics::ResourceManager::StoragePoolParams(3000 * sizeof(graphics::gl::Vertex), - sizeof(graphics::gl::Vertex), - 5000 * sizeof(unsigned short), - sizeof(unsigned short), - 100, - false, - true, - 1, - "smallStorage", - false, - false); - - rmp.m_blitStoragesParams = graphics::ResourceManager::StoragePoolParams(10 * sizeof(graphics::gl::Vertex), - sizeof(graphics::gl::Vertex), - 10 * sizeof(unsigned short), - sizeof(unsigned short), - 30, - true, - true, - 1, - "blitStorage", - false, - false); - - rmp.m_multiBlitStoragesParams = graphics::ResourceManager::StoragePoolParams(500 * sizeof(graphics::gl::Vertex), - sizeof(graphics::gl::Vertex), - 500 * sizeof(unsigned short), - sizeof(unsigned short), - 10, - true, - true, - 1, - "multiBlitStorage", - false, - false); - - rmp.m_primaryTexturesParams = graphics::ResourceManager::TexturePoolParams(512, - 512, - 10, - rmp.m_texFormat, - true, - true, - true, - 1, - "primaryTexture", - false, - false); - - rmp.m_fontTexturesParams = graphics::ResourceManager::TexturePoolParams(512, - 256, - 5, - rmp.m_texFormat, - true, - true, - true, - 1, - "fontTexture", - false, - false); + + graphics::ResourceManager::StoragePoolParams spp; + graphics::ResourceManager::TexturePoolParams tpp; + + spp = graphics::ResourceManager::StoragePoolParams(30000 * sizeof(graphics::gl::Vertex), + sizeof(graphics::gl::Vertex), + 50000 * sizeof(unsigned short), + sizeof(unsigned short), + 20, + graphics::ELargeStorage, + false); + + rmp.m_storageParams[graphics::ELargeStorage] = spp; + + spp = graphics::ResourceManager::StoragePoolParams(3000 * sizeof(graphics::gl::Vertex), + sizeof(graphics::gl::Vertex), + 5000 * sizeof(unsigned short), + sizeof(unsigned short), + 100, + graphics::EMediumStorage, + false); + + rmp.m_storageParams[graphics::EMediumStorage] = spp; + + spp = graphics::ResourceManager::StoragePoolParams(500 * sizeof(graphics::gl::Vertex), + sizeof(graphics::gl::Vertex), + 500 * sizeof(unsigned short), + sizeof(unsigned short), + 10, + graphics::ESmallStorage, + false); + + rmp.m_storageParams[graphics::ESmallStorage] = spp; + + tpp = graphics::ResourceManager::TexturePoolParams(512, + 512, + 10, + rmp.m_texFormat, + graphics::ELargeTexture, + false); + + rmp.m_textureParams[graphics::ELargeTexture] = tpp; + + tpp = graphics::ResourceManager::TexturePoolParams(512, + 256, + 5, + rmp.m_texFormat, + graphics::ESmallTexture, + false); + + rmp.m_textureParams[graphics::ESmallTexture]; rmp.m_glyphCacheParams = graphics::ResourceManager::GlyphCacheParams("unicode_blocks.txt", "fonts_whitelist.txt", |