Add get_surface_extension to X11SystenDriver
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "drivers/linux/system_driver.h"
|
||||
|
||||
#ifdef NOVA_WAYLAND
|
||||
#include "drivers/linux/wayland/system_driver.h"
|
||||
#endif
|
||||
@@ -13,8 +15,6 @@
|
||||
|
||||
#include <nova/core/debug.h>
|
||||
|
||||
#include "drivers/linux/system_driver.h"
|
||||
|
||||
using namespace Nova;
|
||||
|
||||
LinuxSystemDriver::LinuxSystemDriver() {
|
||||
@@ -25,6 +25,11 @@ LinuxSystemDriver::~LinuxSystemDriver() {
|
||||
NOVA_AUTO_TRACE();
|
||||
}
|
||||
|
||||
const char* LinuxSystemDriver::get_surface_extension() const {
|
||||
NOVA_WARN("System driver does not support surfaces");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<SystemDriver> LinuxSystemDriver::get_default_driver() {
|
||||
NOVA_AUTO_TRACE();
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace Nova {
|
||||
LinuxSystemDriver();
|
||||
~LinuxSystemDriver() override;
|
||||
|
||||
[[nodiscard]] const char* get_surface_extension() const override;
|
||||
|
||||
static std::unique_ptr<SystemDriver> get_default_driver();
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
|
||||
#include "drivers/linux/x11/system_driver.h"
|
||||
|
||||
#ifdef NOVA_VULKAN
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan_xlib.h>
|
||||
#endif
|
||||
|
||||
#include <nova/core/debug.h>
|
||||
|
||||
using namespace Nova;
|
||||
@@ -17,3 +22,11 @@ X11SystemDriver::X11SystemDriver() {
|
||||
X11SystemDriver::~X11SystemDriver() {
|
||||
NOVA_AUTO_TRACE();
|
||||
}
|
||||
|
||||
const char* X11SystemDriver::get_surface_extension() const {
|
||||
#ifdef NOVA_VULKAN
|
||||
return VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -8,10 +8,14 @@
|
||||
|
||||
#include "drivers/linux/system_driver.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
namespace Nova {
|
||||
class X11SystemDriver final : public LinuxSystemDriver {
|
||||
public:
|
||||
X11SystemDriver();
|
||||
~X11SystemDriver() override;
|
||||
|
||||
[[nodiscard]] const char* get_surface_extension() const override;
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
Reference in New Issue
Block a user