本文整理汇总了C++中SkyBox::MakeFromSideTextures方法的典型用法代码示例。如果您正苦于以下问题:C++ SkyBox::MakeFromSideTextures方法的具体用法?C++ SkyBox::MakeFromSideTextures怎么用?C++ SkyBox::MakeFromSideTextures使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkyBox
的用法示例。
在下文中一共展示了SkyBox::MakeFromSideTextures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: location
DemoScene( unsigned int windowWidth,
unsigned int windowHeight,
bool fullscreen,
unsigned int multisample ) :
time(0.0f),
fps(0.0f),
dt(0.0f),
drawHelp(true),
needToTakeScreenshot(false)
{
Engine* engine = Engine::Instance();
// setup graphics
{
using namespace slon::scene;
using namespace slon::animation;
// setup logging
{
log::currentLogManager().redirectOutput("database", "database_log.txt");
log::currentLogManager().redirectOutput("graphics", "graphics_log.txt");
}
GraphicsManager& graphicsManager = engine->getGraphicsManager();
graphicsManager.setVideoMode(windowWidth, windowHeight, 32, fullscreen, false, multisample);
// create renderer
{
ForwardRendererDesc desc;
desc.useDepthPass = true;
desc.makeDepthMap = true;
desc.useDebugRender = true;
Renderer* renderer = graphicsManager.initRenderer(desc);
renderer->connectPostRenderCallback( boost::bind(&DemoScene::OnPostRender, this, _1) );
}
#ifdef WIN32
FreeConsole();
#endif
// create world
realm::World* world = realm::currentWorld();
realm::location_ptr location(new realm::BVHLocation);
world->addLocation(location);
// Create skybox
SkyBox* skyBox = new SkyBox();
{
const std::string SKY_BOX_MAPS[6] =
{
"Data/SkyBox/sunset_west.jpg",
"Data/SkyBox/sunset_east.jpg",
"Data/SkyBox/sunset_up.jpg",
"Data/SkyBox/sunset_down.jpg",
"Data/SkyBox/sunset_south.jpg",
"Data/SkyBox/sunset_north.jpg"
};
skyBox->MakeFromSideTextures(SKY_BOX_MAPS);
}
world->addInfiniteNode(skyBox);
// create scene
{
database::library_ptr library = database::loadLibrary("Data/Models/troll.DAE");
location->add(library->visualScenes.begin()->second.get());
database::Library::key_animation_map animations = library->animations;
if ( !animations.empty() )
{
StartStopTimer* timer = new StartStopTimer();
timer->start();
animations.begin()->second->play(timer);
}
// create light
scene::DirectionalLight* light = new DirectionalLight();
light->setDirection( normalize( Vector3f(-1.5f, -0.1f, 0.85f) ) );
light->setColor( Vector4f(0.8f, 0.8f, 0.8f, 1.0f) );
light->setAmbient(0.3f);
light->setIntensity(1.5f);
world->addInfiniteNode(light);
}
// Create camera
{
sgl::rectangle viewport(0, 0, windowWidth, windowHeight);
camera.reset( createMainCamera(viewport) );
graphicsManager.addCamera( camera.get() );
}
camera->setPosition( Vector3f(60.0f, 20.0f, 0.0f) );
camera->setDirection( Vector3f(-1.0f, -1.0f, 1.0f) );
camera->setUp( Vector3f(0.0f, 1.0f, 0.0f) );
// create font
font.reset( currentDevice()->CreateFont() );
{
sgl::Image* image = currentDevice()->CreateImage();
image->LoadFromFile("Data/Fonts/font.png");
font->SetTexture( image->CreateTexture2D() );
//.........这里部分代码省略.........