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);
439 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:237
const glm::uvec2 getDimensionsMinimum() const
Gets the minimum dimensions allowed for this window (in screen coordinates).
Definition window_context_manager.cpp:231
void refreshWindowProperties()
Replaces currently cached window properties.
Definition window_context_manager.cpp:177
bool hasCapturedMouse() const
Tests whether this window has captured the mouse.
Definition window_context_manager.cpp:202
Signal mSigWindowSizeChanged
Signal emitted when this window is resized.
Definition window_context_manager.hpp:380
void setFullscreen(bool fullscreen, bool exclusive=false)
Makes this window fullscreen.
Definition window_context_manager.cpp:290
void restore()
Restores this window (if it has been minimized).
Definition window_context_manager.cpp:269
Signal mSigWindowDisplayChanged
Signal emitted when the window display changes.
Definition window_context_manager.hpp:426
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:245
Assimp::Importer * getAssetImporter() const
Accessor for asset importer (which for some reason is tied to this WindowContext)
Definition window_context_manager.cpp:307
glm::u16vec2 mCachedWindowMinimumDimensions
The minimum allowed dimensions for this window, in screen coordinates.
Definition window_context_manager.hpp:497
Signal mSigWindowMouseExited
Signal emitted when the mouse leaves this window.
Definition window_context_manager.hpp:354
bool isBorderless() const
Tests whether this window is using windowed borderless fullscreen.
Definition window_context_manager.cpp:208
Signal mSigWindowShown
Signal emitted when this window is shown.
Definition window_context_manager.hpp:360
SDL_GLContext getGLContext() const
Accessor for the OpenGL context pointer.
Definition window_context_manager.cpp:299
const glm::uvec2 getDimensionsMaximum() const
Gets the maximum dimensions allowed for this window (in screen coordinates).
Definition window_context_manager.cpp:234
bool isFullscreen() const
Tests whether this window is in fullscreen.
Definition window_context_manager.cpp:211
glm::i16vec2 mCachedWindowPosition
The cached position of this window, in screen coordinates.
Definition window_context_manager.hpp:483
static void clear()
Loses reference to the singleton window context, initiating its destruction.
Definition window_context_manager.cpp:173
void maximize()
Maximizes this window.
Definition window_context_manager.cpp:261
bool isMaximized() const
Tests whether this window is maximized.
Definition window_context_manager.cpp:187
bool hasMouseFocus() const
Tests whether this window has mouse focus.
Definition window_context_manager.cpp:205
SDL_Window * mpSDLWindow
The SDL window handle this class is a wrapper over.
Definition window_context_manager.hpp:454
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:162
static WindowContext & getInstance()
Gets this application's sole window instance.
Definition window_context_manager.cpp:168
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:524
const glm::uvec2 getDimensions() const
Gets the dimensions of this window (in pixels).
Definition window_context_manager.cpp:228
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:101
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:404
Signal mSigWindowKeyFocusGained
Signal emitted when this window receives keyboard focus.
Definition window_context_manager.hpp:392
Signal mSigWindowHidden
Signal emitted when this window is hidden.
Definition window_context_manager.hpp:366
Signal mSigWindowMinimized
Signal emitted when this window is minimized.
Definition window_context_manager.hpp:336
Signal mSigWindowExposed
Signal emitted when this window is exposed.
Definition window_context_manager.hpp:372
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:470
bool isMinimized() const
Tests whether this window is minimized.
Definition window_context_manager.cpp:190
bool isExclusiveFullscreen() const
Tests whether a fullscreen window is using exclusive fullscreen.
Definition window_context_manager.cpp:214
bool hasKeyFocus() const
Tests whether this window has keyboard focus.
Definition window_context_manager.cpp:199
void swapBuffers()
Swaps the back and front buffers of the framebuffer associated with the application window.
Definition window_context_manager.cpp:97
Signal mSigWindowResized
Signal emitted when this window's dimensions are changed.
Definition window_context_manager.hpp:324
Signal mSigWindowMaximized
Signal emitted when this window is maximized.
Definition window_context_manager.hpp:330
void setTitle(const std::string &newTitle)
Sets the title for this window.
Definition window_context_manager.cpp:277
glm::u16vec2 mCachedWindowMaximumDimensions
The maximum allowed dimensions for this window, in screen coordinates.
Definition window_context_manager.hpp:505
int getDisplayID() const
Gets the ID associated with the monitor this window is primarily being displayed on.
Definition window_context_manager.cpp:222
std::string mCachedTitle
The cached title of this window.
Definition window_context_manager.hpp:517
SDL_GLContext mpGLContext
The OpenGL context associated with this window.
Definition window_context_manager.hpp:462
Signal mSigWindowKeyFocusOffered
Signal emitted when the application offers keyboard focus to the user.
Definition window_context_manager.hpp:410
SDL_WindowFlags mCachedWindowFlags
A number whose bits represent different modes a window can be in.
Definition window_context_manager.hpp:476
void setResizeAllowed(bool allowed)
Enables or disables the resizing of this window.
Definition window_context_manager.cpp:249
bool isShown() const
Tests whether this window is shown, inverse of hidden.
Definition window_context_manager.cpp:219
void setBorder(bool state)
Adds or removes the border around this window.
Definition window_context_manager.cpp:273
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:196
void setDimensionsMaximum(const glm::uvec2 &dimensions)
Sets the maximum allowable dimensions for this window, in screen coordinates.
Definition window_context_manager.cpp:257
void minimize()
Minimizes this window.
Definition window_context_manager.cpp:265
int mCachedDisplayID
The ID of the display (or monitor) this window is rendered on.
Definition window_context_manager.hpp:511
void setDimensionsMinimum(const glm::uvec2 &dimensions)
Sets the minimum allowable dimensions for this window in screen coordinates.
Definition window_context_manager.cpp:253
Signal mSigWindowKeyFocusLost
Signal emitted when this window loses keyboard focus.
Definition window_context_manager.hpp:398
SDL_Window * getSDLWindow() const
Accessor for the SDL Window pointer.
Definition window_context_manager.cpp:303
Signal mSigWindowICCProfileChanged
I don't know what this is quite honestly.
Definition window_context_manager.hpp:418
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:225
Signal mSigWindowMouseEntered
Signal emitted when the mouse has entered this window.
Definition window_context_manager.hpp:348
bool isResizable() const
Tests whether this window is resizable.
Definition window_context_manager.cpp:193
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:241
void setHidden(bool hide)
Sets this window's visibility.
Definition window_context_manager.cpp:281
glm::u16vec2 mCachedWindowDimensions
The cached dimensions of this window, in pixels.
Definition window_context_manager.hpp:489
Signal mSigWindowMoved
Signal emitted when this window is repositioned.
Definition window_context_manager.hpp:342
Signal mSigWindowRestored
Signal emitted when this window is restored (after being minimized).
Definition window_context_manager.hpp:386
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition camera_system.hpp:20
Classes relating to this engine's implementation of signals. Contains template classes used to define...