OpenClonk
C4GraphicsSystem.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* Operates viewports, message board and draws the game */
19 
20 #ifndef INC_C4GraphicsSystem
21 #define INC_C4GraphicsSystem
22 
23 #include "gui/C4MessageBoard.h"
24 #include "gui/C4UpperBoard.h"
25 
27 {
28 public:
31  std::unique_ptr<C4MessageBoard> MessageBoard;
34  bool ShowHelp;
36  bool ShowAction;
41  int Show8BitSurface; // 0 normal, 1 foreground mats, 2 background mats
42  bool ShowLights;
45  void Default();
46  void Clear();
47  bool StartDrawing();
48  void FinishDrawing();
49  void Execute();
50  void FlashMessage(const char *message);
51  void FlashMessageOnOff(const char *description, bool switch_on);
52  void DeactivateDebugOutput();
53  bool Init();
54  bool InitLoaderScreen(const char *image_name);
55  void EnableLoaderDrawing(); // reset black screen loader flag
56  bool SaveScreenshotKey(bool save_all) { return SaveScreenshot(save_all, 2.0f); } // keyboard callback for creating screenshot. create at default zoom.
57  bool SaveScreenshot(bool save_all, float zoom_factor_all);
58  bool DoSaveScreenshot(bool save_all, const char *filename, float zoom_factor_all);
59  inline void InvalidateBg() { iRedrawBackground=2; }
60  inline void OverwriteBg() { InvalidateBg(); }
61 
62 private:
63  char FlashMessageText[C4MaxTitle+1];
64  int32_t FlashMessageTime;
65  int32_t FlashMessageX;
66  int32_t FlashMessageY;
67  void DrawHelp();
68  void DrawFlashMessage();
69  void DrawHoldMessages();
70  void ClearFullscreenBackground();
71 
72  C4TimeMilliseconds lastFrame;
73 
74 public:
75  bool ToggleShow8BitSurface();
76  bool ToggleShowNetStatus();
77  bool ToggleShowVertices();
78  bool ToggleShowAction();
79  bool ToggleShowHelp();
80  friend class C4FullScreen;
81 };
82 
84 #endif
const size_t C4MaxTitle
Definition: C4Constants.h:25
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51
C4UpperBoard UpperBoard
bool SaveScreenshot(bool save_all, float zoom_factor_all)
bool DoSaveScreenshot(bool save_all, const char *filename, float zoom_factor_all)
bool InitLoaderScreen(const char *image_name)
std::unique_ptr< C4MessageBoard > MessageBoard
bool SaveScreenshotKey(bool save_all)
void FlashMessage(const char *message)
C4LoaderScreen * pLoaderScreen
void FlashMessageOnOff(const char *description, bool switch_on)