Updated.
This commit is contained in:
parent
c1b83d07fd
commit
148c10eb08
@ -339,7 +339,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
|
|||||||
|
|
||||||
lwe::Entity ent("Main");
|
lwe::Entity ent("Main");
|
||||||
ent.SetScale({0.25f, 0.25f, 0.25f});
|
ent.SetScale({0.25f, 0.25f, 0.25f});
|
||||||
ent.SetPos({0.0f, -1.0f, 5.0f});
|
ent.SetPos({0.0f, -1.0f, 10.0f});
|
||||||
//ent->SetRot({-90.0f, 180.0f, 0.0f});
|
//ent->SetRot({-90.0f, 180.0f, 0.0f});
|
||||||
|
|
||||||
//ent->AddComponent(new lwe::Networked(false, false, lwe::EndpointOwner::SERVICE));
|
//ent->AddComponent(new lwe::Networked(false, false, lwe::EndpointOwner::SERVICE));
|
||||||
@ -385,7 +385,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
|
|||||||
AddEntity((lwe::Entity&&)ent);
|
AddEntity((lwe::Entity&&)ent);
|
||||||
|
|
||||||
lwe::Entity sun("Sun");
|
lwe::Entity sun("Sun");
|
||||||
sun.SetPos({-5.0f, 0.0f, 5.0f});
|
sun.SetPos({-5.0f, 0.0f, 10.0f});
|
||||||
|
|
||||||
lwe::AmbientPointLight* sunLight = new lwe::AmbientPointLight("Light");
|
lwe::AmbientPointLight* sunLight = new lwe::AmbientPointLight("Light");
|
||||||
sunLight->SetDiffuse({1.0f, 0.77254901960784313725490196078431f, 0.56078431372549019607843137254902f});
|
sunLight->SetDiffuse({1.0f, 0.77254901960784313725490196078431f, 0.56078431372549019607843137254902f});
|
||||||
@ -394,7 +394,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
|
|||||||
AddEntity((lwe::Entity&&)sun);
|
AddEntity((lwe::Entity&&)sun);
|
||||||
|
|
||||||
lwe::Entity emergency("Emergency");
|
lwe::Entity emergency("Emergency");
|
||||||
emergency.SetPos({5.0f, 0.0f, 5.0f});
|
emergency.SetPos({5.0f, 0.0f, 10.0f});
|
||||||
|
|
||||||
lwe::PointLight* pl = new lwe::PointLight("Light");
|
lwe::PointLight* pl = new lwe::PointLight("Light");
|
||||||
pl->SetColor({1.0f, 0.0f, 0.0f});
|
pl->SetColor({1.0f, 0.0f, 0.0f});
|
||||||
@ -470,6 +470,17 @@ void TestLevel::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
lwe::GuiSystem* guiSys = (lwe::GuiSystem*)GetSystem("GuiSystem");
|
||||||
|
if (!guiSys)
|
||||||
|
return;
|
||||||
|
|
||||||
|
lwe::CollectionGui* stats = (lwe::CollectionGui*)guiSys->GetGui("Stats");
|
||||||
|
if (!stats)
|
||||||
|
return;
|
||||||
|
|
||||||
|
lwe::LabelGui* fps = (lwe::LabelGui*)stats->GetChild("FPS");
|
||||||
|
fps->SetText("FPS: " + ehs::Str_8::FromNum(gl->GetTPS()));
|
||||||
|
|
||||||
const ehs::InputHandler* ih = win->GetInputHandler();
|
const ehs::InputHandler* ih = win->GetInputHandler();
|
||||||
if (!ih)
|
if (!ih)
|
||||||
return;
|
return;
|
||||||
@ -525,17 +536,6 @@ void TestLevel::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float
|
|||||||
cooldown -= delta;
|
cooldown -= delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
lwe::GuiSystem* guiSys = (lwe::GuiSystem*)GetSystem("GuiSystem");
|
|
||||||
if (!guiSys)
|
|
||||||
return;
|
|
||||||
|
|
||||||
lwe::CollectionGui* stats = (lwe::CollectionGui*)guiSys->GetGui("Stats");
|
|
||||||
if (!stats)
|
|
||||||
return;
|
|
||||||
|
|
||||||
lwe::LabelGui* fps = (lwe::LabelGui*)stats->GetChild("FPS");
|
|
||||||
fps->SetText("FPS: " + ehs::Str_8::FromNum(gl->GetTPS()));
|
|
||||||
|
|
||||||
lwe::AudioSource* source = (lwe::AudioSource*)ent->GetComponent("AudioSource3D", "Song");
|
lwe::AudioSource* source = (lwe::AudioSource*)ent->GetComponent("AudioSource3D", "Song");
|
||||||
if (!source)
|
if (!source)
|
||||||
return;
|
return;
|
||||||
|
14
main.cpp
14
main.cpp
@ -92,24 +92,14 @@ ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVe
|
|||||||
{
|
{
|
||||||
ehs::Console::Attach();
|
ehs::Console::Attach();
|
||||||
|
|
||||||
#if defined(EHS_OS_WINDOWS)
|
lwe::RenderWindow::AddExtensions();
|
||||||
lwe::GpuInstance::AddExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
|
|
||||||
#elif defined(EHS_OS_LINUX)
|
|
||||||
#if defined(EHS_WS_WAYLAND)
|
|
||||||
lwe::GpuInstance::AddExtension(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
|
|
||||||
#elif defined(EHS_WS_XCB)
|
|
||||||
lwe::GpuInstance::AddExtension(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lwe::GpuInstance::AddExtension(VK_KHR_SURFACE_EXTENSION_NAME);
|
|
||||||
lwe::GpuInstance::Initialize(true);
|
lwe::GpuInstance::Initialize(true);
|
||||||
|
|
||||||
lwe::GpuDevice device = std::move(lwe::GpuDevice::GetBest());
|
lwe::GpuDevice device = std::move(lwe::GpuDevice::GetBest());
|
||||||
lwe::GpuQueueFamily* family = device.GetQueueFamily(lwe::QueueType::GRAPHICS);
|
lwe::GpuQueueFamily* family = device.GetQueueFamily(lwe::QueueType::GRAPHICS);
|
||||||
|
|
||||||
lwe::GpuInterface inf(&device);
|
lwe::GpuInterface inf(&device);
|
||||||
inf.AddExtensions(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
|
lwe::RenderWindow::AddExtensions(&inf);
|
||||||
|
|
||||||
lwe::GpuQueue primary(family, &inf, 1.0f);
|
lwe::GpuQueue primary(family, &inf, 1.0f);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user