engine3d-dev / engine3d

Open-source game engine to be used for developing games
Apache License 2.0
1 stars 3 forks source link

Asset Hot Reloading #1

Open SpinnerX opened 4 months ago

SpinnerX commented 4 months ago

When developing the UI Editor, we need to have some way of loading the assets from the editor's runtime. Still open for discussions.

Quick Examples

These are examples of how I can see the API would look as we look further into our asset system.

// Option #1 - Loading in a texture by supplying it a handler that knows where we want to load this texture from and where.
Ref<Texture2D> texture = AssetManager::Get<Texture2D>(handler);
if(texture.IsLoaded()){
       Render(texture);
}

// Option #2 - having asset also represent our objects textures/shaders, uniforms, and other properties
AssetObject asset = Asset::Load("assets/backpack.obj");

if(asset.IsLoaded()){
     Render(asset);
}