Overte C++ Documentation
Resource.h
1 //
2 // Resource.h
3 // libraries/gpu/src/gpu
4 //
5 // Created by Sam Gateau on 10/8/2014.
6 // Copyright 2014 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 #ifndef hifi_gpu_Resource_h
12 #define hifi_gpu_Resource_h
13 
14 #include "Forward.h"
15 
16 namespace gpu {
17 
19 class Resource {
20 public:
21  using Size = gpu::Size;
22  static const Size NOT_ALLOCATED = INVALID_SIZE;
23 
27  virtual Size getSize() const = 0;
28 
29  enum Type {
30  BUFFER = 0,
31  TEXTURE_1D,
32  TEXTURE_2D,
33  TEXTURE_3D,
34  TEXTURE_CUBE,
35  TEXTURE_1D_ARRAY,
36  TEXTURE_2D_ARRAY,
37  TEXTURE_3D_ARRAY,
38  TEXTURE_CUBE_ARRAY,
39  };
40 
41 protected:
42  Resource();
43  virtual ~Resource();
44 }; // Resource
45 
46 }
47 
48 
49 // FIXME Compatibility with headers that rely on Resource.h for the buffer and buffer view definitions
50 #include "Buffer.h"
51 
52 
53 #endif
Buffer and Texture inherits from this class.
Definition: Resource.h:19
virtual Size getSize() const =0