3 #include <Core/Tasks/TaskQueue.hpp>
4 #include <Core/Utils/Color.hpp>
5 #include <Engine/OpenGL.hpp>
6 #include <Engine/RaEngine.hpp>
58 GLenum
type { GL_UNSIGNED_BYTE };
60 GLenum
wrapS { GL_CLAMP_TO_EDGE };
62 GLenum
wrapT { GL_CLAMP_TO_EDGE };
64 GLenum
wrapP { GL_CLAMP_TO_EDGE };
123 void initializeGL(
bool linearize =
false );
132 void bind(
int unit = -1 );
146 void bindImageTexture(
int unit, GLint level, GLboolean layered, GLint layer, GLenum access );
151 inline std::string
getName()
const {
return m_textureParameters.name; }
161 void updateData(
void* newData );
172 void updateParameters();
185 GLenum
format()
const {
return m_textureParameters.format; }
189 size_t width()
const {
return m_textureParameters.width; }
193 size_t height()
const {
return m_textureParameters.height; }
197 size_t depth()
const {
return m_textureParameters.depth; }
199 void* texels() {
return m_textureParameters.texels; }
203 globjects::Texture*
texture()
const {
return m_texture.get(); }
218 void resize(
size_t w = 1,
size_t h = 1,
size_t d = 1,
void* pix =
nullptr );
234 std::lock_guard<std::mutex> lock( m_updateMutex );
235 m_textureParameters = textureParameters;
252 void sRGBToLinearRGB( uint8_t* texels, uint numComponent,
bool hasAlphaChannel );
255 void linearizeCubeMap( uint numComponent,
bool hasAlphaChannel );
262 std::unique_ptr<globjects::Texture> m_texture;
264 bool m_isMipMapped {
false };
266 bool m_isLinear {
false };
270 std::mutex m_updateMutex;
Utils::Index TaskId
Identifier for a task in the task queue.
globjects::Texture * texture() const
void operator=(const Texture &)=delete
TextureParameters & getParameters()
void setParameters(const TextureParameters &textureParameters)
std::string getName() const
Texture(const Texture &)=delete
const TextureParameters & getParameters() const
get read access to texture parameters
GLenum wrapT
OpenGL wrap mode in the t direction.
GLenum magFilter
OpenGL magnification filter ( GL_LINEAR or GL_NEAREST )
GLenum wrapS
OpenGL wrap mode in the s direction.
size_t depth
width of the texture (p dimension)
GLenum wrapP
OpenGL wrap mode in the p direction.
size_t height
height of the texture (t dimension)
GLenum minFilter
OpenGL minification filter ( GL_LINEAR or GL_NEAREST or GL_XXX_MIPMAP_YYY )
GLenum format
Format of the external data.
size_t width
width of the texture (s dimension)
GLenum target
OpenGL target.
GLenum type
Type of the components in external data.
GLenum internalFormat
OpenGL internal format (WARNING, for Integer textures, must be GL_XXX_INTEGER)
std::string name
Name of the texture.