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


Public Member Functions | |
| MacOsDesktopPlatform (const std::string &name, const uint32_t width, const uint32_t height) | |
| Constructor for MacOsDesktopPlatform. | |
| ~MacOsDesktopPlatform ()=default | |
| Destructor for MacOsDesktopPlatform. This destructor ensures proper cleanup of resources associated with the MacOS 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 MacOS desktop platform. | |
| VkInstanceCreateFlags | getInstanceCreateFlags () const override |
| Get the Vulkan instance creation flags for the MacOS desktop platform. | |
| std::vector< std::string > | getRequiredDeviceExtensions () const override |
| Get the required Vulkan device extensions for the MacOS desktop platform. | |
| VkSurfaceKHR | createSurface (VkInstance instance) const override |
| Create a Vulkan surface for the MacOS 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 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 macOS 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. | |
MacOS desktop platform implementation.
This class provides an implementation of the IDesktopPlatform interface specifically for the MacOS desktop environment. It handles platform-specific functionality related to MacOS, such as creating a Vulkan surface using MoltenVK and managing the necessary resources for rendering on MacOS.
Definition at line 25 of file MacOsDesktopPlatform.hpp.
| evan::MacOsDesktopPlatform::MacOsDesktopPlatform | ( | const std::string & | name, |
| const uint32_t | width, | ||
| const uint32_t | height | ||
| ) |
Constructor for MacOsDesktopPlatform.
| name | The name of the window. |
| width | The width of the window. |
| height | The height of the window. This constructor initializes the MacOS desktop platform with the specified window parameters, setting up the necessary resources for rendering on MacOS using Vulkan and MoltenVK. |
Definition at line 13 of file MacOsDesktopPlatform.cpp.
|
overridevirtual |
Create a Vulkan surface for the MacOS desktop platform.
| instance | The Vulkan instance to use for creating the surface. |
This method creates a Vulkan surface that is compatible with the MacOS desktop platform, allowing rendered images to be presented on the screen. The implementation may involve using MoltenVK's functions to create a window surface that can be used with Vulkan on MacOS.
Implements evan::IDesktopPlatform.
Definition at line 65 of file MacOsDesktopPlatform.cpp.
|
overrideprotectedvirtual |
Get the macOS cache root directory.
~/Library/Caches, or an empty path when HOME is not set. Implements evan::IPlatform.
Definition at line 84 of file MacOsDesktopPlatform.cpp.
|
overridevirtual |
Get the Vulkan instance creation flags for the MacOS desktop platform.
MoltenVK requires the portability enumeration bit to expose the VK_KHR_portability_subset device extension.
Reimplemented from evan::IPlatform.
Definition at line 53 of file MacOsDesktopPlatform.cpp.
|
overridevirtual |
Get the required Vulkan device extensions for the MacOS desktop platform.
MoltenVK requires the VK_KHR_portability_subset device extension.
Reimplemented from evan::IPlatform.
Definition at line 59 of file MacOsDesktopPlatform.cpp.
|
overridevirtual |
Get the required instance extensions for the MacOS desktop platform.
This method retrieves the necessary Vulkan instance extensions required for the MacOS desktop platform, which may include extensions for window surface creation and other platform-specific features related to MoltenVK and Vulkan on MacOS.
Implements evan::IDesktopPlatform.
Definition at line 37 of file MacOsDesktopPlatform.cpp.