Graphics v0.0.0
A simple abstraction layer for the modern graphics APIs.
载入中...
搜索中...
未找到
Renderer.h
1// Copyright 2022 ShenMian
2// License(Apache-2.0)
3
4#pragma once
5
6#include "Core/Window.h"
7#include <string>
8
10{
11public:
12 enum class Backend
13 {
14 OpenGL,
15 Vulkan,
16 // D3D12,
17 // Metal
18 };
19
23 static Renderer* get();
24
30 static void set_backend(Backend backend);
31
35 static Backend get_backend();
36
37 virtual std::string get_device_name() const = 0;
38 virtual std::string get_renderer_name() const = 0;
39 virtual std::string get_vendor_name() const = 0;
40
41 static void init(const Window& win);
42 static void deinit();
43
44private:
45 static Backend backend_;
46};
Definition: Renderer.h:10
static void set_backend(Backend backend)
设置图形后端.
Definition: Renderer.cpp:31
static Renderer * get()
获取单例.
Definition: Renderer.cpp:12
static Backend get_backend()
获取图形后端.
Definition: Renderer.cpp:36
窗体.
Definition: Window.h:24