SetWaterColor
This command sets the diffuse color of the water.
Syntax
- void World::SetWaterColor(float red, float green, float blue, float alpha = 1.0)
Parameters
- red: the red component of the color to set.
- green: the green component of the color to set.
- blue: the blue component of the color to set.
- alpha: the alpha component of the color to set.
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();
camera->Move(0, 1, -3);
Light* light = DirectionalLight::Create();
light->SetRotation(35, 35, 0);
camera->SetSkybox("Materials/Sky/skybox_texture.tex");
world->SetWaterMode(true);
world->SetWaterColor(0, 0.5, 0.5, 1);
world->SetWaterHeight(0.0);
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;
Leadwerks::Time::Update();
world->Update();
world->Render();
context->Sync(false);
}
return 0;
}