Commit f68d1d23 authored by Michele Bosi's avatar Michele Bosi

Viewport: enableScissorSetup() -> setScissorEnabled()/isScissorEnabled()

parent 5237cb91
......@@ -51,7 +51,7 @@ Viewport::Viewport()
mClearStencil = 0;
mClearFlags = CF_CLEAR_COLOR_DEPTH;
mClearColorMode = CCM_Float;
mSetupScissor = true;
mScissorEnabled = true;
}
//-----------------------------------------------------------------------------
Viewport::Viewport(int x, int y, int w, int h)
......@@ -66,7 +66,7 @@ Viewport::Viewport(int x, int y, int w, int h)
mClearStencil = 0;
mClearFlags = CF_CLEAR_COLOR_DEPTH;
mClearColorMode = CCM_Float;
mSetupScissor = true;
mScissorEnabled = true;
}
//-----------------------------------------------------------------------------
void Viewport::activate() const
......@@ -117,14 +117,14 @@ void Viewport::activate() const
glDepthMask( GL_TRUE );
glStencilMask( GL_TRUE );
// setup scissor
if (mSetupScissor)
// enable scissor
if ( mScissorEnabled )
{
glEnable(GL_SCISSOR_TEST);
glScissor(x, y, w, h);
glEnable( GL_SCISSOR_TEST );
glScissor( x, y, w, h );
}
else {
glDisable(GL_SCISSOR_TEST);
glDisable( GL_SCISSOR_TEST );
}
switch( clearColorMode() )
......@@ -163,9 +163,4 @@ bool Viewport::isPointInside(int x, int y, int framebuffer_height) const
return true;
}
//-----------------------------------------------------------------------------
void Viewport::enableScissorSetup(bool enable)
{
mSetupScissor = enable;
}
//-----------------------------------------------------------------------------
......@@ -110,7 +110,8 @@ namespace vl
* If scissor setup is enabled (by default it is), then glScissor is called
* during activate().
*/
void enableScissorSetup(bool enable);
void setScissorEnabled(bool enable) { mScissorEnabled = enable; }
bool isScissorEnabled() const { return mScissorEnabled; }
protected:
fvec4 mClearColor;
......@@ -126,7 +127,7 @@ namespace vl
int mWidth;
int mHeight;
bool mSetupScissor;
bool mScissorEnabled;
};
}
......
......@@ -48,7 +48,7 @@ VividRendering::VividRendering() {
mCalibratedCamera = new vl::CalibratedCamera;
setCamera( mCalibratedCamera.get() );
mCalibratedCamera->viewport()->enableScissorSetup( false );
mCalibratedCamera->viewport()->setScissorEnabled( true );
mCalibratedCamera->viewport()->setClearColor( vl::lightgray );
// Settings
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment