+ tex.is_renderbuffer = false;
+ textures.push_back(tex);
+ return tex.tex_num;
+}
+
+GLuint TexturePool::get_renderbuffer(GLenum format, GLuint width, GLuint height)
+{
+ for (Texture &tex : textures) {
+ if (!tex.in_use && tex.is_renderbuffer && tex.format == format &&
+ tex.width == width && tex.height == height) {
+ tex.in_use = true;
+ return tex.tex_num;
+ }
+ }
+
+ Texture tex;
+ glCreateRenderbuffers(1, &tex.tex_num);
+ glNamedRenderbufferStorage(tex.tex_num, format, width, height);
+
+ tex.format = format;
+ tex.width = width;
+ tex.height = height;
+ tex.in_use = true;
+ tex.is_renderbuffer = true;