Nameless Engine
Loading...
Searching...
No Matches
CameraManager.h
1#pragma once
2
3// Standard.
4#include <memory>
5#include <mutex>
6
7// External.
8#include "GcPtr.h"
9
10namespace ne {
11 class CameraNode;
12 class Renderer;
13 class CameraProperties;
14
17 // Active camera node will notify the manager when it's being despawned.
18 friend class CameraNode;
19
20 public:
21 CameraManager() = delete;
22
29
39 void setActiveCamera(const sgc::GcPtr<CameraNode>& pCameraNode);
40
42 void clearActiveCamera();
43
54 std::pair<std::recursive_mutex, sgc::GcPtr<CameraNode>>* getActiveCamera();
55
56 private:
62 void onCameraNodeDespawning(CameraNode* pCameraNode);
63
65 Renderer* pRenderer = nullptr;
66
68 std::pair<std::recursive_mutex, sgc::GcPtr<CameraNode>> mtxActiveCamera;
69 };
70} // namespace ne
Definition: CameraManager.h:16
std::pair< std::recursive_mutex, sgc::GcPtr< CameraNode > > * getActiveCamera()
Definition: CameraManager.cpp:71
void onCameraNodeDespawning(CameraNode *pCameraNode)
Definition: CameraManager.cpp:75
std::pair< std::recursive_mutex, sgc::GcPtr< CameraNode > > mtxActiveCamera
Definition: CameraManager.h:68
void setActiveCamera(const sgc::GcPtr< CameraNode > &pCameraNode)
Definition: CameraManager.cpp:16
Renderer * pRenderer
Definition: CameraManager.h:65
void clearActiveCamera()
Definition: CameraManager.cpp:55
Definition: CameraNode.h:11
Definition: Renderer.h:43