#pragma once #include #include #include #include #include #include namespace mbgl { namespace gl { class Context; void bindTexture(gl::Context&, uint8_t unit, const gfx::TextureBinding&); template class TextureStates; template class TextureStates> { private: using State = IndexedTuple, TypeList>...>>; State state; public: void queryLocations(const ProgramID& id) { state = State{ gl::uniformLocation(id, concat_literals<&string_literal<'u', '_'>::value, &Ts::name>::value())... }; } NamedUniformLocations getNamedLocations() const { return NamedUniformLocations{ { concat_literals<&string_literal<'u', '_'>::value, &Ts::name>::value(), state.template get().location }... }; } void bind(gl::Context& context, const gfx::TextureBindings>& bindings) { util::ignore( { (state.template get() = TypeIndex::value, gl::bindTexture(context, TypeIndex::value, bindings.template get()), 0)... }); } }; } // namespace gl } // namespace mbgl