本文整理汇总了C++中ci::gl::Texture::setMinFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ Texture::setMinFilter方法的具体用法?C++ Texture::setMinFilter怎么用?C++ Texture::setMinFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ci::gl::Texture
的用法示例。
在下文中一共展示了Texture::setMinFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
// Set up
void UiApp::setup()
{
glShadeModel( GL_FLAT );
// Set up camera
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 45.0f, 0.01f, 1000.0f );
mOffset = Vec3f( 240.0f, -480.0f, 0.0f );
// Start device
mLeap = Device::create();
mLeap->addCallback( &UiApp::onFrame, this );
// Load cursor textures
for ( size_t i = 0; i < 3; ++i ) {
switch ( (CursorType)i ) {
case CursorType::GRAB:
mTexture[ i ] = gl::Texture( loadImage( loadResource( RES_TEX_GRAB ) ) );
break;
case CursorType::HAND:
mTexture[ i ] = gl::Texture( loadImage( loadResource( RES_TEX_HAND ) ) );
break;
case CursorType::TOUCH:
mTexture[ i ] = gl::Texture( loadImage( loadResource( RES_TEX_TOUCH ) ) );
break;
case NONE:
break;
}
mTexture[ i ].setFlipped( true );
mTexture[ i ].setMagFilter( GL_NEAREST );
mTexture[ i ].setMinFilter( GL_NEAREST );
}
// Initialize cursor
mCursorType = CursorType::NONE;
mCursorPosition = Vec3f::zero();
mCursorPositionTarget = Vec3f::zero();
// Load UI textures
mButton[ 0 ] = gl::Texture( loadImage( loadResource( RES_TEX_BUTTON_OFF ) ) );
mButton[ 1 ] = gl::Texture( loadImage( loadResource( RES_TEX_BUTTON_ON ) ) );
mSlider = gl::Texture( loadImage( loadResource( RES_TEX_SLIDER ) ) );
mTrack = gl::Texture( loadImage( loadResource( RES_TEX_TRACK ) ) );
// Flip textures
mButton[ 0 ].setFlipped( true );
mButton[ 1 ].setFlipped( true );
mSlider.setFlipped( true );
mTrack.setFlipped( true );
// Disable anti-aliasing
mButton[ 0 ].setMagFilter( GL_NEAREST );
mButton[ 0 ].setMinFilter( GL_NEAREST );
mButton[ 1 ].setMagFilter( GL_NEAREST );
mButton[ 1 ].setMinFilter( GL_NEAREST );
mSlider.setMagFilter( GL_NEAREST );
mSlider.setMinFilter( GL_NEAREST );
mTrack.setMagFilter( GL_NEAREST );
mTrack.setMinFilter( GL_NEAREST );
// Initialize buttons
Vec3f position( -120.0f, 950.0f, 0.0f );
for ( size_t i = 0; i < 3; ++i, position.x += 320.0f ) {
mButtonPosition[ i ] = position;
mButtonState[ i ] = false;
}
// Initialize sliider
mTrackPosition = Vec3f( 0.0f, 700.0f, 0.0f );
mSliderPosition = mTrackPosition;
mSliderPosition.y -= 45.0f;
// Params
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl( "Params", Vec2i( 200, 105 ) );
mParams.addParam( "Frame rate", &mFrameRate, "", true );
mParams.addParam( "Full screen", &mFullScreen, "key=f" );
mParams.addButton( "Screen shot", bind( &UiApp::screenShot, this ), "key=space" );
mParams.addButton( "Quit", bind( &UiApp::quit, this ), "key=q" );
}
示例2: setup
// Set up
void UiApp::setup()
{
glShadeModel( GL_FLAT );
// Start device
mDevice = Device::create();
mDevice->connectEventHandler( &UiApp::onFrame, this );
// Load cursor textures
for ( size_t i = 0; i < 3; ++i ) {
switch ( (CursorType)i ) {
case CursorType::GRAB:
mTexture[ i ] = gl::Texture( loadImage( loadResource( RES_TEX_GRAB ) ) );
break;
case CursorType::HAND:
mTexture[ i ] = gl::Texture( loadImage( loadResource( RES_TEX_HAND ) ) );
break;
case CursorType::TOUCH:
mTexture[ i ] = gl::Texture( loadImage( loadResource( RES_TEX_TOUCH ) ) );
break;
case NONE:
break;
}
mTexture[ i ].setMagFilter( GL_NEAREST );
mTexture[ i ].setMinFilter( GL_NEAREST );
}
// Initialize cursor
mCursorType = CursorType::NONE;
mCursorPosition = Vec2f::zero();
mCursorPositionTarget = Vec2f::zero();
mFingerTipPosition = Vec2i::zero();
// Load UI textures
mButton[ 0 ] = gl::Texture( loadImage( loadResource( RES_TEX_BUTTON_OFF ) ) );
mButton[ 1 ] = gl::Texture( loadImage( loadResource( RES_TEX_BUTTON_ON ) ) );
mSlider = gl::Texture( loadImage( loadResource( RES_TEX_SLIDER ) ) );
mTrack = gl::Texture( loadImage( loadResource( RES_TEX_TRACK ) ) );
// Disable anti-aliasing
mButton[ 0 ].setMagFilter( GL_NEAREST );
mButton[ 0 ].setMinFilter( GL_NEAREST );
mButton[ 1 ].setMagFilter( GL_NEAREST );
mButton[ 1 ].setMinFilter( GL_NEAREST );
mSlider.setMagFilter( GL_NEAREST );
mSlider.setMinFilter( GL_NEAREST );
mTrack.setMagFilter( GL_NEAREST );
mTrack.setMinFilter( GL_NEAREST );
// Params
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl( "Params", Vec2i( 200, 105 ) );
mParams.addParam( "Frame rate", &mFrameRate, "", true );
mParams.addParam( "Full screen", &mFullScreen, "key=f" );
mParams.addButton( "Screen shot", bind( &UiApp::screenShot, this ), "key=space" );
mParams.addButton( "Quit", bind( &UiApp::quit, this ), "key=q" );
// Run resize to initialize layout
resize();
}