当前位置: 首页>>代码示例>>C++>>正文


C++ Texture::setWrap方法代码示例

本文整理汇总了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 );
	}
}
开发者ID:Asteral,项目名称:Cinder-KinectSdk,代码行数:10,代码来源:MeshApp.cpp

示例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() ) );

}
开发者ID:degatt2,项目名称:Cinder-Bullet,代码行数:45,代码来源:BulletTestApp.cpp

示例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() ) );

}
开发者ID:bgbotond,项目名称:Cinder-Bullet,代码行数:43,代码来源:BulletTestApp.cpp


注:本文中的ci::gl::Texture::setWrap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。