[e1f88a9] | 1 | #include "main-screen.hpp"
|
---|
| 2 |
|
---|
| 3 | #include "../vulkan-game.hpp"
|
---|
| 4 |
|
---|
| 5 | #include "button.hpp"
|
---|
| 6 |
|
---|
| 7 | MainScreen::MainScreen(SDL_Renderer& renderer, VulkanGame& gameInfo) :
|
---|
| 8 | Screen(renderer, gameInfo) {
|
---|
| 9 | addUIElement(new Button("New Game", 368, 131, 9, 0x222299FF, 0xFFFFFFFF, this->gameInfo,
|
---|
| 10 | this->renderer, newGame_onMouseClick, nullptr, nullptr));
|
---|
| 11 | addUIElement(new Button("Quit", 382, 186, 9, 0x222299FF, 0xFFFFFFFF, this->gameInfo,
|
---|
| 12 | this->renderer, quit_onMouseClick, nullptr, nullptr));
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | MainScreen::~MainScreen() {
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | void MainScreen::createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage) {
|
---|
| 19 | // Always render this pipeline last
|
---|
| 20 | gameInfo.overlayPipeline.createRenderCommands(commandBuffer, currentImage);
|
---|
| 21 | }
|
---|
| 22 |
|
---|
[d8cf709] | 23 | void MainScreen::handleEvent(GameEvent& e) {
|
---|
[e1f88a9] | 24 | Screen::handleEvent(e);
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | void newGame_onMouseClick(VulkanGame& gameInfo) {
|
---|
| 28 | gameInfo.goToScreen(gameInfo.screens[SCREEN_GAME]);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | void quit_onMouseClick(VulkanGame& gameInfo) {
|
---|
| 32 | gameInfo.quitGame();
|
---|
| 33 | }
|
---|