feature/imgui-sdl
Last change
on this file since 737c26a was d8cf709, checked in by Dmitry Portnoy <dportnoy@…>, 4 years ago |
Change UIEvent to also include the original event from the UI library the game gui is currently using, such as SDL or GLFW.
|
-
Property mode
set to
100644
|
File size:
950 bytes
|
Rev | Line | |
---|
[e1f88a9] | 1 | #ifndef _SCREEN_H
|
---|
| 2 | #define _SCREEN_H
|
---|
| 3 |
|
---|
| 4 | #include <vector>
|
---|
| 5 |
|
---|
| 6 | #include <vulkan/vulkan.h>
|
---|
| 7 |
|
---|
| 8 | #include <SDL2/SDL.h>
|
---|
| 9 |
|
---|
| 10 | #include "../consts.hpp"
|
---|
| 11 | //#include "../game-gui.hpp"
|
---|
| 12 |
|
---|
| 13 | #include "ui-element.hpp"
|
---|
| 14 |
|
---|
| 15 | using namespace std;
|
---|
| 16 |
|
---|
| 17 | class VulkanGame;
|
---|
| 18 |
|
---|
| 19 | // TODO: Add a function to create an SDL_Color from a uint32_t
|
---|
| 20 |
|
---|
| 21 | // TODO: Maybe make this a subclass of UIElement
|
---|
| 22 | class Screen {
|
---|
| 23 | public:
|
---|
| 24 | Screen(SDL_Renderer& renderer, VulkanGame& gameInfo);
|
---|
| 25 | virtual ~Screen();
|
---|
| 26 |
|
---|
| 27 | virtual void createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage) = 0;
|
---|
| 28 | virtual void init();
|
---|
| 29 |
|
---|
| 30 | virtual void renderUI();
|
---|
[d8cf709] | 31 | virtual void handleEvent(GameEvent& e);
|
---|
[e1f88a9] | 32 | void addUIElement(UIElement* element);
|
---|
| 33 |
|
---|
| 34 | protected:
|
---|
| 35 | SDL_Renderer& renderer;
|
---|
| 36 | VulkanGame& gameInfo;
|
---|
| 37 |
|
---|
| 38 | private:
|
---|
| 39 | vector<UIElement*> uiElements;
|
---|
| 40 | };
|
---|
| 41 |
|
---|
| 42 | // TODO: Maybe move these somewhere else
|
---|
| 43 | void button_onMouseEnter(UIElement& element);
|
---|
| 44 | void button_onMouseLeave(UIElement& element);
|
---|
| 45 |
|
---|
| 46 | #endif // _SCREEN_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.