#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_GRAPHICS_RASTERIZATION_SAMPLEROPTIONS_H #define NUCLEX_GRAPHICS_RASTERIZATION_SAMPLEROPTIONS_H #include "../Config.h" #include "Options.h" #include "Filter.h" #include "AddressMode.h" #include namespace Nuclex { namespace Graphics { namespace Rasterization { // ------------------------------------------------------------------------------------------- // /// Various options that influence how textures are accessed class SamplerOptions : public Options { /// Initializes a new stampler option set public: NUCLEX_GRAPHICS_API SamplerOptions(); /// Frees all resources owned by the instance public: NUCLEX_GRAPHICS_API ~SamplerOptions(); /// Retrieves the minification filter to be used on textures /// The selected texture minification filter public: NUCLEX_GRAPHICS_API Filter::Enum GetMinificationFilter() const { return this->minificationFilter; } /// Selects the minification filter to be used on textures /// The minification filter to be used on textures public: NUCLEX_GRAPHICS_API void SetMinificationFilter(Filter::Enum filter) { this->minificationFilter = filter; OnChanged(); } /// Retrieves the magnification filter to be used on textures /// The selected texture magnification filter public: NUCLEX_GRAPHICS_API Filter::Enum GetMagnificationFilter() const { return this->magnificationFilter; } /// Selects the magnification filter to be used on textures /// The magnification filter to be used on textures public: NUCLEX_GRAPHICS_API void SetMagnificationFilter(Filter::Enum filter) { this->magnificationFilter = filter; OnChanged(); } /// Retrieves the filter to be used between a texture's mip map levels /// The select filter to interpolate between mip map levels public: NUCLEX_GRAPHICS_API Filter::Enum GetMipMapFilter() const { return this->mipMapFilter; } /// Selects the filter to be used between a texture's mip map levels /// The filter to be used to interpolate between mip map levels public: NUCLEX_GRAPHICS_API void SetMipMapFilter(Filter::Enum filter) { this->mipMapFilter = filter; OnChanged(); } /// Retrieves the texture addressing mode for the specified dimension /// /// Index of the dimension whose addressing mode will be looked up /// /// The texture addressing mode used for the specified dimension public: NUCLEX_GRAPHICS_API AddressMode::Enum GetTextureAddressMode( std::size_t dimensionIndex ) const { switch(dimensionIndex) { case 0: { return this->textureAddressModeU; } case 1: { return this->textureAddressModeV; } case 2: { return this->textureAddressModeW; } default: { throw std::runtime_error("Invalid texture dimension index"); } } } /// Selects the texture addressing mode for the specified dimension /// /// Index of the dimension whose addressing mode will be changed /// /// /// The texture addressing mode to use with the specified dimension /// public: NUCLEX_GRAPHICS_API void SetTextureAddressMode( std::size_t dimensionIndex, AddressMode::Enum mode ) { switch(dimensionIndex) { case 0: { this->textureAddressModeU = mode; break; } case 1: { this->textureAddressModeV = mode; break; } case 2: { this->textureAddressModeW = mode; break; } default: { throw std::runtime_error("Invalid texture dimension index"); } } } /// Minification filter for when textures are rendered smaller private: Filter::Enum minificationFilter; /// Magnification filter for when textures are rendered bigger private: Filter::Enum magnificationFilter; /// Filter to use for interpolation between mip map levels private: Filter::Enum mipMapFilter; /// Adressing mode for a texture coordinates on the U axis private: AddressMode::Enum textureAddressModeU; /// Adressing mode for a texture coordinates on the V axis private: AddressMode::Enum textureAddressModeV; /// Adressing mode for a texture coordinates on the W axis private: AddressMode::Enum textureAddressModeW; }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Graphics::Rasterization #endif // NUCLEX_GRAPHICS_RASTERIZATION_SAMPLEROPTIONS_H