/* * Copyright (c) 2022, Stephan Unverwerth * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include namespace GPU { class Driver final : public RefCounted , public Weakable { public: static ErrorOr> try_create(StringView driver_name); ~Driver(); ErrorOr> try_create_device(Gfx::IntSize size); private: Driver(void* dlopen_result, serenity_gpu_create_device_t device_creation_function) : m_dlopen_result { dlopen_result } , m_serenity_gpu_create_device { device_creation_function } { VERIFY(dlopen_result); VERIFY(device_creation_function); } void* const m_dlopen_result { nullptr }; serenity_gpu_create_device_t m_serenity_gpu_create_device { nullptr }; }; }