
are there any other examples / code snippets which i could look at to learn more about how to code FFGL plugins using openframeworks and xcode?
Code: Select all
testApp::testApp()
{
// add parameters
rotateX = 0.5;
addFloatParameter( "rotate X", // name of parameter ( as it will appear in host )
&rotateX, // address of the float this parameter will point to
-180.0f, // minimum value
180.0f // maximum value
);
rotateY = 0.5;
addFloatParameter("rotate Y", &rotateY, -180.0f, 180.0f);
rotateZ = 0.5;
addFloatParameter("rotate Z", &rotateZ, -180.0f, 180.0f);
scale = 0.5f;
addFloatParameter("scale", &scale, 0, 2.0f);
}
//--------------------------------------------------------------
void testApp::setup(){
}
//--------------------------------------------------------------
void testApp::update(){
ofBackground(100,100,100);
}
//--------------------------------------------------------------
void testApp::draw(){
// input textures from host are stored here
ofTexture * tex = inputTextures[0];
if( !tex )
return;
ofSetupScreen();
ofSetRectMode(OF_RECTMODE_CENTER);
ofTranslate(tex->getWidth()/2, tex->getHeight()/2, 0.0f);
ofRotate(rotateX, 1.0, 0.0, 0.0);
ofRotate(rotateY, 0.0, 1.0, 0.0);
ofRotate(rotateZ, 0.0, 0.0, 1.0);
ofScale(scale, scale, 1.0f);
tex->draw(0, 0);
}
Code: Select all
if( !tex )
return;
tex->draw(0, 0);