本文整理汇总了C++中params::InterfaceGlRef::setPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGlRef::setPosition方法的具体用法?C++ InterfaceGlRef::setPosition怎么用?C++ InterfaceGlRef::setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params::InterfaceGlRef
的用法示例。
在下文中一共展示了InterfaceGlRef::setPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void ciApp::setup()
{
setWindowSize(1280, 720);
setFrameRate(60.f);
int maxVertUniformsVect;
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &maxVertUniformsVect);
mSize = 0;
mSizePrev = -1;
mSizeMax = 17;
mAmplifier = 1.f;
mExposure = 1.f;
mGamma = 2.2f;
printf("max uniform: %i, %i\n", maxVertUniformsVect, mSizeMax);
mParams = params::InterfaceGl::create(getWindow(), "App parameters", ivec2(250, 300));
mParams->setPosition(ivec2(20, 250));
mTexture = gl::Texture::create(loadImage(loadFile(data_path + "demo.png")));
mFbo = gl::Fbo::create(mTexture->getWidth(), mTexture->getHeight(), gl::Fbo::Format().colorTexture());
//mShader.setup("filterGaussianBlur");
filter = hb::GlslFilter::create(mTexture->getSize());
filter->setParams(mParams);
vector_blur.setup(getWindowSize());
vector_blur.setParams(mParams);
spout_receiver = hb::Receiver::create("Spout DX11 Sender");
//spout_receiver = hbSpoutReceiver::create("KidsLandSea");
spout_sender = hb::Sender::create("cinder_spout", mFbo->getWidth(), mFbo->getHeight());
#if 0
auto ctx = audio::Context::master();
// The InputDeviceNode is platform-specific, so you create it using a special method on the Context:
mInputDeviceNode = ctx->createInputDeviceNode();
// By providing an FFT size double that of the window size, we 'zero-pad' the analysis data, which gives
// an increase in resolution of the resulting spectrum data.
auto monitorFormat = audio::MonitorSpectralNode::Format().fftSize(2048).windowSize(1024);
mMonitorSpectralNode = ctx->makeNode(new audio::MonitorSpectralNode(monitorFormat));
mInputDeviceNode >> mMonitorSpectralNode;
// InputDeviceNode (and all InputNode subclasses) need to be enabled()'s to process audio. So does the Context:
mInputDeviceNode->enable();
ctx->enable();
#endif
}
示例2: update
void MASOSApp::update()
{
if (mAngle != oldAngle)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldAngle = mAngle;
if (scale != oldScale)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldScale = scale;
if (mTerminalVelocity != oldTerminalVelocity)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldTerminalVelocity = mTerminalVelocity;
if (mInitialVelocity != oldInitialVelocity)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldInitialVelocity =mInitialVelocity;
float tmp = mProjectileUnderTest.mPosition.y;
mProjectileUnderTest.update(mInitialVelocity, mAngle, mCurrentTime, mTerminalVelocity);
if (mProjectileUnderTest.mPosition.y > 0)
{
mProjectileUnderTest.mPosition.y = 0;
mIsPlaying = false;
}
if (tmp >= 0 && mProjectileUnderTest.mPosition.y >= 0)
{
mProjectileUnderTest.mPosition.y = 0;
mIsPlaying = false;
mCurrentTime = oldTime;
}
if (mProjectileUnderTest.mPosition.x < 0)
{
mProjectileUnderTest.mPosition.x = 0.f;
}
oldTime = mCurrentTime;
currX = mProjectileUnderTest.mPosition.x;
currY = -(mProjectileUnderTest.mPosition.y);
if (currY == -0) currY = 0;
mParams->setPosition(ivec2(0,0));
}
示例3: setup
void MPEBouncingBallApp::setup()
{
mClient = MPEClient::Create(this, USE_THREADED);
// 3D
mClient->setIsRendering3D(true);
mCamZ = -900.0f;
mClient->set3DCameraZ(mCamZ);
mFOV = mClient->get3DFieldOfView();
mAspectRatio = mClient->get3DAspectRatio();
mParams = params::InterfaceGl::create("Camera Params", vec2(getWindowSize()) * getWindowContentScale());
mParams->setPosition(ivec2(0,0));
mParams->addParam("Field of View", &mFOV).min(1.f).max(180.f).step(0.5);
mParams->addParam("Camera Z", &mCamZ).min(-1500.f).max(0.f);
mParams->addParam("Aspect Ratio", &mAspectRatio).min(0.f).max(2.f);
mParams->addButton("Reset", [&](){ this->buttonResetClicked(); } );
mParams->addButton("Render Mode (2D/3D)", [&](){ this->buttonRenderModeClicked(); } );
mFont = Font( "Helvetica Bold", 12 );
mTextureFont = gl::TextureFont::create( mFont );
}