0.7.0
texture2d.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "texture.hpp"
32 #include "image.hpp"
33 
34 namespace gli
35 {
37  class texture2D : public texture
38  {
39  public:
40  typedef dim2_t dim_type;
41  typedef vec2 texcoord_type;
42 
43  public:
45  texture2D();
46 
48  explicit texture2D(
49  format_type Format,
50  dim_type const & Dimensions,
51  size_type Levels);
52 
54  explicit texture2D(
55  format_type Format,
56  dim_type const & Dimensions);
57 
59  explicit texture2D(
60  texture const & Texture);
61 
63  explicit texture2D(
64  texture const & Texture,
65  format_type Format,
66  size_type BaseLayer, size_type MaxLayer,
67  size_type BaseFace, size_type MaxFace,
68  size_type BaseLevel, size_type MaxLevel);
69 
71  explicit texture2D(
72  texture2D const & Texture,
73  size_type BaseLevel, size_type MaxLevel);
74 
76  image operator[](size_type Level) const;
77 
79  dim_type dimensions() const;
80 
81  template <typename genType>
82  genType fetch(texture2D::dim_type const & TexelCoord, texture2D::size_type Level);
83 
84  template <typename genType>
85  void write(texture2D::dim_type const & TexelCoord, texture2D::size_type Level, genType const & Color);
86  };
87 }//namespace gli
88 
89 #include "./core/texture2d.inl"
Image.
Definition: image.hpp:39
texture2D
Definition: texture2d.hpp:37
dim_type dimensions() const
Return the dimensions of a texture instance: width and height.
OpenGL Image (gli.g-truc.net)
texture2D()
Create an empty texture 2D.
Genetic texture class. It can support any target.
Definition: texture.hpp:37
image operator[](size_type Level) const
Create a view of the image identified by Level in the mipmap chain of the texture.
OpenGL Image (gli.g-truc.net)