Ankush's Garage
A collection of stuff made by Ankush Roy
Loading...
Searching...
No Matches
Context.h
Go to the documentation of this file.
1#ifndef INCLUDE_CORE_CONTEXT_H_
2#define INCLUDE_CORE_CONTEXT_H_
3
4#include "Common/pch.h"
5
7
8namespace Core
9{
10
12{
13 SDL_Window *Window = nullptr;
14 SDL_GPUDevice *Device = nullptr;
15 SDL_GPURenderPass *ProjectPass = nullptr;
16 SDL_GPUTexture *ProjectTexture = nullptr;
17 SDL_GPUTexture *ResolveTexture = nullptr;
18 SDL_GPUSampler *ProjectSampler = nullptr;
19 SDL_GPUSampleCount SampleCount = SDL_GPU_SAMPLECOUNT_1;
20 float ResolutionScale = 1.0f; // %
21 int Width = 1280;
22 int Height = 720;
23};
24
26{
27 glm::vec2 ProjectWindowSize = {0.0f, 0.0f};
28 glm::vec2 ScrollVal = {0.0f, 0.0f};
29 glm::vec2 MouseRel = {0.0f, 0.0f};
30 ImGuiID MainViewportId = 0;
31 int ProjectIndex = 0;
35 bool HasToChangeIndex = false;
36};
37
39{
40 public:
42 ~Context();
43 void init();
44
45 Context(Context &&) = delete;
46 Context(const Context &) = delete;
47 Context &operator=(Context &&) = delete;
48 Context &operator=(const Context &) = delete;
49
50 static std::shared_ptr<Context> GetContext();
51
55
56 private:
57 // no need of lazy initialisation
58 static std::shared_ptr<Context> instance;
59};
60
61} // namespace Core
62
63#endif // INCLUDE_CORE_CONTEXT_H_
static std::shared_ptr< Context > instance
Definition Context.h:58
Context & operator=(Context &&)=delete
Context & operator=(const Context &)=delete
RenderDataStruct RenderData
Definition Context.h:52
AppStateStruct AppState
Definition Context.h:53
EventHandlerStruct EventHandler
Definition Context.h:54
~Context()
Definition Context.cpp:84
Context(Context &&)=delete
Context(const Context &)=delete
static std::shared_ptr< Context > GetContext()
Definition Context.cpp:15
void init()
Definition Context.cpp:24
<div class="mermaid"> </div>
Definition EventHandler.h:47
Definition Console.cpp:4
Definition Context.h:26
int ProjectToBeIndex
Definition Context.h:32
glm::vec2 ScrollVal
Definition Context.h:28
bool projectWindowFocused
Definition Context.h:33
int ProjectIndex
Definition Context.h:31
glm::vec2 ProjectWindowSize
Definition Context.h:27
glm::vec2 MouseRel
Definition Context.h:29
bool HasToChangeIndex
Definition Context.h:35
ImGuiID MainViewportId
Definition Context.h:30
bool projectWindowHovered
Definition Context.h:34
Definition Context.h:12
SDL_GPUTexture * ProjectTexture
Definition Context.h:16
SDL_GPUSampleCount SampleCount
Definition Context.h:19
SDL_GPURenderPass * ProjectPass
Definition Context.h:15
float ResolutionScale
Definition Context.h:20
SDL_Window * Window
Definition Context.h:13
SDL_GPUSampler * ProjectSampler
Definition Context.h:18
SDL_GPUTexture * ResolveTexture
Definition Context.h:17
SDL_GPUDevice * Device
Definition Context.h:14
int Height
Definition Context.h:22
int Width
Definition Context.h:21