forked from turanszkij/WickedEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwiRenderPath.h
43 lines (38 loc) · 1.3 KB
/
wiRenderPath.h
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
#pragma once
#include "CommonInclude.h"
#include "wiGraphicsDevice.h"
#include "wiCanvas.h"
namespace wi
{
class RenderPath : public wi::Canvas
{
private:
uint32_t layerMask = 0xFFFFFFFF;
public:
virtual ~RenderPath() = default;
// load resources in background (for example behind loading screen)
virtual void Load() {}
// called when RenderPath gets activated
virtual void Start() {}
// called when RenderPath gets deactivated (for example when switching to an other RenderPath)
virtual void Stop() {}
// executed before Update()
virtual void PreUpdate() {}
// update with fixed frequency
virtual void FixedUpdate() {}
// update once per frame
// dt : elapsed time since last call in seconds
virtual void Update(float dt) {}
// executed after Update()
virtual void PostUpdate() {}
// Render to layers, rendertargets, etc
// This will be rendered offscreen
virtual void Render() const {}
// Compose the rendered layers (for example blend the layers together as Images)
// This will be rendered to the backbuffer
virtual void Compose(wi::graphics::CommandList cmd) const {}
inline uint32_t getLayerMask() const { return layerMask; }
inline void setlayerMask(uint32_t value) { layerMask = value; }
wi::graphics::ColorSpace colorspace = wi::graphics::ColorSpace::SRGB;
};
}