Overte C++ Documentation
gpu/src/gpu/Frame.h
1 //
2 // Created by Bradley Austin Davis on 2016/07/26
3 // Copyright 2013-2016 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 #ifndef hifi_gpu_Frame_h
9 #define hifi_gpu_Frame_h
10 
11 #include <functional>
12 #include <queue>
13 
14 #include "Forward.h"
15 #include "Batch.h"
16 #include "Resource.h"
17 
18 namespace gpu {
19 
20  class Frame {
21  friend class Context;
22 
23  public:
24  Frame();
25  virtual ~Frame();
26  using Batches = std::vector<BatchPointer>;
27  using FramebufferRecycler = std::function<void(const FramebufferPointer&)>;
28  using OverlayRecycler = std::function<void(const TexturePointer&)>;
29 
30  StereoState stereoState;
31  uint32_t frameIndex{ 0 };
33  Mat4 view;
35  Mat4 pose;
37  Batches batches;
39  BufferUpdates bufferUpdates;
41  FramebufferPointer framebuffer;
43  FramebufferRecycler framebufferRecycler;
44 
45  std::queue<std::tuple<std::function<void(const QImage&)>, float, bool>> snapshotOperators;
46 
47  protected:
48  friend class Deserializer;
49 
50  // Should be called once per frame, on the recording thred
51  void finish();
52  void preRender();
53  };
54 
55 };
56 
57 
58 #endif
Provides the Mat4 scripting interface.
Definition: Mat4.h:44