本文整理汇总了C++中ci::gl::Texture::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Texture::getSize方法的具体用法?C++ Texture::getSize怎么用?C++ Texture::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ci::gl::Texture
的用法示例。
在下文中一共展示了Texture::getSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
// Render
void SkeletonBitmapApp::draw()
{
// Clear window
gl::setViewport( getWindowBounds() );
gl::clear();
gl::setMatricesWindow( getWindowSize() );
// We're capturing
if ( mKinect->isCapturing() && mTexture ) {
// Draw color image
gl::color( ColorAf::white() );
gl::draw( mTexture, getWindowBounds() );
// Scale skeleton to fit
gl::pushMatrices();
gl::scale( Vec2f( getWindowSize() ) / Vec2f( mTexture.getSize() ) );
// Iterate through skeletons
uint32_t i = 0;
for ( vector<Skeleton>::const_iterator skeletonIt = mSkeletons.cbegin(); skeletonIt != mSkeletons.cend(); ++skeletonIt, i++ ) {
// Set color
gl::color( mKinect->getUserColor( i ) );
// Draw bones and joints
for ( Skeleton::const_iterator boneIt = skeletonIt->cbegin(); boneIt != skeletonIt->cend(); ++boneIt ) {
// Get joint positions
const Bone& bone = boneIt->second;
Vec3f position = bone.getPosition();
Vec3f destination = skeletonIt->at( bone.getStartJoint() ).getPosition();
Vec2f positionScreen = Vec2f( mKinect->getSkeletonVideoPos( position ) );
Vec2f destinationSceen = Vec2f( mKinect->getSkeletonVideoPos( destination ) );
// Draw bone
gl::drawLine( positionScreen, destinationSceen );
// Draw joint
gl::drawSolidCircle( positionScreen, 10.0f, 16 );
}
}
gl::popMatrices();
}
}
示例2: resize
// Handles window resize
void UiApp::resize()
{
// Initialize buttons
float h = (float)getWindowHeight() * 0.333f;
float w = (float)getWindowWidth() * 0.25f;
Vec2f position( w, h );
position -= Vec2f( mButton[ 0 ].getSize() ) * 0.5f;
for ( size_t i = 0; i < 3; ++i, position.x += w ) {
mButtonPosition[ i ] = position;
mButtonState[ i ] = false;
}
// Initialize slider
position = Vec2f( w * 2.0f, h * 2.0f );
mTrackPosition = position - Vec2f( mTrack.getSize() ) * 0.5f;
mSliderPosition = mTrackPosition;
mSliderPosition.y -= 45.0f;
}