gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
texture.h
1 // © Joseph Cameron - All Rights Reserved
2 
3 #ifndef GDK_GFX_TEXTURE_H
4 #define GDK_GFX_TEXTURE_H
5 
6 #include <cstddef>
7 #include <vector>
8 
9 #include <gdk/graphics_types.h>
10 
11 namespace gdk
12 {
17  class texture
18  {
19  public:
20  enum class data_format
21  {
22  rgb,
23  rgba,
25  };
26 
36  {
37  size_t width;
38  size_t height;
39 
41 
44  std::byte *data;
45  };
46 
48  virtual void update_data(const image_data_2d_view &) = 0;
49 
53  virtual void update_data(const image_data_2d_view &, const size_t offsetX, const size_t offsetY) = 0;
54 
56  virtual ~texture() = default;
57 
58  protected:
60  texture() = default;
61  };
62 }
63 
64 #endif
virtual void update_data(const image_data_2d_view &)=0
replace the texture data with new data
data is a sequence of bytes representing red, green, blue, alpha, ...
std::byte * data
Definition: texture.h:44
Definition: camera.h:9
data_format
< format of data in the byte array
Definition: texture.h:20
virtual ~texture()=default
trivial destructor
data is a sequence of bytes representing red, green, blue, ...
size_t height
number of texels tall
Definition: texture.h:38
2d color data, usually used to color the surfaces of a 3d model. more accurately: used to color fragm...
Definition: texture.h:17
data_format format
format of the data
Definition: texture.h:40
size_t width
number of texels wide
Definition: texture.h:37
special format used by textures attached to the depth buffer of a texture_camera
texture()=default
interface type cannot be instantiated
pod struct representing a view on decoded image data
Definition: texture.h:35