Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/lib/ffglquickstart/FFGLParamText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace ffglqs
{
std::shared_ptr< ParamText > ParamText::create( std::string name )
std::shared_ptr< ParamText > ParamText::Create( std::string name )
{
return create( std::move( name ), "" );
return Create( std::move( name ), "" );
}
std::shared_ptr< ParamText > ParamText::create( std::string name, std::string text )
std::shared_ptr< ParamText > ParamText::Create( std::string name, std::string text )
{
return std::make_shared< ParamText >( std::move( name ), text );
}
Expand Down
4 changes: 2 additions & 2 deletions source/lib/ffglquickstart/FFGLParamText.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace ffglqs
class ParamText : public Param
{
public:
static std::shared_ptr< ParamText > create( std::string name );
static std::shared_ptr< ParamText > create( std::string name, std::string text );
static std::shared_ptr< ParamText > Create( std::string name );
static std::shared_ptr< ParamText > Create( std::string name, std::string text );

ParamText( std::string name );
ParamText( std::string name, std::string text );
Expand Down
11 changes: 9 additions & 2 deletions source/lib/ffglquickstart/FFGLPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ std::string Plugin::CreateFragmentShader( std::string base )
{
fragmentShaderCode += "uniform bool " + params[ i ]->GetName() + ";\n";
}
else if( params[ i ]->GetType() != FF_TYPE_BUFFER )
else if( params[ i ]->GetType() != FF_TYPE_BUFFER && params[ i ]->GetType() != FF_TYPE_TEXT )
{
fragmentShaderCode += "uniform float " + params[ i ]->GetName() + ";\n";
}
Expand Down Expand Up @@ -157,7 +157,7 @@ void Plugin::SendParams( FFGLShader& shader )
{
shader.Set( params[ i ]->GetName().c_str(), (bool)params[ i ]->GetValue() );
}
else if( params[ i ]->GetType() != FF_TYPE_BUFFER )
else if( params[ i ]->GetType() != FF_TYPE_BUFFER && params[ i ]->GetType() != FF_TYPE_TEXT )
{
shader.Set( params[ i ]->GetName().c_str(), params[ i ]->GetValue() );
}
Expand Down Expand Up @@ -303,6 +303,13 @@ void Plugin::AddParam( std::shared_ptr< ParamFFT > param )
params.push_back( param );
}

void Plugin::AddParam( std::shared_ptr< ParamText > param )
{
unsigned int new_index = (unsigned int)params.size();
SetParamInfo( new_index, param->GetName().c_str(), param->GetType(), param->text.c_str() );
params.push_back( param );
}

void Plugin::AddHueColorParam( std::string name )
{
AddParam( Param::Create( name, FF_TYPE_HUE, 0. ) );
Expand Down
3 changes: 3 additions & 0 deletions source/lib/ffglquickstart/FFGLPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ class Plugin : public CFFGLPlugin
/// This function allows to create a Hue color param, for exemple in Resolume this will display a
/// color picker, which is very handy to choose your color.
/// \param name The name of the parameter to add
void AddParam( std::shared_ptr< ParamText > param );
/// This function handles the special case where the parameter is a ParamText
/// \param param The name of the parameter to add
void AddHueColorParam( std::string name );
/// This function allows to create a RGB color param, in Resolume it is displayed as three sliders for
/// each Red, Green and Blue.
Expand Down