// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/common/set-wrapper.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/internal/render/gl-resources/context.h>
#include <dali/integration-api/resource-cache.h>
+#include <dali/integration-api/shader-data.h>
namespace Dali
{
* @param [in] modifiesGeometry True if the shader modifies geometry
* @return pointer to the program
*/
- static Program* New( const Integration::ResourceId& resourceId, Integration::ShaderData* shaderData, Context& context, bool modifiesGeometry );
+ static Program* New( const Integration::ResourceId& resourceId, Integration::ShaderDataPtr shaderData, Context& context, bool modifiesGeometry );
/**
* Takes this program into use
/**
* Constructor, private so no direct instantiation
- * @param[in] shaderData A pointer to a data structure containing the program source and binary
+ * @param[in] shaderData A smart pointer to a data structure containing the program source and binary
* @param[in] context The GL context state cache.
* @param[in] modifiesGeometry True if the vertex shader changes geometry
*/
- Program( Integration::ShaderData* shaderData, Context& context, bool modifiesGeometry );
+ Program( Integration::ShaderDataPtr shaderData, Context& context, bool modifiesGeometry );
public:
*/
~Program();
+ /**
+ * Load the shader, from a precompiled binary if available, else from source code
+ */
+ void Load();
+
private:
// default constructor, not defined
Program& operator=( const Program& );
/**
- * Load the shader, from a precompiled binary if available, else from source code
- */
- void Load();
-
- /**
* Unload the shader
*/
void Unload();
/**
* Resets caches
*/
- void ResetAttribsUniforms();
+ void ResetAttribsUniformCache();
private: // Data
GLuint mVertexShaderId; ///< GL identifier for vertex shader
GLuint mFragmentShaderId; ///< GL identifier for fragment shader
GLuint mProgramId; ///< GL identifier for program
- Integration::ShaderData* mProgramData; ///< Shader program source and binary (when compiled & linked or loaded)
+ Integration::ShaderDataPtr mProgramData; ///< Shader program source and binary (when compiled & linked or loaded)
// location caches
GLint mAttribLocations[ ATTRIB_TYPE_LAST ]; ///< attribute location cache