#define DALI_INTERNAL_RENDER_TEXTURE_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <string>
+#include <cstdint> // uint16_t, uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/images/image-operations.h> // Dali::ImageDimensions
class Texture
{
public:
-
- typedef Dali::TextureType::Type Type;
+ using Type = Dali::TextureType::Type;
/**
* Constructor
* @param[in] sampler The sampler to be used with the texture
* @return true if the bind succeeded, false otherwise
*/
- bool Bind( Context& context, unsigned int textureUnit, Render::Sampler* sampler );
+ bool Bind( Context& context, uint32_t textureUnit, Render::Sampler* sampler );
/**
* Auto generates mipmaps for the texture
* Retrieve wheter the texture has an alpha channel
* @return True if the texture has alpha channel, false otherwise
*/
- bool HasAlphaChannel();
+ bool HasAlphaChannel() const;
/**
* Get the id of the texture
* @return Id of the texture
*/
- GLuint GetId()
+ GLuint GetId() const
{
return mId;
}
/**
+ * Get the target to which the texture is bound
+ * @return target to which the texture is bound
+ */
+ GLuint GetTarget() const
+ {
+ return mTarget;
+ }
+
+ /**
* Get the type of the texture
* @return Type of the texture
*/
return mNativeImage;
}
+ bool IsUploaded() const
+ {
+ return mIsUploaded;
+ }
+
private:
/**
Type mType:3; ///< Type of the texture
bool mHasAlpha : 1; ///< Whether the format has an alpha channel
bool mIsCompressed : 1; ///< Whether the format is compressed
+ bool mIsUploaded : 1;
};