151 glGenTextures(1, &m_id);
152 glBindTexture(GL_TEXTURE_CUBE_MAP, m_id);
154 glTextureParameteri(m_id, GL_TEXTURE_WRAP_S, filter.clamping);
155 glTextureParameteri(m_id, GL_TEXTURE_WRAP_T, filter.clamping);
156 glTextureParameteri(m_id, GL_TEXTURE_WRAP_R, filter.clamping);
158 glTextureParameteri(m_id, GL_TEXTURE_MIN_FILTER, generate_mipmaps ?
to_mipmap(filter.min_filter) : filter.min_filter);
159 glTextureParameteri(m_id, GL_TEXTURE_MAG_FILTER, filter.mag_filter);
162 for (
auto const& face : data) {
163 glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i++, 0, m_color.internal_format, m_res.width, m_res.height, 0, m_color.format, m_color.datatype, face.data());
166 if (generate_mipmaps) {
167 glGenerateTextureMipmap(m_id);