mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Replace all glGenTextures/glTexImage2D calls in UI code with Vulkan texture uploads via new VkContext::uploadImGuiTexture() helper. This fixes segfaults from calling OpenGL functions without a GL context (null GLEW function pointers). - Add uploadImGuiTexture() to VkContext with staging buffer upload pattern - Convert game_screen, inventory_screen, spellbook_screen, talent_screen from GLuint/GL calls to VkDescriptorSet/Vulkan uploads - Fix loading_screen clearValueCount (was 1, needs 2 or 3 for MSAA)
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "game/game_handler.hpp"
|
|
#include <imgui.h>
|
|
#include <vulkan/vulkan.h>
|
|
#include <unordered_map>
|
|
#include <string>
|
|
|
|
namespace wowee {
|
|
namespace pipeline { class AssetManager; }
|
|
|
|
namespace ui {
|
|
|
|
class TalentScreen {
|
|
public:
|
|
void render(game::GameHandler& gameHandler);
|
|
bool isOpen() const { return open; }
|
|
void toggle() { open = !open; }
|
|
void setOpen(bool o) { open = o; }
|
|
|
|
private:
|
|
void renderTalentTrees(game::GameHandler& gameHandler);
|
|
void renderTalentTree(game::GameHandler& gameHandler, uint32_t tabId);
|
|
void renderTalent(game::GameHandler& gameHandler, const game::GameHandler::TalentEntry& talent);
|
|
|
|
void loadSpellDBC(pipeline::AssetManager* assetManager);
|
|
void loadSpellIconDBC(pipeline::AssetManager* assetManager);
|
|
VkDescriptorSet getSpellIcon(uint32_t iconId, pipeline::AssetManager* assetManager);
|
|
|
|
bool open = false;
|
|
bool nKeyWasDown = false;
|
|
|
|
// DBC caches
|
|
bool spellDbcLoaded = false;
|
|
bool iconDbcLoaded = false;
|
|
std::unordered_map<uint32_t, uint32_t> spellIconIds; // spellId -> iconId
|
|
std::unordered_map<uint32_t, std::string> spellIconPaths; // iconId -> path
|
|
std::unordered_map<uint32_t, VkDescriptorSet> spellIconCache; // iconId -> texture
|
|
std::unordered_map<uint32_t, std::string> spellTooltips; // spellId -> description
|
|
};
|
|
|
|
} // namespace ui
|
|
} // namespace wowee
|