IScreen implementation for the first landing menu.
More...
#include <TitleScreen.hpp>
|
| bool | init (AppContext &ctx) |
| | Bind renderer and window; must be called before iterate().
|
| SDL_AppResult | event (SDL_Event *event) override |
| | Handle an incoming SDL event.
|
| SDL_AppResult | iterate () override |
| | Update the screen state and render the next frame.
|
| void | quit () override |
| | Perform any necessary cleanup before the screen is destroyed.
|
| bool | consumePlayRequest () |
| | True if the user requested opening the main menu/join screen, then clear that request.
|
| bool | consumeHostRequest () |
| | True if the user requested opening the host configuration screen, then clear that request.
|
| bool | consumeSettingsRequest () |
| | True if the user requested opening the settings screen, then clear that request.
|
| bool | consumeExitRequest () |
| | True if the user requested closing the application, then clear that request.
|
| virtual | ~IScreen ()=default |
| virtual void | shutdownAfterRenderer () |
| | Perform cleanup that must happen after the App-owned renderer shuts down.
|
IScreen implementation for the first landing menu.
◆ consumeExitRequest()
| bool TitleScreen::consumeExitRequest |
( |
| ) |
|
True if the user requested closing the application, then clear that request.
◆ consumeHostRequest()
| bool TitleScreen::consumeHostRequest |
( |
| ) |
|
True if the user requested opening the host configuration screen, then clear that request.
◆ consumePlayRequest()
| bool TitleScreen::consumePlayRequest |
( |
| ) |
|
True if the user requested opening the main menu/join screen, then clear that request.
◆ consumeSettingsRequest()
| bool TitleScreen::consumeSettingsRequest |
( |
| ) |
|
True if the user requested opening the settings screen, then clear that request.
◆ event()
| SDL_AppResult TitleScreen::event |
( |
SDL_Event * | event | ) |
|
|
overridevirtual |
Handle an incoming SDL event.
- Parameters
-
| event | The SDL event to process. |
- Returns
- SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.
Implements IScreen.
◆ init()
Bind renderer and window; must be called before iterate().
- Returns
- False if either pointer is null.
◆ iterate()
| SDL_AppResult TitleScreen::iterate |
( |
| ) |
|
|
overridevirtual |
Update the screen state and render the next frame.
- Returns
- SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.
Implements IScreen.
◆ quit()
| void TitleScreen::quit |
( |
| ) |
|
|
overridevirtual |
Perform any necessary cleanup before the screen is destroyed.
Implements IScreen.
◆ pendingExit
| bool TitleScreen::pendingExit = false |
|
private |
Set when the user clicks "Exit", cleared by App.
◆ pendingHost
| bool TitleScreen::pendingHost = false |
|
private |
Set when the user clicks "Host", cleared by App.
◆ pendingPlay
| bool TitleScreen::pendingPlay = false |
|
private |
Set when the user clicks "Play", cleared by App.
◆ pendingSettings
| bool TitleScreen::pendingSettings = false |
|
private |
Set when the user clicks "Settings", cleared by App.
◆ renderer
◆ window
| SDL_Window* TitleScreen::window = nullptr |
|
private |
Application window; not owned.
The documentation for this class was generated from the following files: