SetSkybox

This function can be used to set add a skybox to a camera. The sky will be drawn everywhere and appear behind all rendered objects.

Syntax

Parameters

Returns

The second function overload will return true if the asset is loaded, otherwise false is returned.

Example

#include "Leadwerks.h"

using namespace Leadwerks;

int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
World* world = World::Create();

Camera* camera = Camera::Create();

//Set skybox
Texture* skybox = Texture::Load("Materials/Sky/skybox_texture.tex");
camera->SetSkybox(skybox);

while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) break;

Leadwerks::Leadwerks::Time::Update();
world->Update();
world->Render();
context->Sync();
}
return 0;
}