Merge remote-tracking branch 'origin/master' into Resource-Update

Conflicts:
	include/Nazara/Audio/Music.hpp
	include/Nazara/Audio/SoundBuffer.hpp
	include/Nazara/Core/Resource.hpp
	include/Nazara/Core/ResourceListener.hpp
	include/Nazara/Graphics/Material.hpp
	include/Nazara/Renderer/Context.hpp
	include/Nazara/Renderer/RenderBuffer.hpp
	include/Nazara/Renderer/Shader.hpp
	include/Nazara/Renderer/Texture.hpp
	include/Nazara/Renderer/UberShader.hpp
	include/Nazara/Utility/Animation.hpp
	include/Nazara/Utility/Buffer.hpp
	include/Nazara/Utility/Image.hpp
	include/Nazara/Utility/IndexBuffer.hpp
	include/Nazara/Utility/Mesh.hpp
	include/Nazara/Utility/SkeletalMesh.hpp
	include/Nazara/Utility/Skeleton.hpp
	include/Nazara/Utility/StaticMesh.hpp
	include/Nazara/Utility/SubMesh.hpp
	include/Nazara/Utility/VertexBuffer.hpp
	include/Nazara/Utility/VertexDeclaration.hpp
	src/Nazara/Core/Resource.cpp
	src/Nazara/Core/ResourceListener.cpp
	src/Nazara/Graphics/DeferredRenderQueue.cpp
	src/Nazara/Graphics/ForwardRenderQueue.cpp
	src/Nazara/Graphics/SkinningManager.cpp
	src/Nazara/Renderer/RenderTexture.cpp
	src/Nazara/Renderer/Renderer.cpp
	src/Nazara/Utility/Mesh.cpp

Former-commit-id: 99b5ad26a19fe9c9f8118da7b5920bffe89f60f8
This commit is contained in:
Lynix
2015-01-25 19:29:55 +01:00
579 changed files with 11958 additions and 3706 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2014 Jérôme Leclercq
// 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
@@ -9,28 +9,31 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/NonCopyable.hpp>
#include <Nazara/Core/ObjectListenerWrapper.hpp>
#include <Nazara/Core/ObjectRef.hpp>
#include <Nazara/Core/RefCounted.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Renderer/Enums.hpp>
#include <Nazara/Utility/AbstractImage.hpp>
#include <Nazara/Utility/CubemapParams.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
class NzTexture;
using NzTextureConstListener = NzObjectListenerWrapper<const NzTexture>;
using NzTextureConstRef = NzObjectRef<const NzTexture>;
using NzTextureListener = NzObjectListenerWrapper<NzTexture>;
using NzTextureRef = NzObjectRef<NzTexture>;
struct NzTextureImpl;
class NAZARA_API NzTexture : public NzRefCounted, public NzResource, NzNonCopyable
class NAZARA_API NzTexture : public NzAbstractImage, public NzRefCounted, public NzResource, NzNonCopyable
{
friend class NzRenderer;
friend class NzRenderTexture;
public:
NzTexture() = default;
NzTexture(nzImageType type, nzPixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, nzUInt8 levelCount = 1);
explicit NzTexture(const NzImage& image);
~NzTexture();
@@ -43,18 +46,20 @@ class NAZARA_API NzTexture : public NzRefCounted, public NzResource, NzNonCopyab
void EnsureMipmapsUpdate() const;
nzUInt8 GetBytesPerPixel() const;
unsigned int GetDepth() const;
unsigned int GetDepth(nzUInt8 level = 0) const;
nzPixelFormat GetFormat() const;
unsigned int GetHeight() const;
NzVector2ui GetSize() const;
unsigned int GetHeight(nzUInt8 level = 0) const;
nzUInt8 GetLevelCount() const;
nzUInt8 GetMaxLevel() const;
unsigned int GetMemoryUsage() const;
unsigned int GetMemoryUsage(nzUInt8 level) const;
NzVector3ui GetSize(nzUInt8 level = 0) const;
nzImageType GetType() const;
unsigned int GetWidth() const;
unsigned int GetWidth(nzUInt8 level = 0) const;
bool HasMipmaps() const;
bool IsCompressed() const;
bool IsCubemap() const;
void InvalidateMipmaps();
bool IsValid() const;
// Load
@@ -63,6 +68,12 @@ class NAZARA_API NzTexture : public NzRefCounted, public NzResource, NzNonCopyab
bool LoadFromMemory(const void* data, std::size_t size, const NzImageParams& params = NzImageParams(), bool generateMipmaps = true);
bool LoadFromStream(NzInputStream& stream, const NzImageParams& params = NzImageParams(), bool generateMipmaps = true);
// LoadArray
bool LoadArrayFromFile(const NzString& filePath, const NzImageParams& imageParams = NzImageParams(), bool generateMipmaps = true, const NzVector2ui& atlasSize = NzVector2ui(2, 2));
bool LoadArrayFromImage(const NzImage& image, bool generateMipmaps = true, const NzVector2ui& atlasSize = NzVector2ui(2, 2));
bool LoadArrayFromMemory(const void* data, std::size_t size, const NzImageParams& imageParams = NzImageParams(), bool generateMipmaps = true, const NzVector2ui& atlasSize = NzVector2ui(2, 2));
bool LoadArrayFromStream(NzInputStream& stream, const NzImageParams& imageParams = NzImageParams(), bool generateMipmaps = true, const NzVector2ui& atlasSize = NzVector2ui(2, 2));
// LoadCubemap
bool LoadCubemapFromFile(const NzString& filePath, const NzImageParams& imageParams = NzImageParams(), bool generateMipmaps = true, const NzCubemapParams& cubemapParams = NzCubemapParams());
bool LoadCubemapFromImage(const NzImage& image, bool generateMipmaps = true, const NzCubemapParams& params = NzCubemapParams());
@@ -82,10 +93,6 @@ class NAZARA_API NzTexture : public NzRefCounted, public NzResource, NzNonCopyab
bool Update(const nzUInt8* pixels, unsigned int srcWidth = 0, unsigned int srcHeight = 0, nzUInt8 level = 0);
bool Update(const nzUInt8* pixels, const NzBoxui& box, unsigned int srcWidth = 0, unsigned int srcHeight = 0, nzUInt8 level = 0);
bool Update(const nzUInt8* pixels, const NzRectui& rect, unsigned int z = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0, nzUInt8 level = 0);
bool UpdateFace(nzCubemapFace face, const NzImage& image, nzUInt8 level = 0);
bool UpdateFace(nzCubemapFace face, const NzImage& image, const NzRectui& rect, nzUInt8 level = 0);
bool UpdateFace(nzCubemapFace face, const nzUInt8* pixels, unsigned int srcWidth = 0, unsigned int srcHeight = 0, nzUInt8 level = 0);
bool UpdateFace(nzCubemapFace face, const nzUInt8* pixels, const NzRectui& rect, unsigned int srcWidth = 0, unsigned int srcHeight = 0, nzUInt8 level = 0);
// Fonctions OpenGL
unsigned int GetOpenGLID() const;
@@ -96,7 +103,7 @@ class NAZARA_API NzTexture : public NzRefCounted, public NzResource, NzNonCopyab
static bool IsTypeSupported(nzImageType type);
private:
void InvalidateMipmaps();
bool CreateTexture(bool proxy);
NzTextureImpl* m_impl = nullptr;
};