//

import { RenderResourceManager } from "./resource/RenderResourceManager.js";

/**
 * Abstracts rendering context, such as "WebGLRenderer" in THREE.js or WebGL/WebGPU
 */
export class IFrameGraphContext {

    resource_manager = new RenderResourceManager();

    constructor() {
        this.resource_manager.attach(this);
    }

    /**
     * @template T
     * @param {ResourceDescriptor<T>} descriptor
     * @returns {T}
     */
    createResource(descriptor) {
        throw new Error('Not Implemented')
    }

    /**
     *
     * @template T
     * @param {T} resource
     * @param {ResourceDescriptor<T>} descriptor
     */
    destroyResource(resource, descriptor) {
        throw new Error('Not Implemented')
    }

    destroy() {
        this.resource_manager.destroy();
    }
}
