| 72 | private: |
| 73 | |
| 74 | void CreateTextures(std::size_t numTextures) |
| 75 | { |
| 76 | // Create source image for textures |
| 77 | std::cout << "generate random image ..." << std::endl; |
| 78 | |
| 79 | LLGL::Image image |
| 80 | { |
| 81 | { config.textureSize, config.textureSize, config.arrayLayers }, |
| 82 | LLGL::ImageFormat::RGBA, |
| 83 | LLGL::DataType::UInt8 |
| 84 | }; |
| 85 | |
| 86 | auto imageData = reinterpret_cast<LLGL::ColorRGBAub*>(image.GetData()); |
| 87 | for (std::size_t i = 0, n = image.GetNumPixels(); i < n; ++i) |
| 88 | imageData[i] = RandColorRGBA(); |
| 89 | |
| 90 | auto imageDesc = image.GetSrcDesc(); |
| 91 | |
| 92 | // Create textures |
| 93 | textures.reserve(numTextures); |
| 94 | |
| 95 | LLGL::TextureDescriptor textureDesc; |
| 96 | { |
| 97 | textureDesc.type = LLGL::TextureType::Texture2DArray; |
| 98 | textureDesc.format = LLGL::Format::RGBA8UNorm; |
| 99 | textureDesc.extent.width = image.GetExtent().width; |
| 100 | textureDesc.extent.height = image.GetExtent().height; |
| 101 | textureDesc.arrayLayers = image.GetExtent().depth; |
| 102 | } |
| 103 | for (std::size_t i = 0; i < numTextures; ++i) |
| 104 | { |
| 105 | std::cout << "create texture " << (i + 1) << '/' << numTextures << '\r'; |
| 106 | textures.push_back(renderer->CreateTexture(textureDesc, &imageDesc)); |
| 107 | } |
| 108 | |
| 109 | std::cout << std::endl; |
| 110 | } |
| 111 | |
| 112 | void MeasureTime(const std::string& title, const std::function<void()>& callback) |
| 113 | { |
nothing calls this directly
no test coverage detected