wiRenderer moved to namespace (finally...)

This commit is contained in:
turanszkij
2018-09-22 14:15:44 +01:00
parent 142ced9583
commit 61e2e3addd
25 changed files with 1680 additions and 1596 deletions
+15 -7
View File
@@ -53,7 +53,7 @@ void MainComponent::Initialize()
{
// User can also create a graphics device if custom logic is desired, but he must do before this function!
if (wiRenderer::graphicsDevice == nullptr)
if (wiRenderer::GetDevice() == nullptr)
{
bool debugdevice = wiStartupArguments::HasArgument("debugdevice");
@@ -61,8 +61,8 @@ void MainComponent::Initialize()
if (wiStartupArguments::HasArgument("vulkan"))
{
#ifdef WICKEDENGINE_BUILD_VULKAN
wiRenderer::SHADERPATH += "spirv/";
wiRenderer::graphicsDevice = new GraphicsDevice_Vulkan(window, fullscreen, debugdevice);
wiRenderer::GetShaderPath() += "spirv/";
wiRenderer::SetDevice(new GraphicsDevice_Vulkan(window, fullscreen, debugdevice));
#else
wiHelper::messageBox("Vulkan SDK not found during building the application! Vulkan API disabled!", "Error");
#endif
@@ -71,13 +71,13 @@ void MainComponent::Initialize()
{
if (wiStartupArguments::HasArgument("hlsl6"))
{
wiRenderer::SHADERPATH += "hlsl6/";
wiRenderer::GetShaderPath() += "hlsl6/";
}
wiRenderer::graphicsDevice = new GraphicsDevice_DX12(window, fullscreen, debugdevice);
wiRenderer::SetDevice(new GraphicsDevice_DX12(window, fullscreen, debugdevice));
}
else
{
wiRenderer::graphicsDevice = new GraphicsDevice_DX11(window, fullscreen, debugdevice);
wiRenderer::SetDevice(new GraphicsDevice_DX11(window, fullscreen, debugdevice));
}
}
@@ -159,13 +159,21 @@ void MainComponent::Run()
Update((float)elapsedTime);
wiProfiler::GetInstance().EndRange(); // Update
wiProfiler::GetInstance().BeginRange("Render", wiProfiler::DOMAIN_CPU);
Render();
wiProfiler::GetInstance().EndRange(); // Render
wiProfiler::GetInstance().EndRange(); // CPU Frame
wiRenderer::Present(bind(&MainComponent::Compose, this));
wiProfiler::GetInstance().BeginRange("Compose", wiProfiler::DOMAIN_CPU);
wiRenderer::GetDevice()->PresentBegin();
Compose();
wiRenderer::GetDevice()->PresentEnd();
wiProfiler::GetInstance().EndRange(); // Compose
wiRenderer::EndFrame();
static bool startupScriptProcessed = false;
if (!startupScriptProcessed) {