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


C++ UserInterface::setup方法代码示例

本文整理汇总了C++中UserInterface::setup方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInterface::setup方法的具体用法?C++ UserInterface::setup怎么用?C++ UserInterface::setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserInterface的用法示例。


在下文中一共展示了UserInterface::setup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setup

void StarsApp::setup()
{
	mTime = getElapsedSeconds();

	// create the spherical grid mesh
	mGrid.setup();

	// load the star database and create the VBO mesh
	mStars.load( loadAsset("hygxyz.csv") );
	//mStars.write( writeFile( getAssetPath("") / "hygxyz.dat" ) );	// TODO

	// load texture and shader
	mStars.setup();

	// create user interface
	mUserInterface.setup();

	// initialize background image
	mBackground.setup();

	// initialize camera
	mCamera.setup();

	//
	mIsGridVisible = false;

	//
	forceHideCursor();

	//
	mTimer.start();
}
开发者ID:meshula,项目名称:Cinder-Samples,代码行数:32,代码来源:StarsApp.cpp

示例2: setup

void StarsApp::setup()
{
	// create the spherical grid mesh
	mGrid.setup();

	// load the star database and create the VBO mesh
	if( fs::exists( getAssetPath("") / "stars.cdb" ) )
		mStars.read( loadFile( getAssetPath("") / "stars.cdb" ) );

	if( fs::exists( getAssetPath("") / "labels.cdb" ) )
		mLabels.read( loadFile( getAssetPath("") / "labels.cdb" ) );

	if( fs::exists( getAssetPath("") / "constellations.cdb" ) )
		mConstellations.read( loadFile( getAssetPath("") / "constellations.cdb" ) );

	if( fs::exists( getAssetPath("") / "constellationlabels.cdb" ) )
		mConstellationLabels.read( loadFile( getAssetPath("") / "constellationlabels.cdb" ) );

	// create user interface
	mUserInterface.setup();

	// initialize background image
	mBackground.setup();

	// initialize camera
	mCamera.setup();

	CameraPersp cam( mCamera.getCamera() );
	cam.setNearClip( 0.01f );
	cam.setFarClip( 5000.0f );

	//
	mIsGridVisible = true;
	mIsLabelsVisible = true;
	mIsConstellationsVisible = true;
	mIsStereoscopic = false;
	mIsCylindrical = false;

	// create stars
	mStars.setup();
	mStars.setAspectRatio( mIsStereoscopic ? 0.5f : 1.0f );

	// create labels
	mLabels.setup();
	mConstellationLabels.setup();

	//
	mMusicExtensions.push_back( ".flac" );
	mMusicExtensions.push_back( ".ogg" );
	mMusicExtensions.push_back( ".wav" );
	mMusicExtensions.push_back( ".mp3" );

	mPlayMusic = true;

	// initialize the IrrKlang Sound Engine in a very safe way
	mSoundEngine = shared_ptr<ISoundEngine>( createIrrKlangDevice(), std::mem_fun(&ISoundEngine::drop) );

	if(mSoundEngine) {
		// play 3D Sun rumble
		mSound = createSound( getAssetPath("") / "sound/low_rumble_loop.mp3" );
		if(mSound) {
			mSound->setIsLooped(true);
			mSound->setMinDistance(2.5f);
			mSound->setMaxDistance(12.5f);
			mSound->setIsPaused(false);
		}

		// play background music (the first .mp3 file found in ./assets/music)
		fs::path path = getFirstFile( getAssetPath("") / "music" );
		playMusic(path);
	}

	//
	createShader();

	//
	mTimer.start();

#if (defined WIN32 && defined NDEBUG)
	forceHideCursor();
#else
	forceShowCursor();
#endif

	mTime = getElapsedSeconds();
}
开发者ID:rmnzr,项目名称:Cinder-Samples,代码行数:86,代码来源:StarsApp.cpp


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