removing device builder

This commit is contained in:
2026-09-06 22:48:21 -07:00
parent 659d6010e3
commit db488a5981
2 changed files with 1 additions and 51 deletions
-32
View File
@@ -86,38 +86,6 @@ Device::~Device() {
}
}
Device::Builder& Device::Builder::withWindow(Window& window) {
this->window = &window;
this->headlessRequested = false;
this->modeSet = true;
return *this;
}
Device::Builder& Device::Builder::headless() {
this->window = nullptr;
this->headlessRequested = true;
this->modeSet = true;
return *this;
}
std::unique_ptr<Device> Device::Builder::build() const {
if (!this->modeSet) {
log::fatal(
"failed to build device: neither withWindow() nor headless() was "
"called");
throw std::runtime_error(
"failed to build device: no window/headless mode specified");
}
if (this->headlessRequested) {
log::verbose("building headless Device");
return std::unique_ptr<Device>(new Device(nullptr));
} else {
log::verbose("building windowed Device");
return std::unique_ptr<Device>(new Device(this->window));
}
}
u32 Device::findMemoryType(u32 typeFilter, vk::MemoryPropertyFlags properties) {
vk::PhysicalDeviceMemoryProperties memoryProperties =
this->physicalDevice.getMemoryProperties();