SetBlendMode

Syntax

Parameters

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);

while (true)
{
Context* context = Context::GetCurrent();
Leadwerks::Window* window = context->GetWindow();

if (window->Closed() || window->KeyDown(Key::Escape)) return false;

context->SetColor(0.5,0.5,0.5);
context->Clear();

context->SetColor(0.0, 0.0, 1.0, 0.5);

context->SetBlendMode(Blend::Solid);
context->DrawRect(50, 50, 200, 200);

context->SetBlendMode(Blend::Alpha);
context->DrawRect(50 + 250, 50, 200, 200);

context->SetBlendMode(Blend::Light);
context->DrawRect(50 + 250 * 2, 50, 200, 200);

context->SetBlendMode(Blend::Shade);
context->DrawRect(50 + 250 * 3, 50, 200, 200);

context->Sync();
}
return 0;
}