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  friend class Backend;
23 
24  public:
25  Frame();
26  virtual ~Frame();
27  using Batches = std::vector<BatchPointer>;
28  using FramebufferRecycler = std::function<void(const FramebufferPointer&)>;
29  using OverlayRecycler = std::function<void(const TexturePointer&)>;
30 
31  StereoState stereoState;
32  uint32_t frameIndex{ 0 };
34  Mat4 view;
36  Mat4 pose;
38  Batches batches;
40  BufferUpdates bufferUpdates;
42  FramebufferPointer framebuffer;
44  FramebufferRecycler framebufferRecycler;
45 
46  std::queue<std::tuple<std::function<void(const QImage&)>, float, bool>> snapshotOperators;
47 
48  protected:
49  friend class Deserializer;
50 
51  // Should be called once per frame, on the recording thred
52  void finish();
53  void preRender();
54  };
55 
56 };
57 
58 
59 #endif
Provides the Mat4 scripting interface.
Definition: Mat4.h:44