Merge branch 'NDK-Refactor' into NDK

Conflicts:
	examples/HardwareInfo/main.cpp
	include/Nazara/Renderer/Enums.hpp
	include/Nazara/Renderer/GpuQuery.hpp
	include/Nazara/Renderer/OpenGL.hpp
	include/Nazara/Renderer/RenderBuffer.hpp
	include/Nazara/Renderer/RenderTexture.hpp
	include/Nazara/Renderer/Texture.hpp
	src/Nazara/Graphics/AbstractRenderTechnique.cpp
	src/Nazara/Graphics/DeferredRenderTechnique.cpp
	src/Nazara/Graphics/Material.cpp
	src/Nazara/Graphics/SkyboxBackground.cpp
	src/Nazara/Renderer/GpuQuery.cpp
	src/Nazara/Renderer/OpenGL.cpp
	src/Nazara/Renderer/RenderBuffer.cpp
	src/Nazara/Renderer/RenderTexture.cpp
	src/Nazara/Renderer/Renderer.cpp
	src/Nazara/Renderer/Shader.cpp
	src/Nazara/Renderer/ShaderStage.cpp
	src/Nazara/Renderer/Texture.cpp

Former-commit-id: 2f1c7e9f9766f59ab83d9405856a1898ac4ab48f
This commit is contained in:
Lynix
2015-09-25 23:16:58 +02:00
613 changed files with 68051 additions and 66125 deletions

View File

