#ifndef GFX_PC_H #define GFX_PC_H #include #include #include #include #include #include #include #include "system.h" #define SCREEN_WIDTH ((int32_t)gfx_current_native_viewport.width) #define SCREEN_HEIGHT ((int32_t)gfx_current_native_viewport.height) extern uintptr_t gfxFramebuffer; struct GfxRenderingAPI; struct GfxWindowManagerAPI; struct TextureCacheKey { const uint8_t* texture_addr; const uint8_t* palette_addrs[2]; uint8_t fmt, siz; uint8_t palette_index; bool operator==(const TextureCacheKey&) const noexcept = default; struct Hasher { size_t operator()(const TextureCacheKey& key) const noexcept { uintptr_t addr = (uintptr_t)key.texture_addr; return (size_t)(addr ^ (addr >> 5)); } }; }; typedef std::unordered_map TextureCacheMap; typedef std::pair TextureCacheNode; struct TextureCacheValue { uint32_t texture_id; uint8_t cms, cmt; bool linear_filter; std::list::iterator lru_location; }; struct TextureCacheMapIter { TextureCacheMap::iterator it; }; extern "C" { #include "gfx_api.h" } #endif