Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::GraphicalApplication Class Reference

High-level application wrapper that creates the main window, OpenGL context, and orchestrates update/render loops. More...

#include <spk_graphical_application.hpp>

Collaboration diagram for spk::GraphicalApplication:
Collaboration graph

Classes

struct  Configuration
 Runtime options affecting threading. More...

Public Member Functions

 GraphicalApplication (const std::wstring &p_title, const spk::Extend2D &p_extend2D, const Configuration &p_configuration)
 Builds an application with explicit configuration.
 GraphicalApplication (const std::wstring &p_title, const spk::Extend2D &p_extend2D)
 Builds an application with default configuration.
int run ()
 Starts the event, update, and render loops.
spk::WidgetcentralWidget ()
 Accesses the central widget.
const spk::WidgetcentralWidget () const
 Accesses the central widget.
void quit (int p_errorID=0)
 Requests application shutdown.

Friends

class Module::SystemModule

Detailed Description

High-level application wrapper that creates the main window, OpenGL context, and orchestrates update/render loops.

See also
Module::SystemModule, Module::UpdateModule, Module::PaintModule
spk::GraphicalApplication app(L"My App", {800, 600});
app.centralWidget().setExtend({800, 600});
return app.run();
High-level application wrapper that creates the main window, OpenGL context, and orchestrates update/...
Definition spk_graphical_application.hpp:40
spk::Widget & centralWidget()
Accesses the central widget.
Definition spk_graphical_application.cpp:223

Constructor & Destructor Documentation

◆ GraphicalApplication() [1/2]

spk::GraphicalApplication::GraphicalApplication ( const std::wstring & p_title,
const spk::Extend2D & p_extend2D,
const Configuration & p_configuration )

Builds an application with explicit configuration.

Parameters
p_titleWindow title.
p_extend2DInitial window size.
p_configurationConfiguration flags.
Here is the caller graph for this function:

◆ GraphicalApplication() [2/2]

spk::GraphicalApplication::GraphicalApplication ( const std::wstring & p_title,
const spk::Extend2D & p_extend2D )

Builds an application with default configuration.

Parameters
p_titleWindow title.
p_extend2DInitial window size.
Here is the call graph for this function:

Member Function Documentation

◆ centralWidget() [1/2]

spk::Widget & spk::GraphicalApplication::centralWidget ( )

Accesses the central widget.

Returns
Mutable reference to the root widget.

◆ centralWidget() [2/2]

const spk::Widget & spk::GraphicalApplication::centralWidget ( ) const

Accesses the central widget.

Returns
Const reference to the root widget.

◆ quit()

void spk::GraphicalApplication::quit ( int p_errorID = 0)

Requests application shutdown.

Parameters
p_errorIDExit code (default 0).
Here is the caller graph for this function:

◆ run()

int spk::GraphicalApplication::run ( )

Starts the event, update, and render loops.

Returns
Exit code provided to quit.

The documentation for this class was generated from the following files: