+void Texture::generate_id()
+{
+ if(id)
+ throw invalid_operation("Texture::generate_id");
+ if(ARB_direct_state_access)
+ glCreateTextures(target, 1, &id);
+ else
+ glGenTextures(1, &id);
+
+#ifdef DEBUG
+ if(!debug_name.empty() && KHR_debug)
+ glObjectLabel(GL_TEXTURE, id, debug_name.size(), debug_name.c_str());
+#endif
+}
+