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 
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 *szMessage);
51  void FlashMessageOnOff(const char *strWhat, bool fOn);
52  void DeactivateDebugOutput();
53  bool Init();
54  bool InitLoaderScreen(const char *szLoaderSpec);
55  void EnableLoaderDrawing(); // reset black screen loader flag
56  bool SaveScreenshotKey(bool fSaveAll) { return SaveScreenshot(fSaveAll, 2.0f); } // keyboard callback for creating screenshot. create at default zoom.
57  bool SaveScreenshot(bool fSaveAll, float fSaveAllZoom);
58  bool DoSaveScreenshot(bool fSaveAll, const char *szFilename, float fSaveAllZoom);
59  inline void InvalidateBg() { iRedrawBackground=2; }
60  inline void OverwriteBg() { InvalidateBg(); }
61 
62 private:
63  char FlashMessageText[C4MaxTitle+1];
64  int32_t FlashMessageTime,FlashMessageX,FlashMessageY;
65  void DrawHelp();
66  void DrawFlashMessage();
67  void DrawHoldMessages();
68  void ClearFullscreenBackground();
69 
70  C4TimeMilliseconds lastFrame;
71 
72 public:
73  bool ToggleShow8BitSurface();
74  bool ToggleShowNetStatus();
75  bool ToggleShowVertices();
76  bool ToggleShowAction();
77  bool ToggleShowHelp();
78  friend class C4FullScreen;
79 };
80 
82 #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