Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
editorMain.cpp
Go to the documentation of this file.
1/*
2Copyright (c) 2024 Rahul Satish Vadhyar
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22
23#include "editorManager.hpp"
24#include "logging.hpp"
26
28
29int main()
30{
32 initializer.WindowWidth = 800;
33 initializer.WindowHeight = 600;
34 initializer.BackgroundColor[0] = 0;
35 initializer.BackgroundColor[1] = 0;
36 initializer.BackgroundColor[2] = 0;
37 initializer.editorAddElements = addElements;
38
39 Chronos::Manager::Manager manager(initializer);
40 LOG(2, "Manager created.")
41 editorManager.init(&manager);
42 LOG(3, "EditorManager created.")
43
44 // Chronos::Manager::ShapeParams shapeParams;
45 // shapeParams.color = {1.0f, 1.0f, 1.0f};
46 // shapeParams.xSize = 0.5f;
47 // shapeParams.ySize = 0.5f;
48 // int shapeNo = manager.addPolygon(shapeParams, {false, true});
49
50 // int keyframeNo = manager.addKeyframeVariable({{0, 0}, {400, 0.1}, {800,
51 // 0.5}, {1200, 0.4}, {1600, 0.2}});
52
53 while (!glfwWindowShouldClose(manager.getWindow())) {
54 if (glfwGetKey(manager.getWindow(), GLFW_KEY_ESCAPE) == GLFW_PRESS) {
55 glfwSetWindowShouldClose(manager.getWindow(), true);
56 }
57 // shapeParams.x = manager.keyframeGetVariable(keyframeNo);
58 // manager.updatePolygon(shapeNo, shapeParams);
59 manager.drawFrame();
60 LOG(4, "Frame drawn.")
61 }
62 LOG(2, "Exited rendering loop, closing program.")
63 return 0;
64}
void init(Chronos::Manager::Manager *manager)
The main manager of chronos.
Definition chronos.hpp:109
GLFWwindow * getWindow()
Gets a reference to the GLFWWindow.
Definition manager.cpp:25
void drawFrame()
Draws the current frame to the window.
Definition manager.cpp:52
Chronos::Editor::EditorManager editorManager
void addElements()
int main()
#define LOG(LEVEL, MESSAGE)
Definition logging.hpp:60
This struct contains the details for initialing the manager.
Definition chronos.hpp:46