//===========================================================================// // Copyright (C) Microsoft Corporation. All rights reserved. // //===========================================================================// #pragma once #define MLR_MLRCLIPPINGSTATE_HPP #if !defined(MLR_MLR_HPP) #include #endif namespace MidLevelRenderer { //########################################################################## //#################### MLRClippingState ############################## //########################################################################## class MLRClippingState { protected: int clippingState; public: MLRClippingState() { clippingState = 0; }; MLRClippingState(int i) { clippingState = i; }; MLRClippingState(const MLRClippingState& state) { clippingState = state.clippingState;} //########################################################################## // Attention !!! when changing the flags also change them in // Stuff::Vector4D::MultiplySetClip the assembler block // //########################################################################## enum { TopClipBit = 0, BottomClipBit, LeftClipBit, RightClipBit, NearClipBit, FarClipBit, NextBit }; enum { TopClipFlag = 1<w <= v4d->z) { SetFarClip(); } if(v4d->z < 0.0f) { SetNearClip(); } if(v4d->x < 0.0f) { SetRightClip(); } if(v4d->w < v4d->x) { SetLeftClip(); } if(v4d->y < 0.0f) { SetBottomClip(); } if(v4d->w < v4d->y) { SetTopClip(); } #endif } }