7#include "structure/opengl/spk_wgl_context.hpp"
8#include "structure/widget/spk_widget.hpp"
9#include "structure/win32/spk_class.hpp"
10#include "structure/win32/spk_window.hpp"
11#include "type/spk_enablement.hpp"
13#include "structure/application/module/spk_keyboard_module.hpp"
14#include "structure/application/module/spk_mouse_module.hpp"
15#include "structure/application/module/spk_paint_module.hpp"
16#include "structure/application/module/spk_system_module.hpp"
17#include "structure/application/module/spk_update_module.hpp"
19#include "utils/spk_event_utils.hpp"
65 static LRESULT CALLBACK _windowProc(HWND p_hwnd, UINT p_uMsg, WPARAM p_wParam, LPARAM p_lParam);
81 std::atomic<bool> _running{
false};
82 std::atomic<int> _exitCode{0};
83 std::atomic<bool> _quitMessagePosted{
false};
85 std::jthread _updateThread;
86 std::jthread _renderThread;
92 bool _treatEvent(HWND p_hwnd, UINT p_uMsg, WPARAM p_wParam, LPARAM p_lParam);
101 void _bindCentralWidget();
106 void _generateResizeEvent(
const spk::Extend2D &p_extend);
111 void _resize(
const spk::Extend2D &p_extend);
116 void _prepareRenderLoopThread();
120 void _renderLoopStep();
125 void _prepareUpdateLoopThread();
129 void _updateLoopStep();
134 void _prepareMainLoopThread();
138 void _mainLoopStep();
176 void quit(
int p_errorID = 0);
GraphicalApplication(const std::wstring &p_title, const spk::Extend2D &p_extend2D, const Configuration &p_configuration)
Builds an application with explicit configuration.
Definition spk_graphical_application.cpp:154
spk::Widget & centralWidget()
Accesses the central widget.
Definition spk_graphical_application.cpp:223
int run()
Starts the event, update, and render loops.
Definition spk_graphical_application.cpp:173
void quit(int p_errorID=0)
Requests application shutdown.
Definition spk_graphical_application.cpp:233
Dispatches keyboard events to a bound widget and tracks keyboard state.
Definition spk_keyboard_module.hpp:23
Dispatches mouse events to a bound widget and tracks mouse state.
Definition spk_mouse_module.hpp:23
Forwards paint events to the bound widget.
Definition spk_paint_module.hpp:17
Handles system-level events (creation, resize, quit) for the application and its widget tree.
Definition spk_system_module.hpp:18
Forwards update ticks to the bound widget.
Definition spk_update_module.hpp:17
Manages a Windows WGL OpenGL context tied to a window.
Definition spk_wgl_context.hpp:17
Registers a Win32 window class and instantiates windows from it.
Definition spk_class.hpp:24
RAII wrapper over a Win32 HWND handle created by spk::Win32::Class.
Definition spk_window.hpp:20
Runtime options affecting threading.
Definition spk_graphical_application.hpp:47
Enablement multithread
Enables or disables multithreaded loops.
Definition spk_graphical_application.hpp:51