apeltsi / loitsu

Cross-platform Game Engine written in Rust
MIT License
1 stars 0 forks source link

Asset updates #28

Closed apeltsi closed 11 months ago

apeltsi commented 11 months ago

Loitsu should be capable of updating assets. This would make hot-reloading possible.

Sprites may actually be able to just create a new texture on the GPU, then increment some version number so that all drawables holding a reference to the old version can update automatically.

Note that a texture updating can also mean that the UVs (see #27) could change. This cannot be done without the drawable doing some work, which could be done when it detects a texture change and updates its own texture.

apeltsi commented 11 months ago

This is required for the direct asset management model to work

apeltsi commented 11 months ago

In some cases the asset may be None at first, until it loads (direct asset-management model). So the type should be an Arc\<Mutex\<Option\<Asset>>> or something along those lines im boutta fall asleep