18 #ifndef ION_GFX_SHADERPROGRAM_H_
19 #define ION_GFX_SHADERPROGRAM_H_
28 class ShaderInputRegistry;
42 kVertexShaderChanged = kNumBaseChanges,
55 if (
Shader* old_shader = vertex_shader_.Get().Get())
56 old_shader->RemoveReceiver(
this);
57 vertex_shader_.Set(shader);
59 shader->AddReceiver(
this);
62 return vertex_shader_.
Get();
67 if (
Shader* old_shader = fragment_shader_.Get().Get())
68 old_shader->RemoveReceiver(
this);
69 fragment_shader_.Set(shader);
71 shader->AddReceiver(
this);
74 return fragment_shader_.
Get();
88 void SetConcurrent(
bool value);
99 const std::string& id_string,
101 const std::string& vertex_shader_string,
102 const std::string& fragment_shader_string,
114 Field<ShaderPtr> vertex_shader_;
115 Field<ShaderPtr> fragment_shader_;
120 bool concurrent_set_;
126 #endif // ION_GFX_SHADERPROGRAM_H_
void SetVertexShader(const ShaderPtr &shader)
Sets/returns the vertex shader stage.
Changes
Changes that affect the resource.
A ShaderProgram represents an OpenGL shader program that can be applied to shapes.
A Notifier both sends notifications to and receives notifications from other Notifiers.
const ShaderPtr & GetVertexShader() const
base::WeakReferentPtr< ShaderProgram > ShaderProgramWeakPtr
const ShaderPtr & GetFragmentShader() const
T * Get() const
Returns a raw pointer to the instance, which may be NULL.
base::ReferentPtr< ShaderProgram >::Type ShaderProgramPtr
SharedPtr< ShaderInputRegistry > Type
const ShaderInputRegistryPtr & GetRegistry() const
Returns the ShaderInputRegistry used for the instance.
A Shader represents an OpenGL shader stage.
void SetFragmentShader(const ShaderPtr &shader)
Sets/returns the fragment shader stage.
base::ReferentPtr< ShaderInputRegistry >::Type ShaderInputRegistryPtr
Convenience typedef for shared pointer to a ShaderInputRegistry.
Base class for Shader and ShaderProgram objects.
bool IsConcurrent() const
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...
A WeakReferentPtr is a weak reference to an instance of some class derived from Referent.