summaryrefslogtreecommitdiff
path: root/src/font.hpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-01-31 19:31:10 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-01-31 19:31:10 -0500
commit47d3d48ad76d6a4e40da1d945cbc8940ae2922c7 (patch)
tree233963233206323b11e440394d61d97ee68b34f3 /src/font.hpp
parent61cb835291af07cfc59c123241c3641a2fba185f (diff)
pke: first-pass font serialization
Diffstat (limited to 'src/font.hpp')
-rw-r--r--src/font.hpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/font.hpp b/src/font.hpp
index 48a7b40..494c365 100644
--- a/src/font.hpp
+++ b/src/font.hpp
@@ -6,6 +6,8 @@
#include "pk.h"
#include <glm/vec4.hpp>
+#include <ostream>
+#include <istream>
/*
Vert: (two triangles)
@@ -36,8 +38,8 @@ struct FontRender {
};
struct FontType : public Entity_Base {
pk_cstr title;
- AssetHandle fontTextureAssetKey;
- AssetHandle glyphDetailsAssetKey;
+ AssetHandle fontTextureAssetHandle;
+ AssetHandle glyphDetailsAssetHandle;
VkDeviceMemory deviceMemoryVert = VK_NULL_HANDLE;
VkDeviceMemory deviceMemoryTexture = VK_NULL_HANDLE;
VkDeviceMemory deviceMemoryInst = VK_NULL_HANDLE;
@@ -60,13 +62,12 @@ struct FontType : public Entity_Base {
} bindings;
};
-
void FontType_Init();
void FontType_Teardown();
-// void FontType_Serialize(FontType *ft); // TODO
-// void FontType_Deserialize(FontType **ft); // TODO
+void FontType_Serialize(std::ofstream &stream, FontType *ft);
+void FontType_Deserialize(std::ifstream &stream);
FontType* FontType_GetFonts(FontTypeIndex &count);
-FontTypeIndex FontType_RegisterFont(pk_cstr title, AssetKey fontTexture, AssetKey glyphs);
+FontTypeIndex FontType_RegisterFont(pk_cstr title, AssetHandle fontTexture, AssetHandle glyphs);
void FontType_Unload(FontTypeIndex idx);
FontRender FontType_AddStringRender(FontTypeIndex idx_ft, pk_cstr cstr);
void FontType_RemoveStringRender(FontRender fr);