MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_io_window.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "mxvk/mxvk.hpp"
5
6#include <SDL3/SDL.h>
7#include <iosfwd>
8#include <vector>
9
10namespace mxvk {
11
12 class VK_IOWindow : public VK_Window {
13 public:
14 VK_IOWindow(const std::string &path, const std::string &title, const int width, const int height, const bool fullscreen, const bool enableVsync = false);
15 void event(SDL_Event &e) override;
16 void print(const std::string &text, SDL_Color col = {255, 255, 255, 255});
17 void proc() override;
18 virtual void console_proc() = 0;
19 virtual void console_event(SDL_Event &e) = 0;
20 void requestExit() { exit(); }
21 bool visible() const { return console.isVisible(); }
22
23 protected:
24 /**
25 * @brief Handle app-specific console commands.
26 *
27 * Called after shared commands such as `echo`/`quit`/`about`.
28 *
29 * @param args Tokenized command arguments.
30 * @param out Console output stream.
31 * @return true when the command is handled.
32 */
33 virtual bool handleConsoleCommand(const std::vector<std::string> &args, std::ostream &out);
34
35 /**
36 * @brief Append app-specific help lines to the console help output.
37 *
38 * @param out Console output stream.
39 */
40 virtual void appendConsoleHelp(std::ostream &out) const;
41
42 private:
44 };
45} // namespace mxvk
Lightweight command console renderer for mxvk::VK_Window.
virtual void appendConsoleHelp(std::ostream &out) const
Append app-specific help lines to the console help output.
virtual void console_event(SDL_Event &e)=0
virtual void console_proc()=0
virtual bool handleConsoleCommand(const std::vector< std::string > &args, std::ostream &out)
Handle app-specific console commands.
void event(SDL_Event &e) override
Handle one SDL event.
void print(const std::string &text, SDL_Color col={255, 255, 255, 255})
void proc() override
Execute one processing/update step.
VK_IOWindow(const std::string &path, const std::string &title, const int width, const int height, const bool fullscreen, const bool enableVsync=false)
void exit()
Request loop termination.
Definition mxvk.cpp:1378
VK_Window()=default
Construct an empty window object.
In-game command console for MXVK / Vulkan windows.
Utilities for loading and saving PNG images.
Definition mxvk.hpp:31