TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_application_window.hpp
1 
9 #ifndef TurtleBrains_ApplicationWindow_hpp
10 #define TurtleBrains_ApplicationWindow_hpp
11 
12 #include <turtle_brains/core/tb_types.hpp>
13 
14 namespace TurtleBrains
15 {
16  namespace Application
17  {
18 
19  enum class WindowMode
20  {
21  Windowed,
22  FullScreen,
23  ExclusiveFullScreen,
24  };
25 
30  {
31  // Note: 2022-09-20 it was discovered that windowWidth and windowHeight are being used in a variety of manners,
32  // somewhere along the way assumptions were made that the width/height was ALWAYS to be the exact dimensions
33  // the game requested, so a window border/title bar would be excluded; the comment below indicates otherwise
34  // which explains some issues I had with TrackBuilder trying to remember the application size.
35  //
36  // Because the WindowPosition X and Y have no effect on game code, the position X and Y below are defined
37  // as the top/left edges of the actual window based on the operating system and have nothing to do with
38  // the client area or game/screen dimensions.
39  //
40  // TODO: TurtleBrains: Cleanup: Decide what WindowWidth / WindowHeight actually refers to.
45  WindowMode mWindowMode;
47 
52 
53  WindowProperties(const WindowMode& windowMode);
54 
55  };
56 
57  //The following is not actually for public use and is subject to change without warning.
58  //This was added for detecting when to set the window to center of primary monitor.
59  constexpr tbCore::int16 InvalidWindowPosition(void) { return tbCore::int16(~0); }
60 
61  }; /* namespace Application */
62 }; /* namespace TurtleBrains */
63 
65 
66 #endif /* TurtleBrains_ApplicationWindow_hpp */
Contains classes, functions and constants to create Applications, Menus, Dialogs with native controls...
Definition: tb_application_dialog.hpp:24
std::int16_t int16
Signed integer with a size of 16 bits. Supports values from -32768 to 32767.
Definition: tb_types.hpp:24
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp:22
Definition: tb_application_window.hpp:30
tbCore::int16 mWindowPositionY
The position of the top edge of the window in pixels.
Definition: tb_application_window.hpp:44
WindowMode mWindowMode
True if the game/application should take over the entire screen. (Not fully supported yet)
Definition: tb_application_window.hpp:45
tbCore::int16 mWindowPositionX
The position of the left edge of the window in pixels.
Definition: tb_application_window.hpp:43
bool mVerticalSync
True if the rendering should be synchronized with the monitors refresh rate.
Definition: tb_application_window.hpp:46
tbCore::int16 mWindowHeight
The height of the window rectangle in pixels. The actual height may be larger to account for the wind...
Definition: tb_application_window.hpp:42
tbCore::int16 mWindowWidth
The width of the window rectangle in pixels. The actual width may be larger to account for the window...
Definition: tb_application_window.hpp:41