本文整理汇总了C++中params::InterfaceGlRef::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGlRef::draw方法的具体用法?C++ InterfaceGlRef::draw怎么用?C++ InterfaceGlRef::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params::InterfaceGlRef
的用法示例。
在下文中一共展示了InterfaceGlRef::draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void ForestApp::draw()
{
gl::clear( Color::gray(0.9f) );
float wallWidth = getWindowWidth() * 0.75;
float wallHeight = wallWidth / mStrandBox.mBorderRect.getAspectRatio();
Vec2f wallSize(wallWidth, wallHeight);
Vec2f wallTopLeft = getWindowCenter() - wallSize/2;
// Wall coordinate system, Y=0 at bottom with +Y in growth direction
gl::pushModelView();
gl::translate(wallTopLeft.x, wallTopLeft.y + wallHeight);
gl::scale(wallWidth, -wallWidth);
// Drawing should be safe without acquiring the mutex (performance)
mStrandBox.draw();
mDots.draw();
mPanels.draw();
gl::popModelView();
if (mShowMatrix) {
mDots.drawAffinityMatrix();
}
mParams->draw();
}
示例2: draw
void TextParticlesApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
gl::color( 1, 1, 1 );
gl::enableAlphaBlending();
{
gl::ScopedMatrices scpMtrx;
// SET matrices so that by default, we are looking at a rect the size of the window
lookAtTexture( mCam, getWindowSize() );
gl::translate( mTextSize * vec2( -0.5 ) );
gl::ScopedDepth scpDepth( true );
// gl::ScopedColor scpColor( 1, 0, 0 );
// gl::drawStrokedRect( Rectf( 0, 0, mTextSize.x, mTextSize.y ) );
gl::color( Color::white() );
if( mActive ){
gl::ScopedGlslProg render( mRenderProg );
gl::ScopedVao vao( mAttributes[mSourceIndex] );
gl::context()->setDefaultShaderVars();
gl::drawArrays( GL_POINTS, 0, mTextParticleCount );
}else{
if( mString.length() > 0 )
gl::draw( mTextFbo->getColorTexture() );
}
}
mParams->draw();
}
示例3: draw
void OpenCVTemplateApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
if(imageTexture) {
unsigned int windowWidth = this->getWindow()->getWidth();
unsigned int windowHeight = this->getWindow()->getHeight();
gl::pushMatrices();
gl::translate((windowWidth-image.cols)/2, (windowHeight-image.rows)/2);
gl::draw(imageTexture);
gl::popMatrices();
}
if(frameTexture) {
gl::pushMatrices();
unsigned int windowWidth = this->getWindow()->getWidth();
unsigned int windowHeight = this->getWindow()->getHeight();
gl::translate((windowWidth-frameWidth)/2, (windowHeight-frameHeight)/2);
gl::draw(frameTexture);
if(featurePoints.size() > 0) {
gl::color(1,0,0);
for(auto& p : featurePoints) {
gl::drawSolidCircle(fromOcv(p), 1);
}
gl::color(1,1,1);
}
gl::popMatrices();
}
interface->draw();
}
示例4: draw
void TextboxApp::draw()
{
// clear out the window with black
gl::clear( Color( 0.15f, 0.15f, 0.15f ) );
gl::setMatricesWindow(app::getWindowSize());
glAlphaFunc(GL_GREATER, 0.0);
glEnable(GL_ALPHA_TEST);
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glPushMatrix();
glTranslatef(PADDING + mTextBox->getTopLeft().x,PADDING + mTextBox->getTopLeft().y,0);
glColor3f(1,1,1);
gl::draw(mTextBox->getTexture());
if(TEXT_BOX_DEBUG_DRAW){
mTextBox->debugDraw();
}
glPopMatrix();
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5); // reset what seems to be cinders default
mParams->draw();
}
示例5: draw
void cApp::draw(){
bOrtho ? mExp.beginOrtho( true ) : mExp.begin( camUi.getCamera() ); {
gl::clear();
gl::enableDepthRead();
gl::enableDepthWrite();
gl::enableAlphaBlending();
glPointSize(1);
glLineWidth(1);
if( !mExp.bRender && !mExp.bSnap ){ mt::drawCoordinate(10); }
for( int i=0; i<rms.size(); i++){
rms[rms.size()-i-1].draw();
}
norms.draw();
}mExp.end();
mExp.draw();
if(gui) gui->draw();
if( bStart && !bFall )frame++;
}
示例6: draw
void FlockingApp::draw()
{
gl::clear( Color( 0, 0, 0 ), true );
gl::enableDepthRead();
gl::enableDepthWrite();
// DRAW PARTICLES
mParticleController.draw();
// DRAW ZONE DIAGRAM
gl::disableDepthRead();
gl::disableDepthWrite();
gl::setMatricesWindow( getWindowSize() );
gl::pushModelView();
gl::translate( Vec3f( 117.0f, getWindowHeight() - 117.0f, 0.0f ) );
gl::color( ColorA( 0.25f, 0.25f, 1.0f, 1.0f ) );
gl::drawSolidCircle( Vec2f::zero(), mZoneRadius );
gl::color( ColorA( 1.0f, 1.0f, 1.0f, 0.25f ) );
gl::drawStrokedCircle( Vec2f::zero(), 100.0f );
gl::popModelView();
// DRAW PARAMS WINDOW
mParams->draw();
}
示例7: draw
void WaterSimulationApp::draw(){
gl::clear( Color( 0.11f, 0.13f, 0.1f ) );
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
mParams->draw();
gl::setMatrices(mMayaCam.getCamera());
if(mDrawBox){
glColor4f(0.2, 0.4, 0.5, 1);//orange
gl::drawStrokedCube(boxCenter,boxDimension);
}
if(mDrawGravity){
glColor4f(1.0f,0.3f,0.0f,0.5f);//red
if(mDrawGravity)glColor4f(0.0f,1.0f,0.5f,1);//green
gl::drawVector(boxCenter,(boxCenter-gravity),3.0f,1.0f);
}
//draw random force
if(mDrawForce){
if(randomForce.lengthSquared()!=0){
glColor4f(1.0f,0.0f,0.0f,1);
gl::drawVector(randomForceX,randomForce+randomForceX,1.0f,0.5f);
}
}
fluidsys->draw();
}
示例8: draw
void ciApp::draw()
{
gl::clear();
gl::ScopedColor white(Color::white());
auto get_center_rect = [&](Area area) ->Rectf { return Rectf(area).getCenteredFit(getWindowBounds(), true); };
{
//auto tex = filter->getTexture();
auto tex = vector_blur.getTexture();
gl::draw(tex, get_center_rect(tex->getBounds()));
}
{
gl::ScopedMatrices scpMatrix;
gl::scale(0.2f, 0.2f);
gl::draw(mTexture);
}
vector_blur.drawDebug(vec2(0, 0), 0.2f);
mParams->draw();
{
TextLayout infoFps;
infoFps.clear(ColorA(0.2f, 0.2f, 0.2f, 0.5f));
infoFps.setColor(Color::white());
infoFps.setFont(Font("Arial", 16));
infoFps.setBorder(4, 2);
infoFps.addLine("App Framerate: " + tostr(getAverageFps(), 1));
auto tex = gl::Texture::create(infoFps.render(true));
gl::draw(tex, ivec2(20, getWindowHeight() - tex->getHeight() - 20));
}
}
示例9: scopedDepth
void ImageBasedLighting_05App::draw()
{
gl::clear( Color( 0, 0, 0 ) );
gl::setMatrices( mCam );
// enable depth testing
gl::ScopedDepth scopedDepth( true );
// bind the cubemap textures
gl::ScopedTextureBind scopedTexBind0( mTextureRadianceMap, 0 );
gl::ScopedTextureBind scopedTexBind1( mTextureIrradianceMap, 1 );
gl::ScopedTextureBind scopedTexBind2( mNormalMap, 2 );
gl::ScopedTextureBind scopedTexBind3( mRoughnessMap, 3 );
gl::ScopedTextureBind scopedTexBind4( mMetallicMap, 4 );
gl::ScopedTextureBind scopedTexBind5( mColorMap, 5 );
gl::ScopedTextureBind scopedTexBind6( mAOMap, 6 );
gl::ScopedTextureBind scopedTexBind7( mSpecularMap, 7 );
auto shader = mBatchModel->getGlslProg();
shader->uniform( "uRadianceMap", 0 );
shader->uniform( "uIrradianceMap", 1 );
shader->uniform( "uNormalMap", 2 );
shader->uniform( "uRoughnessMap", 3 );
shader->uniform( "uMetallicMap", 4 );
shader->uniform( "uColorMap", 5 );
shader->uniform( "uAOMap", 6 );
shader->uniform( "uSpecularMap", 7);
// sends the base color, the specular opacity,
// the light position, color and radius to the shader
// shader->uniform( "uBaseColor", mBaseColor );
// shader->uniform( "uSpecular", mSpecular );
// shader->uniform( "uNormalMapScale",mNormalMapScale);
// sends the tone-mapping uniforms
shader->uniform( "uExposure", mExposure );
shader->uniform( "uGamma", mGamma );
// render a grid of sphere with different roughness/metallic values and colors
{
// shader->uniform( "uRoughness", mRoughness );
// shader->uniform( "uRoughness4", pow( mRoughness, 4.0f ) );
// shader->uniform( "uMetallic", mMetallic );
mBatchModel->draw();
}
// render skybox
shader = mBatchSkyBox->getGlslProg();
shader->uniform( "uExposure", mExposure );
shader->uniform( "uGamma", mGamma );
mBatchSkyBox->draw();
// DRAW SETTINGS
_params->draw();
}
示例10: draw
void ThresholdTestApp::draw()
{
gl::clear( Color( 0.1f, 0.1f, 0.15f ) );
if( mTexture )
gl::draw( mTexture );
mParams->draw();
}
示例11: drawLinearScaleWindow
void ImageRetargetingApp::drawLinearScaleWindow()
{
gl::clear( Color( 0.f, 0.f, 0.f ) );
if( originalTexture ) {
gl::draw(originalTexture, *linearScaleRec);
}
linearScalingParams->draw();
}
示例12: draw
void AudioObjApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
gl::enableAlphaBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
gl::pushMatrices();
gl::setMatrices( mMayaCam.getCamera() );
if ( mFeature && mFeatureTex )
{
mShader->bind();
mFeatureTex.enableAndBind();
mShader->uniform( "dataTex", 0 );
mShader->uniform( "texWidth", (float)mFeatureTex.getWidth() );
mShader->uniform( "texHeight", (float)mFeatureTex.getHeight() );
mShader->uniform( "soundDataSize", (float)mFeature->getSize() );
mShader->uniform( "spread", mFeatureSpread );
mShader->uniform( "spreadOffset", mFeatureSpreadOffset );
mShader->uniform( "time", (float)getElapsedSeconds() );
mShader->uniform( "tintColor", mObjColor );
}
if ( mRenderWireframe )
gl::enableWireframe();
gl::color( Color(1.0f, 0.0f, 0.0f ) );
if ( mVbo )
gl::draw( mVbo );
if ( mRenderWireframe )
gl::disableWireframe();
mShader->unbind();
mFeatureTex.unbind();
gl::color( Color::white() );
// gl::drawCoordinateFrame();
gl::popMatrices();
gl::disableDepthRead();
gl::disableDepthWrite();
gl::setMatricesWindow( getWindowSize() );
ciXtractReceiver::drawData( mFeature, Rectf( 15, getWindowHeight() - 150, 255, getWindowHeight() - 35 ) );
gl::draw( mFeatureSurf );
mParams->draw();
}
示例13: draw
void GeometryApp::draw()
{
// Prepare for drawing.
gl::clear();
gl::setMatrices( mCamera );
// Draw the grid.
if( mShowGrid && mGrid ) {
gl::ScopedGlslProg scopedGlslProg( gl::context()->getStockShader( gl::ShaderDef().color() ) );
// draw the coordinate frame with length 2.
gl::drawCoordinateFrame( 2 );
mGrid->draw();
}
if( mPrimitive ) {
gl::ScopedTextureBind scopedTextureBind( mTexture );
mPhongShader->uniform( "uTexturingMode", mTexturingMode );
// Rotate it slowly around the y-axis.
gl::ScopedModelMatrix matScope;
gl::rotate( float( getElapsedSeconds() / 5 ), 0, 1, 0 );
// Draw the normals.
if( mShowNormals && mPrimitiveNormalLines ) {
gl::ScopedColor colorScope( Color( 1, 1, 0 ) );
mPrimitiveNormalLines->draw();
}
// Draw the primitive.
gl::ScopedColor colorScope( Color( 0.7f, 0.5f, 0.3f ) );
if( mViewMode == WIREFRAME ) {
// We're using alpha blending, so render the back side first.
gl::ScopedAlphaBlend blendScope( false );
gl::ScopedFaceCulling cullScope( true, GL_FRONT );
mWireframeShader->uniform( "uBrightness", 0.5f );
mPrimitiveWireframe->draw();
// Now render the front side.
gl::cullFace( GL_BACK );
mWireframeShader->uniform( "uBrightness", 1.0f );
mPrimitiveWireframe->draw();
}
else
mPrimitive->draw();
}
// Render the parameter window.
#if ! defined( CINDER_GL_ES )
if( mParams )
mParams->draw();
#endif
}
示例14: draw
void hidTestApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
gl::setMatricesWindow( getWindowSize() );
mInteractionZonesDebug->draw();
drawKey();
mParams->draw();
}
示例15: draw
void RDiffusionApp::draw()
{
gl::clear();
gl::setMatricesWindow( getWindowSize() );
gl::viewport( getWindowSize() );
{
gl::ScopedTextureBind bind( mFBOs[mCurrentFBO]->getColorTexture() );
gl::drawSolidRect( getWindowBounds() );
}
mParams->draw();
}