diff --git a/app/src/main/KDE.xcodeproj/project.xcworkspace/xcuserdata/ronjaenseleit.xcuserdatad/UserInterfaceState.xcuserstate b/app/src/main/KDE.xcodeproj/project.xcworkspace/xcuserdata/ronjaenseleit.xcuserdatad/UserInterfaceState.xcuserstate index 7352f0a..ca01725 100644 Binary files a/app/src/main/KDE.xcodeproj/project.xcworkspace/xcuserdata/ronjaenseleit.xcuserdatad/UserInterfaceState.xcuserstate and b/app/src/main/KDE.xcodeproj/project.xcworkspace/xcuserdata/ronjaenseleit.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/app/src/main/cpp/AssetManager.cpp b/app/src/main/cpp/AssetManager.cpp index 0f4af65..c579009 100644 --- a/app/src/main/cpp/AssetManager.cpp +++ b/app/src/main/cpp/AssetManager.cpp @@ -1,6 +1,8 @@ #include "AssetManager.h" #include "Log.h" #include "Profiling.h" +#include "StringRepository.h" + #define STBI_NO_STDIO #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" @@ -135,7 +137,7 @@ bool AssetManager::loadFontBitmap(const char* path, float char_height, Texture* stbtt_PackFontRange(&context, reinterpret_cast(ttf_data.data), 0, STBTT_POINT_SIZE(char_height), 8364, 1, char_data + 225); stbtt_PackEnd(&context); - *p_texture = Texture(font_data.bitmap_size, font_data.bitmap_size, bitmap_memory, GL_R8); + *p_texture = Texture(font_data.bitmap_size, font_data.bitmap_size, bitmap_memory, 0); releaseFileBuffer(ttf_data); free(bitmap_memory); diff --git a/app/src/main/cpp/AssetManager.h b/app/src/main/cpp/AssetManager.h index a7ccd3f..731ff0d 100644 --- a/app/src/main/cpp/AssetManager.h +++ b/app/src/main/cpp/AssetManager.h @@ -5,8 +5,8 @@ /// @brief Access to asset files #include "Texture.h" -#include "Renderer.h" #include "Font.h" +#include "StringRepository.h" #include diff --git a/app/src/main/cpp/Font.h b/app/src/main/cpp/Font.h index 0b51595..64a922e 100644 --- a/app/src/main/cpp/Font.h +++ b/app/src/main/cpp/Font.h @@ -3,12 +3,7 @@ #include "stb_truetype.h" -#ifdef _WIN32 - #include "glad.h" -#else - #include -#endif - +#include /// Data that defines a font struct FontData diff --git a/app/src/main/cpp/StringRepository.cpp b/app/src/main/cpp/StringRepository.cpp index 7fc89c1..ec9a6dc 100644 --- a/app/src/main/cpp/StringRepository.cpp +++ b/app/src/main/cpp/StringRepository.cpp @@ -2,6 +2,7 @@ #include "Profiling.h" #include #include +#include static StringRepository g_global_repository; StringRepository* StringRepository::global = &g_global_repository; diff --git a/app/src/main/cpp/Texture.cpp b/app/src/main/cpp/Texture.cpp index 0e15273..970e5c1 100644 --- a/app/src/main/cpp/Texture.cpp +++ b/app/src/main/cpp/Texture.cpp @@ -1,6 +1,9 @@ #include "Texture.h" #include "Profiling.h" +#if defined(__ANDROID__) || defined(_WIN32) +Texture::Texture() : m_texture(0) {} + Texture::Texture(unsigned int width, unsigned int height, const void* data) : m_texture(0) { ZoneScoped; @@ -75,4 +78,30 @@ void Texture::getTextureSize(unsigned int* w, unsigned int* h) if (h != nullptr) { *h = height_px; } -} \ No newline at end of file +} + +#else + +Texture::Texture() {} + +Texture::Texture(unsigned int width, unsigned int height, const void* data) +{ +} + +Texture::Texture(unsigned int width, unsigned int height, const void* data, int dummy) +{ +} + +void Texture::destroy() +{ +} + +void Texture::bind() const +{ +} + +void Texture::getTextureSize(unsigned int* w, unsigned int* h) +{ +} + +#endif diff --git a/app/src/main/cpp/Texture.h b/app/src/main/cpp/Texture.h index 2e02886..5b74cf8 100644 --- a/app/src/main/cpp/Texture.h +++ b/app/src/main/cpp/Texture.h @@ -6,7 +6,7 @@ #ifdef _WIN32 #include "glad.h" -#else +#elif defined(__ANDROID__) #include #endif @@ -16,9 +16,9 @@ class Renderer; class Texture { public: - Texture() : m_texture(0) {} + Texture(); Texture(unsigned int width, unsigned int height, const void* data); - Texture(unsigned int width, unsigned int height, const void* data, GLint format); + Texture(unsigned int width, unsigned int height, const void* data, int format); Texture(const Texture&) = default; Texture(Texture&&) = default; @@ -38,7 +38,9 @@ public: unsigned int* h); private: +#if defined(_WIN32) || defined(__ANDROID__) GLuint m_texture; +#endif int width_px; int height_px;