ofFFGLPlugin::ofFFGLPlugin( ofFFGLApp * app, int minInputs, int maxInputs )
{
	// Input properties
	SetMinInputs(minInputs);
	SetMaxInputs(maxInputs);
	
	_app = app;

	initParameters();
}
FFGLGeometryMixer::FFGLGeometryMixer(void):CFreeFrameGLPlugin()
{
	// Input properties
	SetMinInputs(2);
	SetMaxInputs(2);

	// parameters:
	SetParamInfo(FFPARAM_Blend, "Blend", FF_TYPE_STANDARD, 0.5f);	
	m_blend = 0.5f;
}
示例#3
0
////////////////////////////////////////////////////////////////////////////////////////////////////
//  Constructor and destructor
////////////////////////////////////////////////////////////////////////////////////////////////////
SpoutSenderSDK2::SpoutSenderSDK2() : CFreeFrameGLPlugin(), m_initResources(1), m_maxCoordsLocation(-1)
{
	// Input properties
	SetMinInputs(1);
	SetMaxInputs(1);

	/*
	// Debug console window so printf works
	FILE* pCout;
	AllocConsole();
	freopen_s(&pCout, "CONOUT$", "w", stdout); 
	printf("SpoutSender2 Vers 3.016\n");
	*/

	// initial values

	#ifdef MemoryShareMode
	bMemoryMode = true; // Compilation memoryshare
	#else
	bMemoryMode = false;
	#endif

	#ifdef DX9Mode
	bDX9mode          = true; // DirectX 9 rather than default DirectX 11
	#else
	bDX9mode          = false;
	#endif

	m_Width           = 0;
	m_Height          = 0;
	UserSenderName[0] = 0;
	SenderName[0]     = 0;

	// Set parameters if not memoryshare mode
	#ifndef MemoryShareMode
	SetParamInfo(FFPARAM_SharingName,   "Sender Name",      FF_TYPE_TEXT,    "");
	SetParamInfo(FFPARAM_Update,        "Update",           FF_TYPE_EVENT,   false );
	#endif

	// For memory mode, tell Spout to use memoryshare 
	// Default is false or detected according to compatibility
	if(bMemoryMode) {
		sender.SetMemoryShareMode(true);
		// Give it a user name for ProcessOpenGL
		strcpy_s(UserSenderName, 256, "MemoryShare"); 
	}

	// Set DirectX mode depending on DX9 flag
	if(bDX9mode) 
		sender.SetDX9(true);
	else 
	    sender.SetDX9(false);


}
示例#4
0
ShaderPlugin::ShaderPlugin()
: CFreeFrameGLPlugin()
, m_initResources(1)
{
	SetMinInputs(0);
	SetMaxInputs(0);
    SetTimeSupported(true);
    m_HostSupportsSetTime = false;
    
    m_time = 0;
    m_timeLocation = -1;
    
    m_resolution[0] = 0;
    m_resolution[1] = 0;
    m_resolution[2] = 0;
    m_resolutionLocation = -1;

    // To FFGLize an arbitrary shader, replace shader_frag.glsl and the parameters below.
    // Parameter(uniform name, minimum value, maximum value, default value)
    // Standard parameters/float uniforms only for now.
    
    m_parameters.push_back(Parameter("sVert", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("sHorizon", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("sDiag", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("sDiagAlt", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("sArms", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("sRings", 0.0, 1.0, 1.0));
    m_parameters.push_back(Parameter("sSpiral", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("sSpiralAlt", 0.0, 1.0, 0.0));
    m_parameters.push_back(Parameter("vertPeriod", -20.0, 10.0, 4.0));
    m_parameters.push_back(Parameter("horizonPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("diagPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("diagAltPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("armPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("ringPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("spiralPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("spiralAltPeriod", -20.0, 20.0, 4.0));
    m_parameters.push_back(Parameter("numVert", 0.0, 100.0, 40.0));
    m_parameters.push_back(Parameter("numHorizon", 0.0, 100.0, 40.0));
    m_parameters.push_back(Parameter("numDiag", 0.0, 100.0, 40.0));
    m_parameters.push_back(Parameter("numDiagAlt", 0.0, 100.0, 40.0));
    m_parameters.push_back(Parameter("numArms", 0.0, 24.0, 4.0));
    m_parameters.push_back(Parameter("numRings", 0.0, 24.0, 4.0));
    m_parameters.push_back(Parameter("numSpiral", 0.0, 24.0, 4.0));
    m_parameters.push_back(Parameter("numSpiralAlt", 0.0, 24.0, 4.0));
    
    for (int ii = 0; ii < m_parameters.size(); ii++) {
        auto p = m_parameters[ii];
        SetParamInfo(ii, p.Name.c_str(), FF_TYPE_STANDARD, p.Value);
    }
}
示例#5
0
FFGLLumaKey::FFGLLumaKey()
:CFreeFrameGLPlugin(),
 m_initResources(1),
 m_inputTextureLocation1(-1),
 m_inputTextureLocation2(-1),
 m_maxCoordsLocation(-1),
 m_LumaLocation(-1)
{
	// Input properties
	SetMinInputs(2);
	SetMaxInputs(2);

	// Parameters
	SetParamInfo(FFPARAM_Luma, "Luma", FF_TYPE_STANDARD, 0.5f);
	m_Luma = 0.5f;
}
示例#6
0
FFGLHeat::FFGLHeat()
:CFreeFrameGLPlugin(),
 m_initResources(1),
 m_heatTextureId(0),
 m_inputTextureLocation(-1),
 m_heatTextureLocation(-1),
 m_maxCoordsLocation(-1),
 m_heatAmountLocation(-1)
{
	// Input properties
	SetMinInputs(1);
	SetMaxInputs(1);

	// Parameters
	SetParamInfo(FFPARAM_Heat, "Heat", FF_TYPE_STANDARD, 0.5f);
	m_Heat = 0.5f;
}
示例#7
0
FFGLTile::FFGLTile()
:CFreeFrameGLPlugin(),
 m_initResources(1),
 m_inputTextureLocation(-1),
 m_maxCoordsLocation(-1),
 m_tileAmountLocation(-1)
{
	// Input properties
	SetMinInputs(1);
	SetMaxInputs(1);

	// Parameters
	SetParamInfo(FFPARAM_TileX, "TileX", FF_TYPE_STANDARD, 0.5f);
	m_TileX = 0.5f;

	SetParamInfo(FFPARAM_TileY, "TileY", FF_TYPE_STANDARD, 0.5f);
	m_TileY = 0.5f;
}
示例#8
0
FFGLStatic::FFGLStatic()
:CFreeFrameGLPlugin(),
 m_initResources(1)
{
	// Input properties
	SetMinInputs(1);
	SetMaxInputs(1);
	SetTimeSupported(true);

	init_time(&t0);
#ifdef _WIN32
	srand(GetTickCount());
#else
	srand(time(NULL));
#endif

	// parameters:
	SetParamInfo(FFPARAM_Mode, "Mode", FF_TYPE_STANDARD, 0.5f);	
	m_mode = 0.5f;
}
FFGLVolumeRendering::FFGLVolumeRendering():CFreeFrameGLPlugin()
{
	// Input properties
	SetMinInputs(1);
	SetMaxInputs(1);

	// Parameters
	this->fXAngle = 0.5f;
	this->fYAngle = 0.5f;
	this->fScaleValue = 1.0f;

	this->fDistance = 1.0f;
	this->fPlanesCount = 0.5f;
	this->iPlanesCount = (float)MaxPlanes * this->fPlanesCount;

	this->fAngle = 0.5f;
	this->fScaleValue = 1.0f;

	this->fIsPerspective = 0.0f;

	SetParamInfo( FFPARAM_VALUE1_IS_PERSPECTIVE, "Perspective(?)", FF_TYPE_BOOLEAN, this->fIsPerspective);
	
	SetParamInfo( FFPARAM_VALUE2_SCALE , "Scale", FF_TYPE_STANDARD, this->fScaleValue);
	
	SetParamInfo( FFPARAM_VALUE3_RX  , "X angle", FF_TYPE_STANDARD, this->fXAngle);
	SetParamInfo( FFPARAM_VALUE4_RY  , "Y angle", FF_TYPE_STANDARD, this->fYAngle);

	SetParamInfo( FFPARAM_VALUE5_DISTANCE, "Volume level", FF_TYPE_STANDARD, this->fDistance);
	SetParamInfo( FFPARAM_VALUE6_PCOUNT  , "Planes count", FF_TYPE_STANDARD, this->fPlanesCount);

	SetParamInfo(FFPARAM_VALUE7_FOVY, "FOVY", FF_TYPE_STANDARD, this->fAngle);

	this->isGeometryRebuildNeeded = true;

	this->VertexData = NULL;
	this->TexcoordData = NULL;

}
示例#10
0
FFGLGradients::FFGLGradients()
:CFreeFrameGLPlugin()
{

	// Input properties
	SetMinInputs(0);
	SetMaxInputs(0);

	// Parameters
	SetParamInfo(FFPARAM_Hue1, "Hue 1", FF_TYPE_STANDARD, 0.0f);
	m_Hue1 = 0.0f;

	SetParamInfo(FFPARAM_Hue2, "Hue 2", FF_TYPE_STANDARD, 0.5f);
	m_Hue2 = 0.5f;

	SetParamInfo(FFPARAM_Saturation, "Saturation", FF_TYPE_STANDARD, 1.0f);
	m_Saturation = 1.0f;

	SetParamInfo(FFPARAM_Brightness, "Brightness", FF_TYPE_STANDARD, 1.0f);
	m_Brightness = 1.0f;



}
示例#11
0
PaletteFFHost::PaletteFFHost(std::string defaultsfile) : CFreeFrameGLPlugin(), PaletteHost(defaultsfile)
{
	NosuchDebug(1,"PaletteFFHost is being constructed.");
	SetMinInputs(1);
	SetMaxInputs(1);
}
示例#12
0
/////////////////////////////////
//  Constructor and destructor //
/////////////////////////////////
SpoutReceiverSDK2::SpoutReceiverSDK2()
:CFreeFrameGLPlugin(),
 m_initResources(1),
 m_maxCoordsLocation(-1)
{

	HMODULE module;
	char path[MAX_PATH];

	/*
	// Debug console window so printf works
	FILE* pCout;
	AllocConsole();
	freopen_s(&pCout, "CONOUT$", "w", stdout); 
	#ifdef DX9Mode
	printf("SpoutReceiver2 DX9 Vers 3.025\n");
	#else
	printf("SpoutReceiver2 DX11 Vers 3.025\n");
	#endif
	*/

	// Input properties - this is a source and has no inputs
	SetMinInputs(0);
	SetMaxInputs(0);
	
	//
	// ======== initial values ========
	//

	#ifdef DX9Mode
	bDX9mode          = true;   // DirectX 9 mode rather than default DirectX 11
	#else
	bDX9mode          = false;
	#endif

	bInitialized      = false;  // not initialized yet by either means
	bAspect           = false;  // preserve aspect ratio of received texture in draw
	bUseActive        = true;   // connect to the active sender
	bStarted          = false;  // Do not allow a starting cycle

	UserSenderName[0] = 0;      // User entered sender name
	g_Width	          = 512;
	g_Height          = 512;    // arbitrary initial image size
	myTexture         = 0;      // only used for memoryshare mode

	//
	// Parameters
	//
	// Memoryshare define
	// if set to true (memory share only), it connects as memory share
	// and there is no user option to select a sender
	// default is false (automatic)
	#ifndef MemoryShareMode
	SetParamInfo(FFPARAM_SharingName, "Sender Name",   FF_TYPE_TEXT, "");
	SetParamInfo(FFPARAM_Update,      "Update",        FF_TYPE_EVENT, false );
	SetParamInfo(FFPARAM_Select,      "Select",        FF_TYPE_EVENT, false );
	bMemoryMode = false;
	#else
	bMemoryMode = true;
	#endif
	SetParamInfo(FFPARAM_Aspect,       "Aspect",       FF_TYPE_BOOLEAN, false );

	// For memory mode, tell Spout to use memoryshare
	if(bMemoryMode) {
		receiver.SetMemoryShareMode();
		// Give it an arbitrary user name for ProcessOpenGL
		strcpy_s(UserSenderName, 256, "0x8e14549a"); 
	}

	// Set DirectX mode depending on DX9 flag
	if(bDX9mode) 
		receiver.SetDX9(true);
	else 
	    receiver.SetDX9(false);

	// Find the host executable name
	module = GetModuleHandle(NULL);
	GetModuleFileNameA(module, path, MAX_PATH);
	_splitpath_s(path, NULL, 0, NULL, 0, HostName, MAX_PATH, NULL, 0);
	
	// Isadora and Resolume act on button down
	// Isadora activates all parameters on plugin load, so allow one cycle for starting.
	// Magic reacts on button-up, so when the dll loads the parameters are not activated. 
	// Magic and default Windows apps act on button up so all is OK.
	if(strstr(HostName, "Avenue") == 0 || strstr(HostName, "Arena") == 0 || strstr(HostName, "Isadora") == 0) {
		bStarted = false;
	}
	else {
		bStarted = true;
	}

}