Core: Add MovablePtr class
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#define NAZARA_CONTEXT_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Core/ObjectLibrary.hpp>
|
||||
#include <Nazara/Core/ObjectRef.hpp>
|
||||
#include <Nazara/Core/RefCounted.hpp>
|
||||
@@ -35,7 +36,7 @@ namespace Nz
|
||||
public:
|
||||
Context() = default;
|
||||
Context(const Context&) = delete;
|
||||
Context(Context&&) = delete;
|
||||
Context(Context&&) noexcept = default;
|
||||
~Context();
|
||||
|
||||
bool Create(const ContextParameters& parameters = ContextParameters());
|
||||
@@ -52,7 +53,7 @@ namespace Nz
|
||||
void SwapBuffers();
|
||||
|
||||
Context& operator=(const Context&) = delete;
|
||||
Context& operator=(Context&&) = delete;
|
||||
Context& operator=(Context&&) noexcept = default;
|
||||
|
||||
static bool EnsureContext();
|
||||
|
||||
@@ -69,7 +70,7 @@ namespace Nz
|
||||
static void Uninitialize();
|
||||
|
||||
ContextParameters m_parameters;
|
||||
ContextImpl* m_impl = nullptr;
|
||||
MovablePtr<ContextImpl> m_impl = nullptr;
|
||||
|
||||
static std::unique_ptr<Context> s_reference;
|
||||
static std::vector<std::unique_ptr<Context>> s_contexts;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define NAZARA_RENDERTEXTURE_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Math/Rect.hpp>
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/Enums.hpp>
|
||||
@@ -30,7 +31,7 @@ namespace Nz
|
||||
public:
|
||||
inline RenderTexture();
|
||||
RenderTexture(const RenderTexture&) = delete;
|
||||
RenderTexture(RenderTexture&&) = delete; ///TODO?
|
||||
RenderTexture(RenderTexture&&) noexcept = default;
|
||||
inline ~RenderTexture();
|
||||
|
||||
bool AttachBuffer(AttachmentPoint attachmentPoint, UInt8 index, RenderBuffer* buffer);
|
||||
@@ -64,7 +65,7 @@ namespace Nz
|
||||
bool HasContext() const override;
|
||||
|
||||
RenderTexture& operator=(const RenderTexture&) = delete;
|
||||
RenderTexture& operator=(RenderTexture&&) = delete; ///TODO?
|
||||
RenderTexture& operator=(RenderTexture&&) noexcept = default;
|
||||
|
||||
static inline void Blit(RenderTexture* src, RenderTexture* dst, UInt32 buffers = RendererBuffer_Color | RendererBuffer_Depth | RendererBuffer_Stencil, bool bilinearFilter = false);
|
||||
static void Blit(RenderTexture* src, Rectui srcRect, RenderTexture* dst, Rectui dstRect, UInt32 buffers = RendererBuffer_Color | RendererBuffer_Depth | RendererBuffer_Stencil, bool bilinearFilter = false);
|
||||
@@ -85,7 +86,7 @@ namespace Nz
|
||||
void UpdateSize() const;
|
||||
void UpdateTargets() const;
|
||||
|
||||
RenderTextureImpl* m_impl;
|
||||
MovablePtr<RenderTextureImpl> m_impl;
|
||||
mutable bool m_checked ;
|
||||
mutable bool m_drawBuffersUpdated;
|
||||
mutable bool m_sizeUpdated;
|
||||
|
||||
Reference in New Issue
Block a user