|
Rehti MMORPG
1.0.0
Rehti MMORPG is a free and open source MMORPG game.
|
Class that manages the GUI window. More...
#include <RehtiGui.hpp>

Public Member Functions | |
| RehtiGui (VkInstance instance, VkPhysicalDevice gpu, VkDevice logDevice, GLFWwindow *pWindow, VkQueue graphicsQueue, VkDescriptorPool descPool, uint32_t imageCount, VkRenderPass renderPass, std::shared_ptr< GraphicsObjectManager > pGfxManager) | |
| ~RehtiGui () | |
| void | uploadFonts (VkCommandBuffer cmdBuffer) |
| void | uploadEnded () |
| void | newFrame () |
| void | recordGuiData (VkCommandBuffer cmdBuff) |
| Records ui primitives into the given command buffer. More... | |
| void | startRender () |
| Starts rendering ui primitives. Must be called at the top of draw function. More... | |
| void | addInventoryItemClickCallback (std::function< void(const int id)> callback) |
| Adds callback function for clicking an item in inventory. More... | |
| void | addDropItemCallback (std::function< void(const int id)> callback) |
| Adds callback function for dropping an item in inventory. More... | |
| void | addEquipmentItemClickCallback (std::function< void(const int id)> callback) |
| Adds callback function for clicking and item in equipment. More... | |
| void | setInventory (std::vector< GameItem > inventory) |
| Set contents of player's inventory. More... | |
| std::vector< GameItem > & | getEquipment () |
| Get reference to the player's equipment vector. More... | |
| void | setEquipment (std::vector< GameItem > equipment) |
| Set contents of player's equipment. More... | |
| void | setSkills (std::vector< Skill > skills) |
| Set skills of player. More... | |
| void | setHp (int hp) |
| Set hp of player. More... | |
| bool | LoadTextureFromFile (const char *filename, const int id) |
| Load texture from file and save it to member map guiIconsM with key id. More... | |
| bool | LoadTextureFromImageData (const int id, ImageData &imgData) |
| Load texture from ImageData and save it to member map guiIconsM with key id. More... | |
Private Member Functions | |
| void | drawInventory () |
| Draws inventory tab to GUI window. More... | |
| void | drawEquipment () |
| Draws equipment tab to GUI window. More... | |
| void | drawSkills () |
| Draws skills tab to GUI window. More... | |
| void | drawEquipmentSlot (int index) |
| Helper function for a single equipment slot. More... | |
Private Attributes | |
| VkDevice | logDeviceM |
| VkDescriptorPool | descPoolM |
| VkQueue | graphicsQueueM |
| VkSampler | samplerM |
| std::shared_ptr< GraphicsObjectManager > | pGraphicsObjectManagerM |
| UiTab | openTabM |
| std::function< void(const int id)> | inventoryItemClickCallbackM |
| std::function< void(const int id)> | dropItemCallbackM |
| std::function< void(const int id)> | equipmentItemClickCallbackM |
| std::vector< GameItem > | inventoryM |
| std::vector< GameItem > | equipmentM |
| std::vector< Skill > | skillsM |
| int | hpM |
| std::mutex | invMutexM |
| std::mutex | equipmentMutexM |
| std::mutex | skillsMutexM |
| int | windowWidthM = 300 |
| int | windowHeightM = 500 |
| ImVec2 | iconSizeM = ImVec2(windowWidthM * 0.8 / 4, windowWidthM * 0.8 / 4) |
| AssetCache & | assetCacheM |
| std::unordered_map< int, VkDescriptorSet > | guiIconsM |
Class that manages the GUI window.
| RehtiGui::RehtiGui | ( | VkInstance | instance, |
| VkPhysicalDevice | gpu, | ||
| VkDevice | logDevice, | ||
| GLFWwindow * | pWindow, | ||
| VkQueue | graphicsQueue, | ||
| VkDescriptorPool | descPool, | ||
| uint32_t | imageCount, | ||
| VkRenderPass | renderPass, | ||
| std::shared_ptr< GraphicsObjectManager > | pGfxManager | ||
| ) |

| RehtiGui::~RehtiGui | ( | ) |
| void RehtiGui::addDropItemCallback | ( | std::function< void(const int id)> | callback | ) |
Adds callback function for dropping an item in inventory.
| callback |
| void RehtiGui::addEquipmentItemClickCallback | ( | std::function< void(const int id)> | callback | ) |
Adds callback function for clicking and item in equipment.
| callback |
| void RehtiGui::addInventoryItemClickCallback | ( | std::function< void(const int id)> | callback | ) |
Adds callback function for clicking an item in inventory.
| callback |
|
private |
Draws equipment tab to GUI window.


|
private |
Helper function for a single equipment slot.
| index |

|
private |
Draws inventory tab to GUI window.

|
private |
Draws skills tab to GUI window.

| std::vector< GameItem > & RehtiGui::getEquipment | ( | ) |
Get reference to the player's equipment vector.
| bool RehtiGui::LoadTextureFromFile | ( | const char * | filename, |
| const int | id | ||
| ) |
Load texture from file and save it to member map guiIconsM with key id.
| filename | |
| id |

| bool RehtiGui::LoadTextureFromImageData | ( | const int | id, |
| ImageData & | imgData | ||
| ) |
Load texture from ImageData and save it to member map guiIconsM with key id.
| id | |
| imgData |

| void RehtiGui::newFrame | ( | ) |

| void RehtiGui::recordGuiData | ( | VkCommandBuffer | cmdBuff | ) |
Records ui primitives into the given command buffer.
| cmdBuff |
| void RehtiGui::setEquipment | ( | std::vector< GameItem > | equipment | ) |
Set contents of player's equipment.
| equipment |
| void RehtiGui::setHp | ( | int | hp | ) |
Set hp of player.
| hp |
| void RehtiGui::setInventory | ( | std::vector< GameItem > | inventory | ) |
Set contents of player's inventory.
| inventory |
| void RehtiGui::setSkills | ( | std::vector< Skill > | skills | ) |
Set skills of player.
| skills |
| void RehtiGui::startRender | ( | ) |
Starts rendering ui primitives. Must be called at the top of draw function.
| void RehtiGui::uploadEnded | ( | ) |
| void RehtiGui::uploadFonts | ( | VkCommandBuffer | cmdBuffer | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |