OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 
26 #include <memory>
27 
29 {
30 public:
33  std::unique_ptr<C4MessageBoard> MessageBoard;
36  bool ShowHelp;
38  bool ShowAction;
43  int Show8BitSurface; // 0 normal, 1 foreground mats, 2 background mats
44  bool ShowLights;
47  void Default();
48  void Clear();
49  bool StartDrawing();
50  void FinishDrawing();
51  void Execute();
52  void FlashMessage(const char *szMessage);
53  void FlashMessageOnOff(const char *strWhat, bool fOn);
54  void DeactivateDebugOutput();
55  bool Init();
56  bool InitLoaderScreen(const char *szLoaderSpec);
57  void EnableLoaderDrawing(); // reset black screen loader flag
58  bool SaveScreenshotKey(bool fSaveAll) { return SaveScreenshot(fSaveAll, 2.0f); } // keyboard callback for creating screenshot. create at default zoom.
59  bool SaveScreenshot(bool fSaveAll, float fSaveAllZoom);
60  bool DoSaveScreenshot(bool fSaveAll, const char *szFilename, float fSaveAllZoom);
61  inline void InvalidateBg() { iRedrawBackground=2; }
62  inline void OverwriteBg() { InvalidateBg(); }
63 
64 private:
65  char FlashMessageText[C4MaxTitle+1];
66  int32_t FlashMessageTime,FlashMessageX,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
bool SaveScreenshotKey(bool fSaveAll)
bool DoSaveScreenshot(bool fSaveAll, const char *szFilename, float fSaveAllZoom)
void FlashMessageOnOff(const char *strWhat, bool fOn)
C4UpperBoard UpperBoard
bool SaveScreenshot(bool fSaveAll, float fSaveAllZoom)
bool InitLoaderScreen(const char *szLoaderSpec)
C4LoaderScreen * pLoaderScreen
void FlashMessage(const char *szMessage)
std::unique_ptr< C4MessageBoard > MessageBoard