예제 #1
0
 //---------------------------------------------------------------------
 Viewport::Viewport(RenderTarget* target, Real left, Real top, Real width, Real height)
     : mGlobalIndex( -1 )
     , mTarget(target)
     , mRelLeft(left)
     , mRelTop(top)
     , mRelWidth(width)
     , mRelHeight(height)
     // Actual dimensions will update later
     , mUpdated(false)
     , mShowOverlays(true)
     , mShowSkies(true)
     , mVisibilityMask(0)
     , mRQSequence(0)
     , mMaterialSchemeName(MaterialManager::DEFAULT_SCHEME_NAME)
     , mColourBuffer(CBT_BACK)
 {           
     // Set the default orientation mode
     mOrientationMode = mDefaultOrientationMode;
         
     // Set the default material scheme
     RenderSystem* rs = Root::getSingleton().getRenderSystem();
     mMaterialSchemeName = rs->_getDefaultViewportMaterialScheme();
     
     // Calculate actual dimensions
     _updateDimensions();
 }
예제 #2
0
    //---------------------------------------------------------------------
    Viewport::Viewport(Camera* cam, RenderTarget* target, Real left, Real top, Real width, Real height, int ZOrder)
        : mCamera(cam)
        , mTarget(target)
        , mRelLeft(left)
        , mRelTop(top)
        , mRelWidth(width)
        , mRelHeight(height)
        // Actual dimensions will update later
        , mZOrder(ZOrder)
        , mBackColour(ColourValue::Black)
        , mDepthClearValue(1)
        , mClearEveryFrame(true)
        , mClearBuffers(FBT_COLOUR | FBT_DEPTH)
        , mUpdated(false)
        , mShowOverlays(true)
        , mShowSkies(true)
        , mShowShadows(true)
        , mVisibilityMask(0xFFFFFFFF)
        , mRQSequence(0)
        , mMaterialSchemeName(MaterialManager::DEFAULT_SCHEME_NAME)
        , mIsAutoUpdated(true)
        , mColourBuffer(CBT_BACK)
        , mEnabled(true)
    {           
#if OGRE_COMPILER != OGRE_COMPILER_GCCE && OGRE_PLATFORM != OGRE_PLATFORM_ANDROID
        LogManager::getSingleton().stream(LML_TRIVIAL)
            << "Creating viewport on target '" << target->getName() << "'"
            << ", rendering from camera '" << (cam != 0 ? cam->getName() : "NULL") << "'"
            << ", relative dimensions " << std::ios::fixed << std::setprecision(2) 
            << "L: " << left << " T: " << top << " W: " << width << " H: " << height
            << " Z-order: " << ZOrder;
#endif

        // Set the default orientation mode
        mOrientationMode = mDefaultOrientationMode;
            
        // Set the default material scheme
        RenderSystem* rs = Root::getSingleton().getRenderSystem();
        mMaterialSchemeName = rs->_getDefaultViewportMaterialScheme();
        
        // Calculate actual dimensions
        _updateDimensions();

        // notify camera
        if(cam) cam->_notifyViewport(this);
    }