Add new Renderer architecture (far from complete)
Former-commit-id: 52226793d7a087dfe0523315d3303934daffee49 [formerly 9de1c04df6b371f861a2eee8bba38902ee5041cd] [formerly ecd3099df5498722f6390447f40bd3907b8e40c4 [formerly 3076df585565fc9759ab3e718270f2e5ef620840]] Former-commit-id: 92d52f967d0b088d1271afef26069e08cacd6b0f [formerly 5fe27e2ead104278951c772c2121a7b677f88d4d] Former-commit-id: fb6c2456d8edd3ec022d5d953f79fecdd4f2b8f4
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
// 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
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_TEXTURESAMPLER_HPP
|
||||
#define NAZARA_TEXTURESAMPLER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class Texture;
|
||||
|
||||
class NAZARA_RENDERER_API TextureSampler
|
||||
{
|
||||
friend class Renderer;
|
||||
|
||||
public:
|
||||
TextureSampler();
|
||||
TextureSampler(const TextureSampler& sampler) = default;
|
||||
|
||||
UInt8 GetAnisotropicLevel() const;
|
||||
SamplerFilter GetFilterMode() const;
|
||||
SamplerWrap GetWrapMode() const;
|
||||
|
||||
void SetAnisotropyLevel(UInt8 anisotropyLevel);
|
||||
void SetFilterMode(SamplerFilter filterMode);
|
||||
void SetWrapMode(SamplerWrap wrapMode);
|
||||
|
||||
TextureSampler& operator=(const TextureSampler& sampler) = default;
|
||||
|
||||
static UInt8 GetDefaultAnisotropicLevel();
|
||||
static SamplerFilter GetDefaultFilterMode();
|
||||
static SamplerWrap GetDefaultWrapMode();
|
||||
|
||||
static void SetDefaultAnisotropyLevel(UInt8 anisotropyLevel);
|
||||
static void SetDefaultFilterMode(SamplerFilter filterMode);
|
||||
static void SetDefaultWrapMode(SamplerWrap wrapMode);
|
||||
|
||||
private:
|
||||
void Apply(const Texture* texture) const;
|
||||
void Bind(unsigned int unit) const;
|
||||
unsigned int GetOpenGLID() const;
|
||||
void UpdateSamplerId() const;
|
||||
bool UseMipmaps(bool mipmaps);
|
||||
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
SamplerFilter m_filterMode;
|
||||
SamplerWrap m_wrapMode;
|
||||
UInt8 m_anisotropicLevel;
|
||||
bool m_mipmaps;
|
||||
mutable unsigned int m_samplerId;
|
||||
|
||||
static SamplerFilter s_defaultFilterMode;
|
||||
static SamplerWrap s_defaultWrapMode;
|
||||
static UInt8 s_defaultAnisotropyLevel;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_TEXTURESAMPLER_HPP
|
||||
Reference in New Issue
Block a user