本文整理汇总了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();
}
示例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();
}