blob: 422f4c80e8d6cb8d7d0f9f1e2dfbd48adb56d75b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#pragma once
#include "xe_device.hpp"
#include "xe_renderer.hpp"
#include "xe_camera.hpp"
#include "xe_descriptors.hpp"
#include "xe_image.hpp"
#include "xe_input.hpp"
#include "xe_sound.hpp"
#include <chrono>
#include <string>
#include <iostream>
#include <AL/alc.h>
#include <AL/alut.h>
namespace xe {
class XeEngine {
public:
XeEngine(int width, int height, std::string name);
~XeEngine();
XeEngine(const XeEngine&) = delete;
XeEngine operator=(const XeEngine&) = delete;
XeInput& getInput() {return xeInput;}
XeCamera& getCamera() {return xeCamera;}
std::shared_ptr<XeModel> loadModelFromFile(const std::string &filename);
std::shared_ptr<XeModel> loadModelFromData(std::vector<XeModel::Vertex> vertices, std::vector<uint32_t> indices);
std::shared_ptr<XeImage> loadImage(const std::string &filename);
bool beginFrame() { return xeRenderer.beginFrame(); }
void endFrame() { xeRenderer.endFrame(); }
void close() { vkDeviceWaitIdle(xeDevice.device()); }
bool poll();
float getFrameTime() { return frameTime; }
private:
void loadDescriptorPool();
XeWindow xeWindow;
XeDevice xeDevice;
XeRenderer xeRenderer;
XeCamera xeCamera;
XeInput xeInput;
std::chrono::_V2::system_clock::time_point currentTime;
float frameTime;
float FOV = 50.f;
std::unique_ptr<XeDescriptorPool> xeDescriptorPool;
friend class XeRenderSystem;
};
}
|