source: opengl-game/gui/screen.hpp

feature/imgui-sdl
Last change on this file 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
Line 
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
15using namespace std;
16
17class 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
22class Screen {
23public:
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();
31 virtual void handleEvent(GameEvent& e);
32 void addUIElement(UIElement* element);
33
34protected:
35 SDL_Renderer& renderer;
36 VulkanGame& gameInfo;
37
38private:
39 vector<UIElement*> uiElements;
40};
41
42// TODO: Maybe move these somewhere else
43void button_onMouseEnter(UIElement& element);
44void button_onMouseLeave(UIElement& element);
45
46#endif // _SCREEN_H
Note: See TracBrowser for help on using the repository browser.