| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) 1998-2000, Matthes Bender (RedWolf Design) |
| 5 | * Copyright (c) 2017-2020, The LegacyClonk Team and contributors |
| 6 | * |
| 7 | * Distributed under the terms of the ISC license; see accompanying file |
| 8 | * "COPYING" for details. |
| 9 | * |
| 10 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 11 | * See accompanying file "TRADEMARK" for details. |
| 12 | * |
| 13 | * To redistribute this file separately, substitute the full license texts |
| 14 | * for the above references. |
| 15 | */ |
| 16 | |
| 17 | /* Main class to execute the game fullscreen mode */ |
| 18 | |
| 19 | #pragma once |
| 20 | |
| 21 | #include "C4MainMenu.h" |
| 22 | #include <StdWindow.h> |
| 23 | |
| 24 | #include "C4Game.h" |
| 25 | |
| 26 | class C4FullScreen : public CStdWindow |
| 27 | { |
| 28 | public: |
| 29 | C4MainMenu *; |
| 30 | |
| 31 | public: |
| 32 | C4FullScreen(); |
| 33 | ~C4FullScreen(); |
| 34 | void Execute(); |
| 35 | bool ViewportCheck(); |
| 36 | void Sec1Timer() override { Game.Sec1Timer(); Application.DoSec1Timers(); } |
| 37 | bool ShowAbortDlg(); // show game abort dialog (Escape pressed) |
| 38 | bool ActivateMenuMain(); |
| 39 | void (); |
| 40 | bool (uint8_t byCom); // direct keyboard callback |
| 41 | // User requests close |
| 42 | virtual void Close() override; |
| 43 | virtual void CharIn(const char *c) override; |
| 44 | bool Init(CStdApp *app); |
| 45 | #ifdef USE_X11 |
| 46 | bool HideCursor() const override { return true; } |
| 47 | virtual void HandleMessage(XEvent &e) override; |
| 48 | #elif USE_SDL_MAINLOOP |
| 49 | virtual void HandleMessage(SDL_Event &e) override; |
| 50 | #elif defined(_WIN32) |
| 51 | bool Init(CStdApp *app, const char *title, const class C4Rect &bounds = CStdWindow::DefaultBounds, CStdWindow *parent = nullptr) override; |
| 52 | void Clear() override; |
| 53 | void SetSize(unsigned int cx, unsigned int cy) override; |
| 54 | HWND GetRenderWindow() const override { return hRenderWindow; } |
| 55 | |
| 56 | protected: |
| 57 | WNDCLASSEX GetWindowClass(HINSTANCE instance) const override; |
| 58 | |
| 59 | private: |
| 60 | HWND hRenderWindow{nullptr}; |
| 61 | #endif |
| 62 | |
| 63 | private: |
| 64 | }; |
| 65 | |
| 66 | extern C4FullScreen FullScreen; |
| 67 | |