using Ghost.Core;
using Ghost.Graphics.Data;
namespace Ghost.Graphics.RHI;
public interface IResourceDatabase
{
///
/// Get the raw gpu resource pointer from a resource handle
///
/// The type of the resource.
/// Resource handle
/// Pointer to the resource
public unsafe T* GetResource(ResourceHandle handle)
where T: unmanaged;
///
/// Retrieves the current state of the specified resource.
///
/// The handle that uniquely identifies the resource whose state is to be retrieved. Must not be null.
/// A ResourceState value representing the current state of the resource associated with the specified handle.
public ResourceState GetResourceState(ResourceHandle handle);
///
/// Sets the state of the specified resource handle to the given value.
///
/// The handle that identifies the resource whose state will be updated. Cannot be null.
/// The new state to assign to the resource represented by .
public void SetResourceState(ResourceHandle handle, ResourceState state);
///
/// Removes a resource from the database using its handle.
///
/// The handle of the resource to be removed.
public void RemoveResource(ResourceHandle handle);
public Identifier AddMesh(ref readonly Mesh mesh);
public bool HasMesh(Identifier id);
public Mesh GetMesh(Identifier id);
public ref Mesh GetMeshReference(Identifier id);
public void RemoveMesh(Identifier id);
public Identifier AddShader(ref readonly Shader shader);
public bool HasShader(Identifier id);
public Shader GetShader(Identifier id);
public ref Shader GetShaderReference(Identifier id);
public void RemoveShader(Identifier id);
}