Commit WIP about RenderSurface

This commit is contained in:
Lynix
2016-11-10 12:54:10 +01:00
parent 86b892c3bc
commit c136f8eddc
22 changed files with 321 additions and 37 deletions

View File

@@ -0,0 +1,11 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Renderer module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Renderer/RenderDeviceInstance.hpp>
#include <Nazara/Renderer/Debug.hpp>
namespace Nz
{
RenderDeviceInstance::~RenderDeviceInstance() = default;
}

View File

@@ -0,0 +1,11 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Renderer module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Renderer/RenderSurface.hpp>
#include <Nazara/Renderer/Debug.hpp>
namespace Nz
{
RenderSurface::~RenderSurface() = default;
}

View File

@@ -35,14 +35,22 @@ namespace Nz
bool RenderWindow::OnWindowCreated()
{
auto surface = Renderer::GetRendererImpl()->CreateRenderSurfaceImpl();
if (!surface->Create(GetHandle()))
{
NazaraError("Failed to create render surface: " + Error::GetLastError());
return false;
}
auto impl = Renderer::GetRendererImpl()->CreateRenderWindowImpl();
if (!impl->Create(GetHandle(), Vector2ui(GetWidth(), GetHeight()), m_parameters))
if (!impl->Create(surface.get(), Vector2ui(GetWidth(), GetHeight()), m_parameters))
{
NazaraError("Failed to create render window implementation: " + Error::GetLastError());
return false;
}
m_impl = std::move(impl);
m_surface = std::move(surface);
m_clock.Restart();
@@ -52,6 +60,7 @@ namespace Nz
void RenderWindow::OnWindowDestroy()
{
m_impl.reset();
m_surface.reset();
}
void RenderWindow::OnWindowResized()