|
evan 2026.1.4
Evan
|
Linux desktop platform implementation. More...
#include <headers/evan/glfw/platform/LinuxDesktopPlatform.hpp>


Public Member Functions | |
| LinuxDesktopPlatform (const std::string &name, const uint32_t width, const uint32_t height) | |
| Constructor for LinuxDesktopPlatform. | |
| ~LinuxDesktopPlatform ()=default | |
| Destructor for LinuxDesktopPlatform. This destructor ensures proper cleanup of resources associated with the Linux desktop platform, such as destroying the Vulkan surface and any other resources that were created during initialization. | |
| std::vector< std::string > | getRequiredInstanceExtensions () const override |
| Get the required instance extensions for the Linux desktop platform. | |
| VkSurfaceKHR | createSurface (VkInstance instance) const override |
| Create a Vulkan surface for the Linux desktop platform. | |
Public Member Functions inherited from evan::IDesktopPlatform | |
| ~IDesktopPlatform () override | |
| Destructor for DesktopPlatform. | |
| bool | shouldClose () const override |
| Check if the Desktop platform should close. | |
| virtual std::vector< std::shared_ptr< utility::event::Event > > | pollEvents (ADeviceBackend &deviceBackend) override |
| Poll events for the Desktop platform. | |
| std::shared_ptr< ADeviceBackend > | createDeviceBackend () const override |
| Create a device context for the Desktop platform. | |
| std::shared_ptr< ASwapchainContext > | createSwapchainContext (const DeviceContext &deviceContext) const override |
| Create a swapchain context for the Desktop platform. | |
| utility::event::KeyboardEvent::KeyCode | convertGlfwKeyToKeyCode (int glfwKey) const |
| Convert a GLFW key code to a KeyboardEvent::KeyCode. | |
| utility::event::MouseButtonEvent::Button | convertGlfwMouseButtonToButton (int glfwMouseButton) const |
| Convert a GLFW mouse button code to a MouseButtonEvent::Button. | |
| utility::event::KeyboardEvent::KeyModifiers | convertGlfwModsToKeyModifiers (int glfwMods) const |
| Convert GLFW modifier flags to KeyModifiers. | |
| utility::event::MouseMotionEvent::MousePosition | getMousePosition () const |
| Get the current mouse position. | |
| utility::event::MouseMotionEvent::MousePosition | convertCursorPosition (double xPos, double yPos) const |
| Convert a GLFW cursor position to framebuffer coordinates. | |
| std::vector< std::shared_ptr< utility::event::KeyboardEvent > > | getPressedMovementKeys () const |
| Get the current state of movement keys. | |
Public Member Functions inherited from evan::IPlatform | |
| virtual | ~IPlatform ()=default |
| Virtual destructor. | |
| virtual VkInstanceCreateFlags | getInstanceCreateFlags () const |
| Get platform-specific Vulkan instance creation flags. | |
| virtual std::vector< std::string > | getRequiredDeviceExtensions () const |
| Get platform-specific required Vulkan device extensions. | |
| virtual std::filesystem::path | getPipelineCachePath () const |
| Get the path where the Vulkan pipeline cache is persisted. | |
| Error | getLastError () const |
| Get the last error recorded by the platform. | |
Protected Member Functions | |
| std::filesystem::path | getDefaultCacheRoot () const override |
| Get the Linux cache root directory. | |
Additional Inherited Members | |
Public Attributes inherited from evan::IDesktopPlatform | |
| GLFWwindow * | _window = nullptr |
| Currently active GLFW window for the Desktop platform. | |
| std::vector< std::shared_ptr< utility::event::KeyboardEvent > > | _keyboardEvents |
| Vector to store keyboard events. | |
| std::vector< std::shared_ptr< utility::event::MouseButtonEvent > > | _mouseButtonEvents |
| Vector to store mouse button events. | |
| std::vector< std::shared_ptr< utility::event::MouseMotionEvent > > | _mouseMotionEvents |
| Vector to store mouse motion events. | |
| std::vector< std::shared_ptr< utility::event::MouseWheelEvent > > | _mouseWheelEvents |
| Vector to store mouse wheel events. | |
| std::vector< std::shared_ptr< utility::event::CursorEnterEvent > > | _cursorEnterEvents |
| Vector to store cursor enter/leave events. | |
| std::vector< std::shared_ptr< utility::event::FileDropEvent > > | _fileDropEvents |
| Vector to store file drop events. | |
| std::vector< std::shared_ptr< utility::event::TextInputEvent > > | _textInputEvents |
| Vector to store text input events. | |
Protected Attributes inherited from evan::IPlatform | |
| Error | _lastError = Error::Ok |
| Sticky error recorded by the platform while polling events. | |
Linux desktop platform implementation.
This class provides an implementation of the IDesktopPlatform interface specifically for the Linux desktop environment. It handles platform-specific functionality related to Linux, such as creating a Vulkan surface using GLFW and managing the necessary resources for rendering on Linux.
Definition at line 25 of file LinuxDesktopPlatform.hpp.
| evan::LinuxDesktopPlatform::LinuxDesktopPlatform | ( | const std::string & | name, |
| const uint32_t | width, | ||
| const uint32_t | height | ||
| ) |
Constructor for LinuxDesktopPlatform.
| name | The name of the window. |
| width | The width of the window. |
| height | The height of the window. This constructor initializes the Linux desktop platform with the specified window parameters, setting up the necessary resources for rendering on Linux using Vulkan and GLFW. |
Definition at line 13 of file LinuxDesktopPlatform.cpp.
|
overridevirtual |
Create a Vulkan surface for the Linux desktop platform.
| instance | The Vulkan instance to use for creating the surface. |
Implements evan::IDesktopPlatform.
Definition at line 53 of file LinuxDesktopPlatform.cpp.
|
overrideprotectedvirtual |
Get the Linux cache root directory.
XDG_CACHE_HOME when set, ~/.cache otherwise, or an empty path when neither is available. Implements evan::IPlatform.
Definition at line 72 of file LinuxDesktopPlatform.cpp.
|
overridevirtual |
Get the required instance extensions for the Linux desktop platform.
This method retrieves the necessary Vulkan instance extensions required for the Linux desktop platform, which may include extensions for window surface creation and other platform-specific features related to Vulkan on Linux.
Implements evan::IDesktopPlatform.
Definition at line 38 of file LinuxDesktopPlatform.cpp.