MXVK Vulkan Framework 0.24.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 bool visible() const { return console.isVisible(); }
21
22 protected:
23 /**
24 * @brief Handle app-specific console commands.
25 *
26 * Called after shared commands such as `echo`/`quit`/`about`.
27 *
28 * @param args Tokenized command arguments.
29 * @param out Console output stream.
30 * @return true when the command is handled.
31 */
32 virtual bool handleConsoleCommand(const std::vector<std::string> &args, std::ostream &out);
33
34 /**
35 * @brief Append app-specific help lines to the console help output.
36 *
37 * @param out Console output stream.
38 */
39 virtual void appendConsoleHelp(std::ostream &out) const;
40
41 private:
43 };
44} // 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)
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:30