12#ifndef FOOLSENGINE_WINDOWCONTEXT_H
13#define FOOLSENGINE_WINDOWCONTEXT_H
20#include <assimp/Importer.hpp>
22#include <nlohmann/json.hpp>
104 const std::string&
getTitle()
const;
278 void setTitle(
const std::string& newTitle);
438 WindowContext(
const nlohmann::json& initialWindowConfiguration);
A signal tracker, the main interface between an object and the signal system.
Definition signals.hpp:161
A Signal object, designed to emit signals matching some data signature to be received by all the Sign...
Definition signals.hpp:323
A class providing access to various window management methods and window event Signals.
Definition window_context_manager.hpp:36
const std::string & getTitle() const
Gets the title of this window.
Definition window_context_manager.cpp:219
const glm::uvec2 getDimensionsMinimum() const
Gets the minimum dimensions allowed for this window (in screen coordinates).
Definition window_context_manager.cpp:213
void refreshWindowProperties()
Replaces currently cached window properties.
Definition window_context_manager.cpp:158
bool hasCapturedMouse() const
Tests whether this window has captured the mouse.
Definition window_context_manager.cpp:183
Signal mSigWindowSizeChanged
Signal emitted when this window is resized.
Definition window_context_manager.hpp:379
SDL_DisplayMode *const mDisplayMode
Immutable pointer to the current display mode for this window, whose data is managed by SDL.
Definition window_context_manager.hpp:482
void restore()
Restores this window (if it has been minimized).
Definition window_context_manager.cpp:251
Signal mSigWindowDisplayChanged
Signal emitted when the window display changes.
Definition window_context_manager.hpp:425
void setDimensions(const glm::uvec2 &dimensions)
Sets the width and height of the window, in pixels (since SDL_WINDOW_ALLOW_HIGHDPI ought to have been...
Definition window_context_manager.cpp:227
Assimp::Importer * getAssetImporter() const
Accessor for asset importer (which for some reason is tied to this WindowContext)
Definition window_context_manager.cpp:285
glm::u16vec2 mCachedWindowMinimumDimensions
The minimum allowed dimensions for this window, in screen coordinates.
Definition window_context_manager.hpp:503
Signal mSigWindowMouseExited
Signal emitted when the mouse leaves this window.
Definition window_context_manager.hpp:353
bool isBorderless() const
Tests whether this window is using windowed borderless fullscreen.
Definition window_context_manager.cpp:189
Signal mSigWindowShown
Signal emitted when this window is shown.
Definition window_context_manager.hpp:359
SDL_GLContext getGLContext() const
Accessor for the OpenGL context pointer.
Definition window_context_manager.cpp:277
const glm::uvec2 getDimensionsMaximum() const
Gets the maximum dimensions allowed for this window (in screen coordinates).
Definition window_context_manager.cpp:216
bool isFullscreen() const
Tests whether this window is in fullscreen.
Definition window_context_manager.cpp:192
glm::i16vec2 mCachedWindowPosition
The cached position of this window, in screen coordinates.
Definition window_context_manager.hpp:489
static void clear()
Loses reference to the singleton window context, initiating its destruction.
Definition window_context_manager.cpp:154
void maximize()
Maximizes this window.
Definition window_context_manager.cpp:243
bool isMaximized() const
Tests whether this window is maximized.
Definition window_context_manager.cpp:168
bool hasMouseFocus() const
Tests whether this window has mouse focus.
Definition window_context_manager.cpp:186
SDL_Window * mpSDLWindow
The SDL window handle this class is a wrapper over.
Definition window_context_manager.hpp:453
static WindowContext & initialize(const nlohmann::json &initialWindowConfiguration)
Initializes this window context with the settings specified in this project's project....
Definition window_context_manager.cpp:143
static WindowContext & getInstance()
Gets this application's sole window instance.
Definition window_context_manager.cpp:149
static std::unique_ptr< WindowContext > s_windowContextManager
A pointer to the single static instance of the WindowContext associated with the application.
Definition window_context_manager.hpp:530
const glm::uvec2 getDimensions() const
Gets the dimensions of this window (in pixels).
Definition window_context_manager.cpp:210
void handleWindowEvent(const SDL_WindowEvent &windowEvent)
Converts an SDL window event into its corresponding engine Signal equivalent, which it then broadcast...
Definition window_context_manager.cpp:87
Signal mSigWindowCloseRequested
Signal emitted when the user attempts to close this window (by the X button in the window border usua...
Definition window_context_manager.hpp:403
Signal mSigWindowKeyFocusGained
Signal emitted when this window receives keyboard focus.
Definition window_context_manager.hpp:391
Signal mSigWindowHidden
Signal emitted when this window is hidden.
Definition window_context_manager.hpp:365
Signal mSigWindowMinimized
Signal emitted when this window is minimized.
Definition window_context_manager.hpp:335
Signal mSigWindowExposed
Signal emitted when this window is exposed.
Definition window_context_manager.hpp:371
void setFullscreen(bool fullscreen)
Makes this window fullscreen.
Definition window_context_manager.cpp:272
SignalTracker mSignalTracker
The signal tracker responsible for publishing window related signals and tracking their observers.
Definition window_context_manager.hpp:41
Assimp::Importer * mpAssetImporter
The asset importer asset associated with this window (and therefore the whole project)
Definition window_context_manager.hpp:469
bool isMinimized() const
Tests whether this window is minimized.
Definition window_context_manager.cpp:171
bool isExclusiveFullscreen() const
Tests whether a fullscreen window is using exclusive fullscreen.
Definition window_context_manager.cpp:195
bool hasKeyFocus() const
Tests whether this window has keyboard focus.
Definition window_context_manager.cpp:180
void swapBuffers()
Swaps the back and front buffers of the framebuffer associated with the application window.
Definition window_context_manager.cpp:83
Signal mSigWindowResized
Signal emitted when this window's dimensions are changed.
Definition window_context_manager.hpp:323
Signal mSigWindowMaximized
Signal emitted when this window is maximized.
Definition window_context_manager.hpp:329
void setTitle(const std::string &newTitle)
Sets the title for this window.
Definition window_context_manager.cpp:259
glm::u16vec2 mCachedWindowMaximumDimensions
The maximum allowed dimensions for this window, in screen coordinates.
Definition window_context_manager.hpp:511
int getDisplayID() const
Gets the ID associated with the monitor this window is primarily being displayed on.
Definition window_context_manager.cpp:204
std::string mCachedTitle
The cached title of this window.
Definition window_context_manager.hpp:523
SDL_GLContext mpGLContext
The OpenGL context associated with this window.
Definition window_context_manager.hpp:461
Signal mSigWindowKeyFocusOffered
Signal emitted when the application offers keyboard focus to the user.
Definition window_context_manager.hpp:409
SDL_WindowFlags mCachedWindowFlags
A number whose bits represent different modes a window can be in.
Definition window_context_manager.hpp:475
void setResizeAllowed(bool allowed)
Enables or disables the resizing of this window.
Definition window_context_manager.cpp:231
bool isShown() const
Tests whether this window is shown, inverse of hidden.
Definition window_context_manager.cpp:201
void setBorder(bool state)
Adds or removes the border around this window.
Definition window_context_manager.cpp:255
bool isHidden() const
Tests whether this window is hidden (as in, there is another window on top of it, or it is minimized ...
Definition window_context_manager.cpp:177
void setDimensionsMaximum(const glm::uvec2 &dimensions)
Sets the maximum allowable dimensions for this window, in screen coordinates.
Definition window_context_manager.cpp:239
void minimize()
Minimizes this window.
Definition window_context_manager.cpp:247
int mCachedDisplayID
The ID of the display (or monitor) this window is rendered on.
Definition window_context_manager.hpp:517
void setDimensionsMinimum(const glm::uvec2 &dimensions)
Sets the minimum allowable dimensions for this window in screen coordinates.
Definition window_context_manager.cpp:235
Signal mSigWindowKeyFocusLost
Signal emitted when this window loses keyboard focus.
Definition window_context_manager.hpp:397
SDL_Window * getSDLWindow() const
Accessor for the SDL Window pointer.
Definition window_context_manager.cpp:281
Signal mSigWindowICCProfileChanged
I don't know what this is quite honestly.
Definition window_context_manager.hpp:417
const glm::ivec2 getPosition() const
Gets the position of this window (relative to the top left corner of the screen) in screen coordinate...
Definition window_context_manager.cpp:207
Signal mSigWindowMouseEntered
Signal emitted when the mouse has entered this window.
Definition window_context_manager.hpp:347
bool isResizable() const
Tests whether this window is resizable.
Definition window_context_manager.cpp:174
void setPosition(const glm::uvec2 &position)
Sets the position of this window relative to the top left corner of the screen, in screen coordinates...
Definition window_context_manager.cpp:223
void setHidden(bool hide)
Sets this window's visibility.
Definition window_context_manager.cpp:263
glm::u16vec2 mCachedWindowDimensions
The cached dimensions of this window, in pixels.
Definition window_context_manager.hpp:495
Signal mSigWindowMoved
Signal emitted when this window is repositioned.
Definition window_context_manager.hpp:341
Signal mSigWindowRestored
Signal emitted when this window is restored (after being minimized).
Definition window_context_manager.hpp:385
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition application.hpp:24
Classes relating to this engine's implementation of signals. Contains template classes used to define...