-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReflex-Engine.cpp
More file actions
67 lines (49 loc) · 1.86 KB
/
Copy pathReflex-Engine.cpp
File metadata and controls
67 lines (49 loc) · 1.86 KB
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
65
66
#include "pch.h"
#include "Reflex-Logging.h"
#include "Reflex-AssetManager.h"
#include "Reflex-Core/Camera.h"
#include "Settings.h"
#include "Globals.h"
#include "Reflex-Renderer/Renderer_OpenGL.h"
#include "Includes/Scene.h"
#include "Includes/Reflex_Window.h"
void error_callback(int error, const char* description)
{
auto log = spdlog::get("app_Logger");
if (log)
{
log->error("Error: {0}\n \t-", description);
}
}
void initGLFW()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
}
int main()
{
std::vector<spdlog::sink_ptr> sinks;
sinks.push_back(std::make_shared <spdlog::sinks::stdout_sink_st>());
auto appLog = Reflex::Log::createNewLogger("app_Logger");
appLog->writeNotice("\t Reflex-Engine initialising\n");
appLog->writeNotice("\t GLFW Initialising...");
glfwSetErrorCallback(error_callback);
initGLFW();
auto _activeCamera = std::make_shared<Reflex::Core::Camera>();
//GLFWmonitor* monitor = glfwGetPrimaryMonitor();
//auto videoMode = glfwGetVideoMode(monitor);
Reflex::Globals::windowGlobals.activeWindow = std::make_shared<Reflex::Window::Reflex_Window>(1920, 1080, (char*) "Relex Engine 1.0");
Reflex::Globals::windowGlobals.activeWindow->initUI();
const std::shared_ptr<Reflex::Renderer::Renderer_OpenGL> sceneRender = std::make_shared<Reflex::Renderer::Renderer_OpenGL>();
Reflex::Scene _newScene;
const auto assetManager = Reflex::Managers::AssetManagerInstance->getInstance();
_newScene.initScene(assetManager);
_newScene.setRenderer(sceneRender);
_newScene.run();
appLog->writeNotice("Terminating");
glfwTerminate();
}