本文整理汇总了C++中ci::gl::Texture::setWrap方法的典型用法代码示例。如果您正苦于以下问题:C++ Texture::setWrap方法的具体用法?C++ Texture::setWrap怎么用?C++ Texture::setWrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ci::gl::Texture
的用法示例。
在下文中一共展示了Texture::setWrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onColorData
// Receives Color data
void MeshApp::onColorData( Surface8u surface, const DeviceOptions& deviceOptions )
{
if ( mTextureColor ) {
mTextureColor.update( surface, surface.getBounds() );
} else {
mTextureColor = gl::Texture( surface );
mTextureColor.setWrap( GL_REPEAT, GL_REPEAT );
}
}
示例2: setup
void BulletTestApp::setup()
{
mDragging = false;
mFrameRate = 0.0f;
mTest = 9;
mTestPrev = mTest;
// Set up lighting
mLight = new gl::Light( gl::Light::DIRECTIONAL, 0 );
mLight->setDirection( Vec3f( 0.0f, 0.1f, 0.3f ).normalized() );
mLight->setAmbient( ColorAf( 0.2f, 0.2f, 0.2f, 1.0f ) );
mLight->setDiffuse( ColorAf( 1.0f, 1.0f, 1.0f, 1.0f ) );
mLight->enable();
// Load meshes
loadModels();
// Create a Bullet dynamics world
mWorld = bullet::createWorld();
// Load texture
mTexSquare = gl::Texture( loadImage( loadResource( RES_TEX_SQUARE ) ) );
mTexSphere = gl::Texture( loadImage( loadResource( RES_TEX_SPHERE ) ) );
mTexTerrain = gl::Texture( loadImage( loadResource( RES_TEX_TERRAIN ) ) );
mTexTerrain.setWrap( GL_REPEAT, GL_REPEAT );
mTexTerrain.unbind();
// Init terrain pointer
mTerrain = 0;
// Parameters
mParams = params::InterfaceGl( "Params", Vec2i( 200, 120 ) );
mParams.addParam( "Frame Rate", &mFrameRate, "", true );
mParams.addParam( "Test", &mTest, "min=0 max=9 step=1 keyDecr=t keyIncr=T" );
mParams.addButton( "Drop", bind( &BulletTestApp::drop, this ), "key=space" );
mParams.addButton( "Screen shot", bind( &BulletTestApp::screenShot, this ), "key=s" );
mParams.addButton( "Quit", bind( &BulletTestApp::quit, this ), "key=q" );
// Initialize
initTest();
// Run first resize to initialize view
resize( ResizeEvent( getWindowSize() ) );
}
示例3: setup
void BulletTestApp::setup()
{
// Set test mode
mTest = 0;
mTestPrev = mTest;
// Set up lighting
mLight = new gl::Light( gl::Light::DIRECTIONAL, 0 );
mLight->setDirection( Vec3f( 0.0f, 0.1f, 0.3f ).normalized() );
mLight->setAmbient( ColorAf( 0.2f, 0.2f, 0.2f, 1.0f ) );
mLight->setDiffuse( ColorAf( 1.0f, 1.0f, 1.0f, 1.0f ) );
mLight->enable();
// Load meshes
loadModels();
// Create a Bullet dynamics world
mWorld = bullet::createWorld();
// Load texture
mTexSquare = gl::Texture( loadImage( loadResource( RES_TEX_SQUARE ) ) );
mTexSphere = gl::Texture( loadImage( loadResource( RES_TEX_SPHERE ) ) );
mTexTerrain = gl::Texture( loadImage( loadResource( RES_TEX_TERRAIN ) ) );
mTexTerrain.setWrap( GL_REPEAT, GL_REPEAT );
mTexTerrain.unbind();
// Init terrain pointer
mTerrain = 0;
// Parameters
mFrameRate = 0.0f;
mParams = params::InterfaceGl( "Params", Vec2i( 150, 100) );
mParams.addParam( "Frame Rate", &mFrameRate, "", true );
mParams.addParam( "Test", &mTest, "min=0 max=7 step=1 keyDecr=d keyIncr=D" );
// Initialize
initTest();
// Run first resize to initialize view
resize( ResizeEvent( getWindowSize() ) );
}