Currently, GpuTexture2DHandle is defined as:
pub struct GpuTexture2DHandle(Option<GpuTexture>);
impl GpuTexture2DHandle {
pub fn invalid() -> Self {
Self(None)
}
}
GpuTexture2DHandle::invalid is almost never used (and its one use can be easily refactored away), but it causes a lot of headache. In particular, TextureManager2D::get can fail, because of this invalid state.
In other words, I'd like to get rid of GpuTexture2DHandle and just use GpuTexture everywhere.
Currently,
GpuTexture2DHandleis defined as:GpuTexture2DHandle::invalidis almost never used (and its one use can be easily refactored away), but it causes a lot of headache. In particular,TextureManager2D::getcan fail, because of this invalid state.In other words, I'd like to get rid of
GpuTexture2DHandleand just useGpuTextureeverywhere.