Engine → Platform → null_backend.h
null_backend
| Type | Class |
| Namespace | conjure::platform |
| Include File Path | engine/include/conjure/platform/null_backend.h |
| Source File Path | engine/src/platform/null_backend.cpp |
| API ↗ | Input, Windows and events |
Syntax
Inheritance Hierarchy
window → null_backend
Constructors
| Access | Signature | Description |
|---|---|---|
| public | explicit null_backend(
const window_desc &desc); |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~null_backend() override; |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mClipboard | std::string | {} | |
| private | m | bool | false | |
| private | m | math::vec2 | math::vec2(1.0f) | |
| private | mCursorMode | cursor_mode | cursor_ | |
| private | m | math::vec2 | math::vec2(0.0f) | |
| private | mDelivered | std::vector<event> | {} | |
| private | m | std::vector<std::string> | {} | |
| private | m | std::vector<drop_range> | {} | |
| private | mFocused | bool | true | |
| private | mFullscreen | bool | false | |
| private | m | std:: | {} | |
| private | m | std:: | {} | |
| private | mIcons | std::vector<core::image> | {} | |
| private | mLogicalSize | math::uvec2 | math::uvec2(0) | |
| private | mMinimised | bool | false | |
| private | mMonitors | std:: | {} | |
| private | mPending | std::vector<event> | {} | |
| private | m | std::vector<std::string> | {} | |
| private | m | std::vector<drop_range> | {} | |
| private | m | std:: | std::nullopt | |
| private | mPosition | math::ivec2 | math::ivec2(0) | |
| private | m | bool | false | |
| private | mShouldClose | bool | false | |
| private | mTitle | std::string | {} | |
| private | mVideoModes | std::vector<video_mode> | {} | |
| private | mVisible | bool | true | |
| private | m | math::ivec2 | math::ivec2(0) | |
| private | m | bool | true | |
| private | m | math::uvec2 | math::uvec2(0) | |
| public | VIRTUAL_ | static constexpr u32 | 1080 | |
| public | VIRTUAL_ | static constexpr u32 | 60 | |
| public | VIRTUAL_ | static constexpr u32 | 1920 |
Functions
Public
as_null
as_null[[nodiscard]] null_backend *as_null() noexcept override;backend
backend[[nodiscard]] backend_kind backend() const noexcept override;cancel_close
cancel_closevoid cancel_close() noexcept override;clipboard_text
clipboard_text[[nodiscard]] core::result<std::string> clipboard_text() const override;content_scale
content_scale[[nodiscard]] math::vec2 content_scale() const noexcept override;create
create[[nodiscard]] static std::unique_ptr<null_backend> create(
const window_desc &desc);Builds a null window from a description (what create_window does for NULL_BACKEND). The description is expected to pass validate_window_desc (asserted).
create_vulkan_surface
create_vulkan_surface[[nodiscard]] core::result<void> create_vulkan_surface(
void *instance,
void **surface) const override;current_cursor_mode
current_cursor_mode[[nodiscard]] cursor_mode current_cursor_mode() const noexcept override;cursor_position
cursor_position[[nodiscard]] math::vec2 cursor_position() const noexcept;Where set_cursor_position() last warped the cursor (logical coordinates).
framebuffer_size
framebuffer_size[[nodiscard]] math::uvec2 framebuffer_size() const noexcept override;gamepad_name
gamepad_name[[nodiscard]] std::string_view gamepad_name(
u32 index) const noexcept override;hide
hidevoid hide() override;icons
icons[[nodiscard]] std::span<const core::image> icons() const noexcept;Copies of the images the last successful set_icon() received; empty for the default icon.
is_focused
is_focused[[nodiscard]] bool is_focused() const noexcept override;is_fullscreen
is_fullscreen[[nodiscard]] bool is_fullscreen() const noexcept override;is_minimised
is_minimised[[nodiscard]] bool is_minimised() const noexcept override;is_visible
is_visible[[nodiscard]] bool is_visible() const noexcept override;monitors
monitors[[nodiscard]] std::span<const monitor_info> monitors() const noexcept override;native_handle
native_handle[[nodiscard]] native_window_handle native_handle() const noexcept override;pending_event_count
pending_event_count[[nodiscard]] usize pending_event_count() const noexcept;Events the next pump_events() will deliver, the coalesced resize included.
position
position[[nodiscard]] math::ivec2 position() const noexcept override;pump_events
pump_events[[nodiscard]] std::span<const event> pump_events() override;push_event
push_eventvoid push_event(
const event &value);Queues any event verbatim. A gamepad_connection_event also updates gamepad_name() when it is delivered.
raw_mouse_motion
raw_mouse_motion[[nodiscard]] bool raw_mouse_motion() const noexcept;The raw mouse motion flag set_raw_mouse_motion() stored.
request_close
request_closevoid request_close() noexcept override;required_vulkan_instance_extensions
required_vulkan_instance_extensions[[nodiscard]] std::span<const char *const> required_vulkan_instance_extensions() const noexcept override;set_clipboard_text
set_clipboard_text[[nodiscard]] core::result<void> set_clipboard_text(
std::string_view text) override;set_cursor_mode
set_cursor_mode[[nodiscard]] core::result<void> set_cursor_mode(
cursor_mode mode) override;set_cursor_position
set_cursor_positionvoid set_cursor_position(
math::vec2 logicalPosition) override;set_fullscreen
set_fullscreen[[nodiscard]] core::result<void> set_fullscreen(
bool fullscreen,
u32 monitorIndex = 0) override;set_icon
set_icon[[nodiscard]] core::result<void> set_icon(
std::span<const core::image> images) override;set_position
set_position[[nodiscard]] core::result<void> set_position(
math::ivec2 position) override;set_raw_mouse_motion
set_raw_mouse_motion[[nodiscard]] core::result<void> set_raw_mouse_motion(
bool enabled) override;set_size
set_sizevoid set_size(
math::uvec2 logicalSize) override;set_title
set_titlevoid set_title(
std::string_view title) override;should_close
should_close[[nodiscard]] bool should_close() const noexcept override;show
showvoid show() override;simulate_content_scale
simulate_content_scalevoid simulate_content_scale(
math::vec2 scale);Changes the content scale: queues a content_scale_changed_event and, when the framebuffer size changes with it, the coalesced framebuffer_resized_event.
simulate_drop_files
simulate_drop_filesvoid simulate_drop_files(
std::span<const std::string> paths);Copies the paths and queues one drop_files_event spanning them; the span is valid until the pump after the one that delivered it.
simulate_focus
simulate_focusvoid simulate_focus(
bool focused);Changes the focus state and queues a focus_event.
simulate_minimise
simulate_minimisevoid simulate_minimise(
bool minimised);Changes the minimised state and queues a minimise_event; the framebuffer becomes 0 x 0 while minimised (delivered as a coalesced resize) and comes back on restore.
simulate_monitor_scale
simulate_monitor_scalevoid simulate_monitor_scale(
math::vec2 scale);Changes the virtual monitor's OS UI scale (monitor_info::contentScale) alone: the window's content_scale() and framebuffer stay as they are, as on a Windows or X11 monitor set to 150 %, whose framebuffer is as large as the window. No event is queued (a real Windows window raises none either).
simulate_resize
simulate_resizeChanges the logical size; the next pump ends with one framebuffer_resized_event carrying round(size * content_scale) in pixels, however many resizes were simulated.
title
title[[nodiscard]] std::string_view title() const noexcept override;video_modes
video_modes[[nodiscard]] std::span<const video_mode> video_modes(
u32 monitorIndex) const noexcept override;window_size
window_size[[nodiscard]] math::uvec2 window_size() const noexcept override;Private
centred_position
centred_position[[nodiscard]] math::ivec2 centred_position() const noexcept;compute_framebuffer_size
compute_framebuffer_size[[nodiscard]] math::uvec2 compute_framebuffer_size() const noexcept;queue_resize
queue_resizevoid queue_resize() noexcept;