@@ -18,107 +18,110 @@
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/VertexDeclaration.hpp>
class NzColor;
class NzContext;
class NzIndexBuffer;
class NzRenderTarget;
class NzShader;
class NzTexture;
class NzVertexBuffer;
class NAZARA_RENDERER_API NzRenderer
namespace Nz
{
friend NzTexture;
class Color;
class Context;
class IndexBuffer;
class RenderTarget;
class Shader;
class Texture;
class VertexBuffer;
public:
using DrawCall = void (*)(nzPrimitiveMode, unsigned int, unsigned int);
using DrawCallInstanced = void (*)(unsigned int, nzPrimitiveMode, unsigned int, unsigned int);
class NAZARA_RENDERER_API Renderer
{
friend Texture;
NzRenderer() = delete;
~NzRenderer() = delete;
public:
using DrawCall = void (*)(PrimitiveMode, unsigned int, unsigned int);
using DrawCallInstanced = void (*)(unsigned int, PrimitiveMode, unsigned int, unsigned int);
static void BeginCondition(const NzGpuQuery& query, nzGpuQueryCondition condition);
Renderer() = delete;
~Renderer() = delete;
static void Clear(nzUInt32 flags = nzRendererBuffer_Color | nzRendererBuffer_Depth);
static void BeginCondition(const GpuQuery& query, GpuQueryCondition condition);
static void DrawFullscreenQuad();
static void DrawIndexedPrimitives(nzPrimitiveMode mode, unsigned int firstIndex, unsigned int indexCount);
static void DrawIndexedPrimitivesInstanced(unsigned int instanceCount, nzPrimitiveMode mode, unsigned int firstIndex, unsigned int indexCount);
static void DrawPrimitives(nzPrimitiveMode mode, unsigned int firstVertex, unsigned int vertexCount);
static void DrawPrimitivesInstanced(unsigned int instanceCount, nzPrimitiveMode mode, unsigned int firstVertex, unsigned int vertexCount);
static void Clear(UInt32 flags = RendererBuffer_Color | RendererBuffer_Depth);
static void Enable(nzRendererParameter parameter, bool enable);
static void DrawFullscreenQuad();
static void DrawIndexedPrimitives(PrimitiveMode mode, unsigned int firstIndex, unsigned int indexCount);
static void DrawIndexedPrimitivesInstanced(unsigned int instanceCount, PrimitiveMode mode, unsigned int firstIndex, unsigned int indexCount);
static void DrawPrimitives(PrimitiveMode mode, unsigned int firstVertex, unsigned int vertexCount);
static void DrawPrimitivesInstanced(unsigned int instanceCount, PrimitiveMode mode, unsigned int firstVertex, unsigned int vertexCount);
static void EndCondition();
static void Enable(RendererParameter parameter, bool enable);
static void Flush();
static void EndCondition();
static nzRendererComparison GetDepthFunc();
static NzVertexBuffer* GetInstanceBuffer();
static float GetLineWidth();
static NzMatrix4f GetMatrix(nzMatrixType type);
static nzUInt8 GetMaxAnisotropyLevel();
static unsigned int GetMaxColorAttachments();
static unsigned int GetMaxRenderTargets();
static unsigned int GetMaxTextureSize();
static unsigned int GetMaxTextureUnits();
static unsigned int GetMaxVertexAttribs();
static float GetPointSize();
static const NzRenderStates& GetRenderStates();
static NzRecti GetScissorRect();
static const NzShader* GetShader();
static const NzRenderTarget* GetTarget();
static NzRecti GetViewport();
static void Flush();
static bool HasCapability(nzRendererCap capability);
static RendererComparison GetDepthFunc();
static VertexBuffer* GetInstanceBuffer();
static float GetLineWidth();
static Matrix4f GetMatrix(MatrixType type);
static UInt8 GetMaxAnisotropyLevel();
static unsigned int GetMaxColorAttachments();
static unsigned int GetMaxRenderTargets();
static unsigned int GetMaxTextureSize();
static unsigned int GetMaxTextureUnits();
static unsigned int GetMaxVertexAttribs();
static float GetPointSize();
static const RenderStates& GetRenderStates();
static Recti GetScissorRect();
static const Shader* GetShader();
static const RenderTarget* GetTarget();
static Recti GetViewport();
static bool Initialize();
static bool HasCapability(RendererCap capability);
static bool IsComponentTypeSupported(nzComponentType type);
static bool IsEnabled(nzRendererParameter parameter);
static bool IsInitialized();
static bool Initialize();
static void SetBlendFunc(nzBlendFunc srcBlend, nzBlendFunc dstBlend);
static void SetClearColor(const NzColor& color);
static void SetClearColor(nzUInt8 r, nzUInt8 g, nzUInt8 b, nzUInt8 a = 255);
static void SetClearDepth(double depth);
static void SetClearStencil(unsigned int value);
static void SetDepthFunc(nzRendererComparison compareFunc);
static void SetFaceCulling(nzFaceSide faceSide);
static void SetFaceFilling(nzFaceFilling fillingMode);
static void SetIndexBuffer(const NzIndexBuffer* indexBuffer);
static void SetLineWidth(float size);
static void SetMatrix(nzMatrixType type, const NzMatrix4f& matrix);
static void SetPointSize(float size);
static void SetRenderStates(const NzRenderStates& states);
static void SetScissorRect(const NzRecti& rect);
static void SetShader(const NzShader* shader);
static void SetStencilCompareFunction(nzRendererComparison compareFunc, nzFaceSide faceSide = nzFaceSide_FrontAndBack);
static void SetStencilFailOperation(nzStencilOperation failOperation, nzFaceSide faceSide = nzFaceSide_FrontAndBack);
static void SetStencilMask(nzUInt32 mask, nzFaceSide faceSide = nzFaceSide_FrontAndBack);
static void SetStencilPassOperation(nzStencilOperation passOperation, nzFaceSide faceSide = nzFaceSide_FrontAndBack);
static void SetStencilReferenceValue(unsigned int refValue, nzFaceSide faceSide = nzFaceSide_FrontAndBack);
static void SetStencilZFailOperation(nzStencilOperation zfailOperation, nzFaceSide faceSide = nzFaceSide_FrontAndBack);
static bool SetTarget(const NzRenderTarget* target);
static void SetTexture(nzUInt8 unit, const NzTexture* texture);
static void SetTextureSampler(nzUInt8 textureUnit, const NzTextureSampler& sampler);
static void SetVertexBuffer(const NzVertexBuffer* vertexBuffer);
static void SetViewport(const NzRecti& viewport);
static bool IsComponentTypeSupported(ComponentType type);
static bool IsEnabled(RendererParameter parameter);
static bool IsInitialized();
static void Uninitialize();
static void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend);
static void SetClearColor(const Color& color);
static void SetClearColor(UInt8 r, UInt8 g, UInt8 b, UInt8 a = 255);
static void SetClearDepth(double depth);
static void SetClearStencil(unsigned int value);
static void SetDepthFunc(RendererComparison compareFunc);
static void SetFaceCulling(FaceSide faceSide);
static void SetFaceFilling(FaceFilling fillingMode);
static void SetIndexBuffer(const IndexBuffer* indexBuffer);
static void SetLineWidth(float size);
static void SetMatrix(MatrixType type, const Matrix4f& matrix);
static void SetPointSize(float size);
static void SetRenderStates(const RenderStates& states);
static void SetScissorRect(const Recti& rect);
static void SetShader(const Shader* shader);
static void SetStencilCompareFunction(RendererComparison compareFunc, FaceSide faceSide = FaceSide_FrontAndBack);
static void SetStencilFailOperation(StencilOperation failOperation, FaceSide faceSide = FaceSide_FrontAndBack);
static void SetStencilMask(UInt32 mask, FaceSide faceSide = FaceSide_FrontAndBack);
static void SetStencilPassOperation(StencilOperation passOperation, FaceSide faceSide = FaceSide_FrontAndBack);
static void SetStencilReferenceValue(unsigned int refValue, FaceSide faceSide = FaceSide_FrontAndBack);
static void SetStencilZFailOperation(StencilOperation zfailOperation, FaceSide faceSide = FaceSide_FrontAndBack);
static bool SetTarget(const RenderTarget* target);
static void SetTexture(UInt8 unit, const Texture* texture);
static void SetTextureSampler(UInt8 textureUnit, const TextureSampler& sampler);
static void SetVertexBuffer(const VertexBuffer* vertexBuffer);
static void SetViewport(const Recti& viewport);
private:
static void EnableInstancing(bool instancing);
static bool EnsureStateUpdate();
static void OnContextRelease(const NzContext* context);
static void OnIndexBufferRelease(const NzIndexBuffer* indexBuffer);
static void OnShaderReleased(const NzShader* shader);
static void OnTextureReleased(const NzTexture* texture);
static void OnVertexBufferRelease(const NzVertexBuffer* vertexBuffer);
static void OnVertexDeclarationRelease(const NzVertexDeclaration* vertexDeclaration);
static void UpdateMatrix(nzMatrixType type);
static void Uninitialize();
static unsigned int s_moduleReferenceCounter;
};
private:
static void EnableInstancing(bool instancing);
static bool EnsureStateUpdate();
static void OnContextRelease(const Context* context);
static void OnIndexBufferRelease(const IndexBuffer* indexBuffer);
static void OnShaderReleased(const Shader* shader);
static void OnTextureReleased(const Texture* texture);
static void OnVertexBufferRelease(const VertexBuffer* vertexBuffer);
static void OnVertexDeclarationRelease(const VertexDeclaration* vertexDeclaration);
static void UpdateMatrix(MatrixType type);
static unsigned int s_moduleReferenceCounter;
};
}
#endif // NAZARA_RENDERER_HPP