Files
WickedEngine/Editor/OceanWindow.cpp
T
2017-11-11 17:15:08 +00:00

41 lines
976 B
C++

#include "stdafx.h"
#include "OceanWindow.h"
OceanWindow::OceanWindow(wiGUI* gui) :GUI(gui)
{
assert(GUI && "Invalid GUI!");
float screenW = (float)wiRenderer::GetDevice()->GetScreenWidth();
float screenH = (float)wiRenderer::GetDevice()->GetScreenHeight();
oceanWindow = new wiWindow(GUI, "Ocean Window");
oceanWindow->SetSize(XMFLOAT2(600, 300));
GUI->AddWidget(oceanWindow);
float x = 200;
float y = 0;
float inc = 35;
enabledCheckBox = new wiCheckBox("Ocean simulation enabled: ");
enabledCheckBox->SetPos(XMFLOAT2(x, y += inc));
enabledCheckBox->OnClick([&](wiEventArgs args) {
wiRenderer::SetOceanEnabled(args.bValue, params);
});
enabledCheckBox->SetCheck(wiRenderer::GetOcean() != nullptr);
oceanWindow->AddWidget(enabledCheckBox);
oceanWindow->Translate(XMFLOAT3(30, 30, 0));
oceanWindow->SetVisible(false);
}
OceanWindow::~OceanWindow()
{
oceanWindow->RemoveWidgets(true);
GUI->RemoveWidget(oceanWindow);
SAFE_DELETE(oceanWindow);
}