summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/video.hpp b/video.hpp
index b59fd5c..786d013 100644
--- a/video.hpp
+++ b/video.hpp
@@ -4,6 +4,12 @@
#include <stddef.h>
#include <stdint.h>
+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