#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_POLYGONOPTIONS_H #define NUCLEX_GRAPHICS_RASTERIZATION_POLYGONOPTIONS_H #include "../Config.h" #include "Options.h" #include "CullMode.h" #include "FillMode.h" #include namespace Nuclex { namespace Graphics { namespace Rasterization { // ------------------------------------------------------------------------------------------- // /// Various options that influence how polygons are rendered /// /// These are usually options you only set once and keep throughout your entire /// game's existence. /// class PolygonOptions : public Options { /// Initializes a new polygon option set public: NUCLEX_GRAPHICS_API PolygonOptions(); /// Frees all resources owned by the instance public: NUCLEX_GRAPHICS_API ~PolygonOptions(); /// Retrieves how polygons will be filled /// The selected fill mode public: NUCLEX_GRAPHICS_API FillMode::Enum GetFillMode() const { return this->fillMode; } /// Changes the polygon fill mode /// New fill mode to select public: NUCLEX_GRAPHICS_API void SetFillMode(FillMode::Enum fillMode) { this->fillMode = fillMode; OnChanged(); } /// Retrieves how polygons will be culled based on their vertex order /// The selected culling mode public: NUCLEX_GRAPHICS_API CullMode::Enum GetCullMode() const { return this->cullMode; } /// Changes the culling mode /// New culling mode to select public: NUCLEX_GRAPHICS_API void SetCullMode(CullMode::Enum cullMode) { this->cullMode = cullMode; OnChanged(); } /// Whether a clockwise face is considered the front face /// True if clockwise faces are considered to be front facing /// /// If false, counter-clockwise faces will be considered front facing. /// public: NUCLEX_GRAPHICS_API bool IsFrontFaceClockwise() const { return this->isFrontFaceClockwise; } /// Changes whether a clockwise face is considered the front face /// /// True to consider a clockwise face to be front facing /// /// /// If false, counter-clockwise faces will be considered front facing. /// public: NUCLEX_GRAPHICS_API void SetFrontFaceClockwise(bool isFrontFaceClockwise) { this->isFrontFaceClockwise = isFrontFaceClockwise; OnChanged(); } /// Whether rasterized geometry is also clipped by depth /// True if geometry should be clipped by depth public: NUCLEX_GRAPHICS_API bool IsDepthClippingEnabled() const { return this->isDepthClippingEnabled; } /// Enables or disables depth clipping of rasterized geometry /// Whether depth clipping should be performed public: NUCLEX_GRAPHICS_API void EnableDepthClipping(bool enable = true) { this->isDepthClippingEnabled = enable; OnChanged(); } /// Whether rendered geometry is limited to the scissor rectangle /// True if rendering should be restricted to the scissor rectangle public: NUCLEX_GRAPHICS_API bool IsScissorTestingEnabled() const { return this->isScissorTestingEnabled; } /// Switches whether rendering is restrict to the scissor rectangle /// Whether to restrict rendering to the scissor rectangle public: NUCLEX_GRAPHICS_API void EnableScissorTesting(bool enable = true) { this->isScissorTestingEnabled = enable; OnChanged(); } /// Current fill mode private: FillMode::Enum fillMode; /// Current cull mode private: CullMode::Enum cullMode; /// Whether clockwise faces are considered to be front facing private: bool isFrontFaceClockwise; /// Whether depth clipping is enabled private: bool isDepthClippingEnabled; /// Whether rendering will be restricted to the scissor rectangle private: bool isScissorTestingEnabled; }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Graphics::Rasterization #endif // NUCLEX_GRAPHICS_RASTERIZATION_POLYGONOPTIONS_H