本文整理汇总了C++中params::InterfaceGl::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGl::draw方法的具体用法?C++ InterfaceGl::draw怎么用?C++ InterfaceGl::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params::InterfaceGl
的用法示例。
在下文中一共展示了InterfaceGl::draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void LookAroundYouApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
// set up the camera
gl::pushMatrices();
gl::setMatrices( mMayaCam.getCamera() );
for(int i=0; i<mBoids.size(); i++) {
mBoids[i]->draw();
}
gl::drawCoordinateFrame( 6.0f );
gl::popMatrices();
// Draw the interface
mParams.draw();
float pos = music->getPlayheadNorm();
Rectf bar(0, 0, app::getWindowWidth()*pos, 10);
gl::drawSolidRect(bar);
}
示例2: draw
void PaintingBeingsApp::draw()
{
gl::clear(ColorAf::gray(0.6f));
gl::setViewport(getWindowBounds());
gl::setMatrices(_camera);
glMultMatrixf(_arcball.getQuat());
if (_showWireFrame)
gl::enableWireframe();
else
gl::disableWireframe();
if (_launchAlgoGen)
{
if (!_showImageBeing)
{
_image.getTexture().enableAndBind();
gl::draw(_image.getTexture(), _rectangleTextutre);
_image.getTexture().unbind();
gl::Texture textureAlgoGen = _algoGen.getBestImage();
textureAlgoGen.enableAndBind();
gl::draw(textureAlgoGen, _rectangleAlgoGen);
textureAlgoGen.unbind();
}
else
{
_imageBeing.draw(_algoGen.getBestImage());
}
}
_params.draw();
}
示例3: draw
void AnotherSandboxProjectApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
glUseProgram(_drawingProgram);
glBindVertexArray(_drawingVAO);
glBindBuffer(GL_ARRAY_BUFFER, _drawingVBO);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_BUFFER, _gridTex);
glBindSampler(0, 0);
glProgramUniform2f(_drawingProgram, _drawingScreenSizeLoc, (GLfloat)getWindowWidth(), (GLfloat)getWindowHeight());
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
glUseProgram(0);
vec2 cellRectSize = vec2((float)getWindowWidth() / (float)_DSPController->getGridSize().x, (float)getWindowHeight() / (float)_DSPController->getGridSize().x);
ivec2 mouseCell = (ivec2)((vec2)getMousePos() / cellRectSize);
vec2 mouseCellPoint = (vec2)mouseCell * cellRectSize;
gl::color(1.0, 0.0, 0.0);
gl::drawSolidRect(Rectf(mouseCellPoint, mouseCellPoint + cellRectSize));
_params.draw();
}
示例4: draw
void ArmyDemoApp::draw()
{
gl::clear( Color::black() );
gl::setMatrices( mCamera );
gl::translate( 0, -5.0f, 0.0f );
gl::scale( vec3( 0.1f ) );
if ( mEnableWireframe )
gl::enableWireframe();
for(int i=0; i < ROW_LEN; ++i) {
for(int j=0; j < ROW_LEN; ++j ) {
gl::pushModelMatrix();
gl::translate(SPACING * (i - 0.5f * ROW_LEN), 0, SPACING * (j - 0.5f * ROW_LEN));
mSkeletalMesh->setPose( mTime + 2.0f*( i * j )/NUM_MONSTERS );
if( mDrawMesh ) {
model::Renderer::draw( mSkeletalMesh );
}
if( mDrawSkeleton) {
model::Renderer::draw( mSkeletalMesh->getSkeleton() );
}
gl::popModelMatrix();
}
}
if ( mEnableWireframe )
gl::disableWireframe();
mParams.draw();
}
示例5: draw
void ColorTilesApp::draw()
{
gl::clear(Color(0, 0, 0));
gl::setMatrices(camera_);
gl::rotate(sceneRotation_);
std::for_each(tiles_.begin(), tiles_.end(), std::mem_fun(&Tile::draw));
params_.draw();
}
示例6: draw
void TestbedApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
settings.hz = settingsHz;
test->Step(&settings);
// Update the state of the particle parameter.
bool restartTest;
const bool changed = particleParameter.Changed(&restartTest);
B2_NOT_USED(changed);
test->DrawTitle(entry->name);
#if ! defined( CINDER_GL_ES )
mParams.draw();
#else
gl::color( 0.6f, 0.6f, 0.7f );
gl::drawSolidRect( mLeftButton );
gl::drawSolidRect( mRightButton );
#endif
if (testSelection != testIndex || restartTest)
{
fullscreenUI.Reset();
if (!restartTest) particleParameter.Reset();
testIndex = testSelection;
delete test;
entry = g_testEntries + testIndex;
test = entry->createFcn();
viewZoom = test->GetDefaultViewZoom();
settings.viewCenter.Set(0.0f, 20.0f * viewZoom);
resizeView( width, height );
}
// print world step time stats every 600 frames
static int s_printCount = 0;
static b2Stat st;
st.Record(settings.stepTimeOut);
const int STAT_PRINT_INTERVAL = 600;
if( settings.printStepTimeStats && st.GetCount() == STAT_PRINT_INTERVAL ) {
console() << "World Step Time samples "
<< s_printCount*STAT_PRINT_INTERVAL << "-" << (s_printCount+1)*STAT_PRINT_INTERVAL-1 << ": "
<< st.GetMin() << "min " << st.GetMax() << "max " << st.GetMean() << "avg (ms)" << std::endl;
s_printCount++;
}
}
示例7: draw
void ocvWarpApp::draw()
{
gl::clear( Color( 1, 1, 1 ) );
gl::color( Color( 1, 1, 1 ) );
updateImage();
gl::draw( mTexture );
gl::color( Color( 1, 1, 0 ) );
gl::drawSolidCircle( mRotationCenter, 4.0f );
mParams.draw();
}
示例8: Color
void f6_structure::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
if (mParamsVisible)
mParams.draw();
if (mParticlesVisible)
{
for (int i = 0; i < pss.size(); i++)
pss[i].draw(mMousePosition);
}
}
示例9: draw
void SmilesApp::draw()
{
gl::enableAlphaBlending();
gl::clear( Color::black() );
gl::color(1.0f, 1.0f, 1.0f);
// draw webcam capture
if( !mCapture || !mSurface )
return;
gl::draw( gl::Texture(mSurface) );
if(mGreyChannel){
gl::pushMatrices();{
gl::translate(mSmileRect.getUpperLeft());
gl::draw( gl::Texture(mGreyChannel) );
}gl::popMatrices();
}
// draw rect that actually gets analysed:
gl::color(ColorA(0.0f, 1.0f, 0.0f, 1.0f));
gl::drawStrokedRect(mSmileRect);
gl::drawStrokedCircle(mSmileRect.getUpperLeft(), 10);
gl::drawStrokedCircle(mSmileRect.getUpperRight(), 10);
gl::drawStrokedCircle(mSmileRect.getLowerLeft(), 10);
gl::drawStrokedCircle(mSmileRect.getLowerRight(), 10);
//draw mSmileThreshold
gl::pushMatrices();{
gl::color(ColorA(1.0f, 0.0f, 0.0f, 0.3f));
gl::drawSolidRect(Rectf( 0, (1-mSmileThreshold)*getWindowHeight(), getWindowWidth(), getWindowHeight() ) );
gl::drawStrokedRect( Rectf(0, 0, getWindowWidth(), getWindowHeight() ) );
}gl::popMatrices();
//draw faces
if(!mFaces.empty()){
gl::pushMatrices();{
gl::translate(mSmileRect.getUpperLeft());
gl::color(1.0f, 1.0f, 1.0f);
for(list<VisualObject *>::iterator it = mFaces.begin(); it != mFaces.end(); ++it) {
mFace = static_cast<FaceObject*>(*it);
gl::drawStrokedRect(Rectf(mFace->x, mFace->y, mFace->x+mFace->xSize, mFace->y+mFace->ySize ));
}
}gl::popMatrices();
}
mParams.draw();
}
示例10: chan
void Fluid2DBasicApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
Channel32f chan( mFluid2D.resX(), mFluid2D.resY(), mFluid2D.resX()*sizeof(float), 1, const_cast<float*>( mFluid2D.density().data() ) );
if( ! mTex ) {
mTex = gl::Texture( chan );
} else {
mTex.update( chan );
}
gl::color( Color( 1, 1, 1 ) );
gl::draw( mTex, getWindowBounds() );
mParams.draw();
}
示例11: draw
void PolygonBooleanApp::draw()
{
gl::clear( Color( 0.24f, 0.24f, 0.24f ) );
gl::color( ColorA( 0.25f, 0.5f, 1.0f, 0.15f ) );
gl::draw( *mPolyAMesh );
gl::color( ColorA( 0.25f, 1.0f, 0.5f, 0.15f ) );
gl::draw( *mPolyBMesh );
gl::lineWidth( 2.0f );
gl::color( ColorA( 1.0f, 0.5f, 0.25f, 1.0f ) );
for( size_t c = 0; c < mPolyResult.size(); ++c )
gl::draw( mPolyResult[c] );
mParams.draw();
}
示例12: draw
void _TBOX_PREFIX_App::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
// set up the camera
gl::pushMatrices();
gl::setMatrices( mMayaCam.getCamera() );
Vec3f size = 5.0f * Vec3f::one();
gl::drawColorCube( 0.5f * size, size );
gl::drawCoordinateFrame( 6.0f );
gl::popMatrices();
// Draw the interface
mParams.draw();
}
示例13: draw
void ArtkpApp::draw()
{
gl::clear( Color::black() );
gl::disableDepthRead();
gl::disableDepthWrite();
// draws camera image
gl::setViewport( getWindowBounds() );
gl::setMatricesWindow( getWindowSize() );
gl::color( Color::white() );
Area outputArea = Area::proportionalFit( Area( 0, 0, CAPTURE_WIDTH, CAPTURE_HEIGHT ), getWindowBounds(), true, true );
if ( mCaptTexture )
gl::draw( mCaptTexture, outputArea );
// places a cube on each detected marker
gl::enableDepthRead();
gl::enableDepthWrite();
gl::setViewport( outputArea );
// sets the projection matrix
mArTracker.setProjection();
// scales the pattern according th the pattern width
Vec3d patternScale = Vec3d::one() * mArTracker.getOptions().getPatternWidth();
for ( int i = 0; i < mArTracker.getNumMarkers(); i++ )
{
// id -1 means unknown marker, false positive
if ( mArTracker.getMarkerId( i ) == -1 )
continue;
// sets the modelview matrix of the i'th marker
mArTracker.setModelView( i );
gl::scale( patternScale );
gl::translate( Vec3f( 0.f, .0f, .5f ) ); // places the cube on the marker instead of the center
gl::drawColorCube( Vec3f::zero(), Vec3f::one() );
}
mParams.draw();
}
示例14: draw
void TriangulationApp::draw()
{
if( mOldPrecision != mPrecision )
recalcMesh();
gl::clear();
gl::pushModelView();
gl::translate( getWindowCenter() * Vec2f( 0.8f, 1.2f ) );
gl::scale( Vec3f( mZoom, mZoom, mZoom ) );
gl::color( Color( 0.8f, 0.4f, 0.0f ) );
gl::draw( mVboMesh );
if( mDrawWireframe ) {
gl::enableWireframe();
gl::color( Color::white() );
gl::draw( mVboMesh );
gl::disableWireframe();
}
gl::popModelView();
mParams.draw();
}
示例15: draw
void KaleidoscopeApp::draw()
{
gl::clear();
gl::setViewport( getWindowBounds() );
gl::setMatricesWindow( getWindowSize() );
if ( mShader )
{
mShader.bind();
mShader.uniform( "center", mCenter );
mShader.uniform( "numReflectionLines", mNumReflectionLines );
mShader.uniform( "rotation", mRotation );
mShader.uniform( "txt", 0 );
}
if ( mTexture )
gl::draw( mTexture, getWindowBounds() );
if ( mShader )
mShader.unbind();
mParams.draw();
}