From 58245585cbe77e6c03ebe13f29e10393ff3c45b4 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 22 Dec 2024 22:19:36 +1100 Subject: cute asset loading system --- video.hpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'video.hpp') diff --git a/video.hpp b/video.hpp index b59fd5c..786d013 100644 --- a/video.hpp +++ b/video.hpp @@ -4,6 +4,12 @@ #include #include +extern "C" { +#include "vid_enums.h" +} + +#include "asset.hpp" + struct App; struct Arena; struct Heap; @@ -139,9 +145,7 @@ struct Device { Buffer& get_buffer(Buffer_Id id); void destroy_buffer(Buffer_Id id); - Shader_Id load_shader(const char* fname); Shader& get_shader(Shader_Id id); - void destroy_shader(Shader_Id id); }; struct Context { @@ -162,7 +166,8 @@ struct Context { void submit(Device& d, const Render_Pass& rp); }; -struct Shader { +struct Shader : public Asset { + Shader_Id id; Vertex_Format_Id vf; void destroy(Device* dev); @@ -170,6 +175,13 @@ struct Shader { int binding_index(const char* name); int attribute_index(const char* name); int target_index(const char* name); + + bool load( + Asset_Loader* loader, + Arena* a, + Pack_File* f + ) override; + void unload(Asset_Loader* loader) override; }; #endif -- cgit v1.2.3-54-g00ecf