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,26 @@
// Copyright (C) 2016 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
#pragma once
#ifndef NAZARA_RENDERDEVICEINSTANCE_HPP
#define NAZARA_RENDERDEVICEINSTANCE_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Renderer/Config.hpp>
namespace Nz
{
///TODO: Rename
class NAZARA_RENDERER_API RenderDeviceInstance
{
public:
RenderDeviceInstance() = default;
virtual ~RenderDeviceInstance();
};
}
#include <Nazara/Renderer/RenderDeviceInstance.inl>
#endif // NAZARA_RENDERDEVICEINSTANCE_HPP

View File

@@ -0,0 +1,12 @@
// Copyright (C) 2016 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
{
}
#include <Nazara/Renderer/DebugOff.hpp>

View File

@@ -0,0 +1,30 @@
// Copyright (C) 2016 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
#pragma once
#ifndef NAZARA_RENDERSURFACE_HPP
#define NAZARA_RENDERSURFACE_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Utility/WindowHandle.hpp>
#include <Nazara/Renderer/Config.hpp>
namespace Nz
{
///TODO: Rename
class NAZARA_RENDERER_API RenderSurface
{
public:
RenderSurface() = default;
virtual ~RenderSurface();
virtual bool Create(WindowHandle handle) = 0;
virtual void Destroy() = 0;
};
}
#include <Nazara/Renderer/RenderSurface.inl>
#endif // NAZARA_RENDERSURFACE_HPP

View File

@@ -0,0 +1,12 @@
// Copyright (C) 2016 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
{
}
#include <Nazara/Renderer/DebugOff.hpp>

View File

@@ -11,6 +11,7 @@
#include <Nazara/Core/Clock.hpp>
#include <Nazara/Math/Rect.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Renderer/RenderSurface.hpp>
#include <Nazara/Renderer/RenderWindowImpl.hpp>
#include <Nazara/Renderer/RenderWindowParameters.hpp>
#include <Nazara/Utility/Window.hpp>
@@ -52,6 +53,7 @@ namespace Nz
private:
std::unique_ptr<RenderWindowImpl> m_impl;
Clock m_clock;
std::unique_ptr<RenderSurface> m_surface;
RenderWindowParameters m_parameters;
unsigned int m_framerateLimit;
};

View File

@@ -16,13 +16,15 @@
namespace Nz
{
class RenderSurface;
class NAZARA_RENDERER_API RenderWindowImpl
{
public:
RenderWindowImpl() = default;
virtual ~RenderWindowImpl();
virtual bool Create(WindowHandle handle, const Vector2ui& size, const RenderWindowParameters& parameters) = 0;
virtual bool Create(RenderSurface* surface, const Vector2ui& size, const RenderWindowParameters& parameters) = 0;
};
}

View File

@@ -21,6 +21,8 @@ namespace Nz
class AbstractBuffer;
class Buffer;
class RendererImpl;
class RenderDeviceInstance;
class RenderSurface;
class RenderWindowImpl;
using CreateRendererImplFunc = RendererImpl*(*)();
@@ -32,8 +34,11 @@ namespace Nz
virtual ~RendererImpl();
virtual std::unique_ptr<AbstractBuffer> CreateHardwareBufferImpl(Buffer* parent, BufferType type) = 0;
virtual std::unique_ptr<RenderSurface> CreateRenderSurfaceImpl() = 0;
virtual std::unique_ptr<RenderWindowImpl> CreateRenderWindowImpl() = 0;
virtual std::unique_ptr<RenderDeviceInstance> InstanciateRenderDevice(std::size_t deviceIndex) = 0;
virtual bool IsBetterThan(const RendererImpl* other) const = 0;
virtual RenderAPI QueryAPI() const = 0;