*/
// INTERNAL INCLUDES
-#include <dali/devel-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/texture-set.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/common/message.h>
#include <dali/internal/event/common/event-thread-services.h>
namespace Render
{
-class Sampler;
+struct Sampler;
+class NewTexture;
}
namespace SceneGraph
{
class Renderer;
-class Sampler;
class TextureSet
{
void SetSampler( size_t index, Render::Sampler* sampler );
/**
+ * Set the texture at position "index"
+ * @param[in] index The index of the texture
+ * @param[in] texture The texture
+ */
+ void SetTexture( size_t index, Render::NewTexture* texture );
+
+ /**
* Return whether any texture in the texture set has an alpha channel
* @return true if at least one texture in the texture set has an alpha channel, false otherwise
*/
return mTextureId.Size();
}
+ /**
+ * Get the number of NewTextures in the texture set
+ * @return The number of NewTextures
+ */
+ size_t GetNewTextureCount()
+ {
+ return mTextures.Size();
+ }
+
+ /**
+ * Get the pointer to a NewTexture in the TextureSet
+ * @param[in] index The index of the texture in the textures array
+ * @return the pointer to the NewTexture in that position
+ */
+ Render::NewTexture* GetNewTexture( size_t index )
+ {
+ return mTextures[index];
+ }
private:
private: // Data
Vector< Render::Sampler* > mSamplers; ///< List of samplers used by each texture. Not owned
+ Vector< Render::NewTexture* > mTextures; ///< List of NewTextures. Not owned
Vector< ResourceId > mTextureId; ///< List of texture ids
Vector<Renderer*> mRenderers; ///< List of renderers using the TextureSet
bool mResourcesReady; ///< if the textures are ready to be used for rendering
new (slot) LocalType( &textureSet, &TextureSet::SetImage, index, resourceId );
}
+inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, Render::NewTexture* texture )
+{
+ typedef MessageValue2< TextureSet, size_t, Render::NewTexture* > LocalType;
+
+ // Reserve some memory inside the message queue
+ unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+ // Construct message in the message queue memory; note that delete should not be called on the return value
+ new (slot) LocalType( &textureSet, &TextureSet::SetTexture, index, texture );
+}
+
inline void SetSamplerMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, Render::Sampler* sampler )
{
typedef MessageValue2< TextureSet, size_t, Render::Sampler* > LocalType;