Ion: gfx/shaderprogram.h Source File
18 #ifndef ION_GFX_SHADERPROGRAM_H_
19 #define ION_GFX_SHADERPROGRAM_H_
42 kVertexShaderChanged = kNumBaseChanges,
44 kNumChanges
55 if (Shader* old_shader = vertex_shader_.Get().Get())
56 old_shader->RemoveReceiver(this);
57 vertex_shader_.Set(shader);
58 if (shader.Get())
62 return vertex_shader_.Get();
67 if (Shader* old_shader = fragment_shader_.Get().Get())
68 old_shader->RemoveReceiver(this);
69 fragment_shader_.Set(shader);
70 if (shader.Get())
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,
112 void OnNotify(const base::Notifier* notifier) override;
114 Field<ShaderPtr> vertex_shader_;
115 Field<ShaderPtr> fragment_shader_;
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
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 WeakReferentPtr is a weak reference to an instance of some class derived from Referent.