Vivid
Loading...
Searching...
No Matches
Application.h
1#pragma once
2
3#include "common/types/OpenGLTypes.h"
4#include "common/types/SmartPointers.h"
5#include "Window.h"
6#include <iostream>
7#include "confs/DynamicExportingMacros.h"
8#include "editor/RenderingInterface.h"
9#include "editor/camera/Camera.h"
10
11#include "inputs/InputHandler.h"
12
18class VIVAPI Application
19{
20private:
21 static Application* s_Instance;
22 int m_Width, m_Height;
23 const char* m_Title;
24
26
27 Application(int width, int height, const char* title, Camera* camera = nullptr);
28
29 Window* m_Window;
30 Camera* m_Camera;
31
32public:
33 bool IsRunning();
34
35 void Run();
36
37 // TODO: Fix this semantically
38 static Application*
39 GetInstance(int width = 1920, int height = 1080, const char* title = "Vivid", Camera* camera = nullptr)
40 {
41 if (s_Instance == NULL)
42 s_Instance = new Application(width, height, title, camera);
43 return s_Instance;
44 }
45
46 Window& GetWindow() { return *m_Window; }
47
48 Camera* GetCamera() { return m_Camera; }
49
50 char* GetTitle() { return (char*)m_Title; }
51
52 void SetCamera(Camera* camera) { m_Camera = camera; }
53
54 void Terminate();
55
56 void SetRenderingInterface(RenderingInterface* renderingInterface)
57 {
58 m_Window->SetRenderingInterface(renderingInterface);
59 }
60};
61
62namespace Vivid
63{
64 Application* CreateApplication();
65}
Application class.
Definition: Application.h:19
A class that represents the camera.
Definition: Camera.h:25
RenderingInterface class.
A class that represents a window and is wrapper of GLFWwindow.
Definition: Window.h:15
void SetRenderingInterface(RenderingInterface *renderingInterface)
Sets the rendering interface.
Definition: Window.cpp:77