Merge remote-tracking branch 'origin/NDK' into NDK-ShadowMapping
Conflicts: SDK/include/NDK/Systems/RenderSystem.hpp SDK/src/NDK/Systems/RenderSystem.cpp Former-commit-id: 0a72e838de272bff91f0b8c8a3637db94fdd7820
This commit is contained in:
@@ -74,6 +74,16 @@ inline float NzLight::GetOuterAngle() const
|
||||
return m_outerAngle;
|
||||
}
|
||||
|
||||
inline float NzLight::GetOuterAngleCosine() const
|
||||
{
|
||||
return m_outerAngleCosine;
|
||||
}
|
||||
|
||||
inline float NzLight::GetOuterAngleTangent() const
|
||||
{
|
||||
return m_outerAngleTangent;
|
||||
}
|
||||
|
||||
inline float NzLight::GetRadius() const
|
||||
{
|
||||
return m_radius;
|
||||
|
||||
@@ -26,8 +26,8 @@ struct NzRenderTextureImpl;
|
||||
class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget, NzNonCopyable
|
||||
{
|
||||
public:
|
||||
NzRenderTexture() = default;
|
||||
~NzRenderTexture();
|
||||
inline NzRenderTexture();
|
||||
inline ~NzRenderTexture();
|
||||
|
||||
bool AttachBuffer(nzAttachmentPoint attachmentPoint, nzUInt8 index, NzRenderBuffer* buffer);
|
||||
bool AttachBuffer(nzAttachmentPoint attachmentPoint, nzUInt8 index, nzPixelFormat format, unsigned int width, unsigned int height);
|
||||
@@ -38,18 +38,18 @@ class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget, NzNonCopyable
|
||||
|
||||
void Detach(nzAttachmentPoint attachmentPoint, nzUInt8 index);
|
||||
|
||||
unsigned int GetHeight() const;
|
||||
unsigned int GetHeight() const override;
|
||||
NzRenderTargetParameters GetParameters() const;
|
||||
NzVector2ui GetSize() const;
|
||||
unsigned int GetWidth() const;
|
||||
unsigned int GetWidth() const override;
|
||||
|
||||
bool IsComplete() const;
|
||||
bool IsRenderable() const;
|
||||
bool IsValid() const;
|
||||
inline bool IsValid() const;
|
||||
|
||||
bool Lock() const;
|
||||
|
||||
void SetColorTarget(nzUInt8 target) const;
|
||||
inline void SetColorTarget(nzUInt8 target) const;
|
||||
void SetColorTargets(const nzUInt8* targets, unsigned int targetCount) const;
|
||||
void SetColorTargets(const std::initializer_list<nzUInt8>& targets) const;
|
||||
|
||||
@@ -59,7 +59,7 @@ class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget, NzNonCopyable
|
||||
unsigned int GetOpenGLID() const;
|
||||
bool HasContext() const override;
|
||||
|
||||
static void Blit(NzRenderTexture* src, NzRenderTexture* dst, nzUInt32 buffers = nzRendererBuffer_Color | nzRendererBuffer_Depth | nzRendererBuffer_Stencil, bool bilinearFilter = false);
|
||||
static inline void Blit(NzRenderTexture* src, NzRenderTexture* dst, nzUInt32 buffers = nzRendererBuffer_Color | nzRendererBuffer_Depth | nzRendererBuffer_Stencil, bool bilinearFilter = false);
|
||||
static void Blit(NzRenderTexture* src, NzRectui srcRect, NzRenderTexture* dst, NzRectui dstRect, nzUInt32 buffers = nzRendererBuffer_Color | nzRendererBuffer_Depth | nzRendererBuffer_Stencil, bool bilinearFilter = false);
|
||||
static bool IsSupported();
|
||||
|
||||
@@ -69,6 +69,9 @@ class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget, NzNonCopyable
|
||||
void EnsureTargetUpdated() const override;
|
||||
|
||||
private:
|
||||
inline void InvalidateDrawBuffers() const;
|
||||
inline void InvalidateSize() const;
|
||||
inline void InvalidateTargets() const;
|
||||
void OnContextDestroy(const NzContext* context);
|
||||
void OnRenderBufferDestroy(const NzRenderBuffer* renderBuffer, unsigned int attachmentIndex);
|
||||
void OnTextureDestroy(const NzTexture* texture, unsigned int attachmentIndex);
|
||||
@@ -76,7 +79,13 @@ class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget, NzNonCopyable
|
||||
void UpdateSize() const;
|
||||
void UpdateTargets() const;
|
||||
|
||||
NzRenderTextureImpl* m_impl = nullptr;
|
||||
NzRenderTextureImpl* m_impl;
|
||||
mutable bool m_checked ;
|
||||
mutable bool m_drawBuffersUpdated;
|
||||
mutable bool m_sizeUpdated;
|
||||
mutable bool m_targetsUpdated;
|
||||
};
|
||||
|
||||
#include <Nazara/Renderer/RenderTexture.inl>
|
||||
|
||||
#endif // NAZARA_RENDERTEXTURE_HPP
|
||||
|
||||
53
include/Nazara/Renderer/RenderTexture.inl
Normal file
53
include/Nazara/Renderer/RenderTexture.inl
Normal file
@@ -0,0 +1,53 @@
|
||||
// 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/Core/Error.hpp>
|
||||
#include <cstring>
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
|
||||
inline NzRenderTexture::NzRenderTexture() :
|
||||
m_impl(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
inline NzRenderTexture::~NzRenderTexture()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
inline bool NzRenderTexture::IsValid() const
|
||||
{
|
||||
return m_impl != nullptr;
|
||||
}
|
||||
|
||||
inline void NzRenderTexture::SetColorTarget(nzUInt8 target) const
|
||||
{
|
||||
SetColorTargets(&target, 1);
|
||||
}
|
||||
|
||||
inline void NzRenderTexture::Blit(NzRenderTexture* src, NzRenderTexture* dst, nzUInt32 buffers, bool bilinearFilter)
|
||||
{
|
||||
Blit(src, src->GetSize(), dst, dst->GetSize(), buffers, bilinearFilter);
|
||||
}
|
||||
|
||||
inline void NzRenderTexture::InvalidateDrawBuffers() const
|
||||
{
|
||||
m_drawBuffersUpdated = false;
|
||||
}
|
||||
|
||||
inline void NzRenderTexture::InvalidateSize() const
|
||||
{
|
||||
m_sizeUpdated = false;
|
||||
|
||||
OnRenderTargetSizeChange(this);
|
||||
}
|
||||
|
||||
inline void NzRenderTexture::InvalidateTargets() const
|
||||
{
|
||||
m_checked = false;
|
||||
m_drawBuffersUpdated = false;
|
||||
m_targetsUpdated = false;
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user