Create

This function creates and returns a new blank material.

Syntax

Returns

Returns the loaded Font. If the Font cannot be loaded, NULL 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();
Light* light = DirectionalLight::Create();

//Create a material
Material* material = Material::Create();
material->SetColor(1, 0, 0);

//Create a model and apply the material to it
Model* model = Model::Sphere();
model->SetPosition(0, 0, 2);
model->SetMaterial(material);
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

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