Welcome back Cube effect
Currently working: * cube slide * basic cube * rotations * reflections Not working: * Cube Inside effects * Reflection plane (needs to be done in a shader) * cube caps * sphere/cylinder * filled in areas in multi desktopicc-effect-5.14.5
parent
9cfdeb1e2d
commit
82b8faadab
|
@ -90,6 +90,7 @@ endif( NOT KWIN_HAVE_OPENGLES_COMPOSITING )
|
||||||
# OpenGL-specific effects
|
# OpenGL-specific effects
|
||||||
if( KWIN_HAVE_OPENGL_COMPOSITING )
|
if( KWIN_HAVE_OPENGL_COMPOSITING )
|
||||||
include( coverswitch/CMakeLists.txt )
|
include( coverswitch/CMakeLists.txt )
|
||||||
|
include( cube/CMakeLists.txt )
|
||||||
include( flipswitch/CMakeLists.txt )
|
include( flipswitch/CMakeLists.txt )
|
||||||
include( glide/CMakeLists.txt )
|
include( glide/CMakeLists.txt )
|
||||||
include( mousemark/CMakeLists.txt )
|
include( mousemark/CMakeLists.txt )
|
||||||
|
@ -100,7 +101,6 @@ if( KWIN_HAVE_OPENGL_COMPOSITING )
|
||||||
endif( KWIN_HAVE_OPENGL_COMPOSITING )
|
endif( KWIN_HAVE_OPENGL_COMPOSITING )
|
||||||
if( KWIN_HAVE_OPENGL_COMPOSITING AND NOT KWIN_HAVE_OPENGLES_COMPOSITING )
|
if( KWIN_HAVE_OPENGL_COMPOSITING AND NOT KWIN_HAVE_OPENGLES_COMPOSITING )
|
||||||
include( blur/CMakeLists.txt )
|
include( blur/CMakeLists.txt )
|
||||||
include( cube/CMakeLists.txt )
|
|
||||||
include( explosion/CMakeLists.txt )
|
include( explosion/CMakeLists.txt )
|
||||||
include( invert/CMakeLists.txt )
|
include( invert/CMakeLists.txt )
|
||||||
include( lookingglass/CMakeLists.txt )
|
include( lookingglass/CMakeLists.txt )
|
||||||
|
|
|
@ -39,11 +39,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||||
|
#include "cube/cube_config.h"
|
||||||
|
#include "cube/cubeslide_config.h"
|
||||||
#ifndef KWIN_HAVE_OPENGLES
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
#include "blur/blur_config.h"
|
#include "blur/blur_config.h"
|
||||||
#include "coverswitch/coverswitch_config.h"
|
#include "coverswitch/coverswitch_config.h"
|
||||||
#include "cube/cube_config.h"
|
|
||||||
#include "cube/cubeslide_config.h"
|
|
||||||
#include "flipswitch/flipswitch_config.h"
|
#include "flipswitch/flipswitch_config.h"
|
||||||
#include "glide/glide_config.h"
|
#include "glide/glide_config.h"
|
||||||
#include "invert/invert_config.h"
|
#include "invert/invert_config.h"
|
||||||
|
@ -81,11 +81,11 @@ KWIN_EFFECT_CONFIG_MULTIPLE( builtins,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||||
|
KWIN_EFFECT_CONFIG_SINGLE( cube, CubeEffectConfig )
|
||||||
|
KWIN_EFFECT_CONFIG_SINGLE( cubeslide, CubeSlideEffectConfig )
|
||||||
#ifndef KWIN_HAVE_OPENGLES
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( blur, BlurEffectConfig )
|
KWIN_EFFECT_CONFIG_SINGLE( blur, BlurEffectConfig )
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( coverswitch, CoverSwitchEffectConfig )
|
KWIN_EFFECT_CONFIG_SINGLE( coverswitch, CoverSwitchEffectConfig )
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( cube, CubeEffectConfig )
|
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( cubeslide, CubeSlideEffectConfig )
|
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( flipswitch, FlipSwitchEffectConfig )
|
KWIN_EFFECT_CONFIG_SINGLE( flipswitch, FlipSwitchEffectConfig )
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( glide, GlideEffectConfig )
|
KWIN_EFFECT_CONFIG_SINGLE( glide, GlideEffectConfig )
|
||||||
KWIN_EFFECT_CONFIG_SINGLE( invert, InvertEffectConfig )
|
KWIN_EFFECT_CONFIG_SINGLE( invert, InvertEffectConfig )
|
||||||
|
|
|
@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <kwinglutils.h>
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
@ -195,7 +195,9 @@ void CubeEffect::loadConfig( QString config )
|
||||||
{
|
{
|
||||||
capTexture = new GLTexture( img );
|
capTexture = new GLTexture( img );
|
||||||
capTexture->setFilter( GL_LINEAR );
|
capTexture->setFilter( GL_LINEAR );
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
capTexture->setWrapMode( GL_CLAMP_TO_BORDER );
|
capTexture->setWrapMode( GL_CLAMP_TO_BORDER );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,21 +327,27 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
if( recompileList )
|
if( recompileList )
|
||||||
{
|
{
|
||||||
recompileList = false;
|
recompileList = false;
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
rotateCube();
|
||||||
|
#else
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glNewList( glList, GL_COMPILE );
|
glNewList( glList, GL_COMPILE );
|
||||||
rotateCube();
|
rotateCube();
|
||||||
glEndList();
|
glEndList();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// compile List for cube
|
// compile List for cube
|
||||||
if( useList )
|
if( useList )
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glNewList( glList + 1, GL_COMPILE );
|
glNewList( glList + 1, GL_COMPILE );
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
paintCube( mask, region, data );
|
paintCube( mask, region, data );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glEndList();
|
glEndList();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
||||||
|
@ -359,7 +367,9 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
wallpaper->unbind();
|
wallpaper->unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
|
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
|
||||||
|
#endif
|
||||||
glEnable( GL_BLEND );
|
glEnable( GL_BLEND );
|
||||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||||
|
|
||||||
|
@ -376,28 +386,48 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
{
|
{
|
||||||
// restrict painting the reflections to the current screen
|
// restrict painting the reflections to the current screen
|
||||||
PaintClipper::push( QRegion( rect ));
|
PaintClipper::push( QRegion( rect ));
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
#endif
|
||||||
// we can use a huge scale factor (needed to calculate the rearground vertices)
|
// we can use a huge scale factor (needed to calculate the rearground vertices)
|
||||||
// as we restrict with a PaintClipper painting on the current screen
|
// as we restrict with a PaintClipper painting on the current screen
|
||||||
float scaleFactor = 1000000 * tan( 60.0 * M_PI / 360.0f )/rect.height();
|
float scaleFactor = 1000000 * tan( 60.0 * M_PI / 360.0f )/rect.height();
|
||||||
|
m_reflectionMatrix.setToIdentity();
|
||||||
|
m_reflectionMatrix.scale(1.0, -1.0, 1.0);
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glScalef( 1.0, -1.0, 1.0 );
|
glScalef( 1.0, -1.0, 1.0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO reflection is not correct when mixing manual (mouse) rotating with rotation by cursor keys
|
// TODO reflection is not correct when mixing manual (mouse) rotating with rotation by cursor keys
|
||||||
// there's also a small bug when zooming
|
// there's also a small bug when zooming
|
||||||
float addedHeight1 = -sin( asin( float( rect.height() ) / mAddedHeightCoeff1 ) + fabs( manualVerticalAngle ) * M_PI / 180.0f ) * mAddedHeightCoeff1;
|
float addedHeight1 = -sin( asin( float( rect.height() ) / mAddedHeightCoeff1 ) + fabs( manualVerticalAngle ) * M_PI / 180.0f ) * mAddedHeightCoeff1;
|
||||||
float addedHeight2 = -sin( asin( float( rect.height() ) / mAddedHeightCoeff2 ) + fabs( manualVerticalAngle ) * M_PI / 180.0f ) * mAddedHeightCoeff2 - addedHeight1;
|
float addedHeight2 = -sin( asin( float( rect.height() ) / mAddedHeightCoeff2 ) + fabs( manualVerticalAngle ) * M_PI / 180.0f ) * mAddedHeightCoeff2 - addedHeight1;
|
||||||
if( manualVerticalAngle > 0.0f && effects->numberOfDesktops() & 1 )
|
if( manualVerticalAngle > 0.0f && effects->numberOfDesktops() & 1 )
|
||||||
|
{
|
||||||
|
m_reflectionMatrix.translate(0.0, cos( fabs( manualAngle ) * M_PI / 360.0f * float( effects->numberOfDesktops() ) ) * addedHeight2 + addedHeight1 - float( rect.height() ), 0.0);
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glTranslatef( 0.0, cos( fabs( manualAngle ) * M_PI / 360.0f * float( effects->numberOfDesktops() ) ) * addedHeight2 + addedHeight1 - float( rect.height() ), 0.0 );
|
glTranslatef( 0.0, cos( fabs( manualAngle ) * M_PI / 360.0f * float( effects->numberOfDesktops() ) ) * addedHeight2 + addedHeight1 - float( rect.height() ), 0.0 );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
m_reflectionMatrix.translate(0.0, sin( fabs( manualAngle ) * M_PI / 360.0f * float( effects->numberOfDesktops() ) ) * addedHeight2 + addedHeight1 - float( rect.height() ), 0.0);
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glTranslatef( 0.0, sin( fabs( manualAngle ) * M_PI / 360.0f * float( effects->numberOfDesktops() ) ) * addedHeight2 + addedHeight1 - float( rect.height() ), 0.0 );
|
glTranslatef( 0.0, sin( fabs( manualAngle ) * M_PI / 360.0f * float( effects->numberOfDesktops() ) ) * addedHeight2 + addedHeight1 - float( rect.height() ), 0.0 );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
|
// TODO: find a solution for GLES
|
||||||
glEnable( GL_CLIP_PLANE0 );
|
glEnable( GL_CLIP_PLANE0 );
|
||||||
|
#endif
|
||||||
reflectionPainting = true;
|
reflectionPainting = true;
|
||||||
glEnable( GL_CULL_FACE );
|
glEnable( GL_CULL_FACE );
|
||||||
// caps
|
// caps
|
||||||
if( paintCaps && ( effects->numberOfDesktops() >= 2 ) )
|
if( paintCaps && ( effects->numberOfDesktops() >= 2 ) )
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
||||||
|
@ -423,16 +453,20 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glCullFace( GL_BACK );
|
glCullFace( GL_BACK );
|
||||||
glCallList( glList + 2 );
|
glCallList( glList + 2 );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// cube
|
// cube
|
||||||
glCullFace( GL_FRONT );
|
glCullFace( GL_BACK );
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
{
|
{
|
||||||
cylinderShader->bind();
|
cylinderShader->bind();
|
||||||
cylinderShader->setUniform( "front", 1.0f );
|
cylinderShader->setUniform( "front", 1.0f );
|
||||||
cylinderShader->unbind();
|
cylinderShader->unbind();
|
||||||
}
|
}
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
paintCube( mask, region, data );
|
||||||
|
#else
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
if( useList )
|
if( useList )
|
||||||
|
@ -444,25 +478,31 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
|
|
||||||
// call the inside cube effects
|
// call the inside cube effects
|
||||||
foreach( CubeInsideEffect* inside, m_cubeInsideEffects )
|
foreach( CubeInsideEffect* inside, m_cubeInsideEffects )
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
||||||
glRotatef( (1-frontDesktop)*360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
glRotatef( (1-frontDesktop)*360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
||||||
inside->paint();
|
inside->paint();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
glCullFace( GL_BACK );
|
glCullFace( GL_FRONT );
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
{
|
{
|
||||||
cylinderShader->bind();
|
cylinderShader->bind();
|
||||||
cylinderShader->setUniform( "front", -1.0f );
|
cylinderShader->setUniform( "front", -1.0f );
|
||||||
cylinderShader->unbind();
|
cylinderShader->unbind();
|
||||||
}
|
}
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
paintCube( mask, region, data );
|
||||||
|
#else
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
if( useList )
|
if( useList )
|
||||||
|
@ -474,10 +514,12 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
|
|
||||||
// cap
|
// cap
|
||||||
if( paintCaps && ( effects->numberOfDesktops() >= 2 ) )
|
if( paintCaps && ( effects->numberOfDesktops() >= 2 ) )
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
||||||
|
@ -502,11 +544,16 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glCullFace( GL_FRONT );
|
glCullFace( GL_FRONT );
|
||||||
glCallList( glList + 2 );
|
glCallList( glList + 2 );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
glDisable( GL_CULL_FACE );
|
glDisable( GL_CULL_FACE );
|
||||||
reflectionPainting = false;
|
reflectionPainting = false;
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
|
// TODO: find a solution for GLES
|
||||||
glDisable( GL_CLIP_PLANE0 );
|
glDisable( GL_CLIP_PLANE0 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef( rect.x() + rect.width()*0.5f, 0.0, 0.0 );
|
glTranslatef( rect.x() + rect.width()*0.5f, 0.0, 0.0 );
|
||||||
|
@ -532,12 +579,14 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glVertex3f( vertices[9], vertices[10], vertices[11] );
|
glVertex3f( vertices[9], vertices[10], vertices[11] );
|
||||||
glEnd();
|
glEnd();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
PaintClipper::pop( QRegion( rect ));
|
PaintClipper::pop( QRegion( rect ));
|
||||||
}
|
}
|
||||||
glEnable( GL_CULL_FACE );
|
glEnable( GL_CULL_FACE );
|
||||||
// caps
|
// caps
|
||||||
if( paintCaps && ( effects->numberOfDesktops() >= 2 ))
|
if( paintCaps && ( effects->numberOfDesktops() >= 2 ))
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
||||||
|
@ -569,10 +618,11 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glCullFace( GL_FRONT );
|
glCullFace( GL_FRONT );
|
||||||
glCallList( glList + 2 );
|
glCallList( glList + 2 );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// cube
|
// cube
|
||||||
glCullFace( GL_BACK );
|
glCullFace( GL_FRONT );
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
{
|
{
|
||||||
cylinderShader->bind();
|
cylinderShader->bind();
|
||||||
|
@ -585,6 +635,9 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
sphereShader->setUniform( "front", -1.0f );
|
sphereShader->setUniform( "front", -1.0f );
|
||||||
sphereShader->unbind();
|
sphereShader->unbind();
|
||||||
}
|
}
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
paintCube( mask, region, data );
|
||||||
|
#else
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
if( useList )
|
if( useList )
|
||||||
|
@ -596,20 +649,23 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// call the inside cube effects
|
// call the inside cube effects
|
||||||
foreach( CubeInsideEffect* inside, m_cubeInsideEffects )
|
foreach( CubeInsideEffect* inside, m_cubeInsideEffects )
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
||||||
glRotatef( (1-frontDesktop)*360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
glRotatef( (1-frontDesktop)*360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
||||||
inside->paint();
|
inside->paint();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
glCullFace( GL_FRONT );
|
glCullFace( GL_BACK );
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
{
|
{
|
||||||
cylinderShader->bind();
|
cylinderShader->bind();
|
||||||
|
@ -622,6 +678,9 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
sphereShader->setUniform( "front", 1.0f );
|
sphereShader->setUniform( "front", 1.0f );
|
||||||
sphereShader->unbind();
|
sphereShader->unbind();
|
||||||
}
|
}
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
paintCube( mask, region, data );
|
||||||
|
#else
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
if( useList )
|
if( useList )
|
||||||
|
@ -635,10 +694,12 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
// we painted once without glList, now it's safe to paint using lists
|
// we painted once without glList, now it's safe to paint using lists
|
||||||
useList = true;
|
useList = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
// cap
|
// cap
|
||||||
if( paintCaps && ( effects->numberOfDesktops() >= 2 ))
|
if( paintCaps && ( effects->numberOfDesktops() >= 2 ))
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glCallList( glList );
|
glCallList( glList );
|
||||||
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
glTranslatef( rect.width()/2, 0.0, -point-zTranslate );
|
||||||
|
@ -671,11 +732,14 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||||
glCullFace( GL_BACK );
|
glCullFace( GL_BACK );
|
||||||
glCallList( glList + 2 );
|
glCallList( glList + 2 );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
glDisable( GL_CULL_FACE );
|
glDisable( GL_CULL_FACE );
|
||||||
|
|
||||||
glDisable( GL_BLEND );
|
glDisable( GL_BLEND );
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
|
#endif
|
||||||
|
|
||||||
// desktop name box - inspired from coverswitch
|
// desktop name box - inspired from coverswitch
|
||||||
if( displayDesktopName )
|
if( displayDesktopName )
|
||||||
|
@ -703,6 +767,7 @@ void CubeEffect::rotateCube()
|
||||||
{
|
{
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
||||||
|
|
||||||
|
m_rotationMatrix.setToIdentity();
|
||||||
float internalCubeAngle = 360.0f / effects->numberOfDesktops();
|
float internalCubeAngle = 360.0f / effects->numberOfDesktops();
|
||||||
float zTranslate = zPosition + zoom;
|
float zTranslate = zPosition + zoom;
|
||||||
if( start )
|
if( start )
|
||||||
|
@ -769,9 +834,14 @@ void CubeEffect::rotateCube()
|
||||||
}
|
}
|
||||||
if( stop )
|
if( stop )
|
||||||
angle *= (1.0 - timeLine.value());
|
angle *= (1.0 - timeLine.value());
|
||||||
|
m_rotationMatrix.translate(rect.width()/2, rect.height()/2, -point-zTranslate);
|
||||||
|
m_rotationMatrix.rotate(angle, 1.0, 0.0, 0.0);
|
||||||
|
m_rotationMatrix.translate(-rect.width()/2, -rect.height()/2, point+zTranslate);
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
||||||
glRotatef( angle, 1.0, 0.0, 0.0 );
|
glRotatef( angle, 1.0, 0.0, 0.0 );
|
||||||
glTranslatef( -rect.width()/2, -rect.height()/2, point+zTranslate );
|
glTranslatef( -rect.width()/2, -rect.height()/2, point+zTranslate );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if( rotating || (manualAngle != 0.0) )
|
if( rotating || (manualAngle != 0.0) )
|
||||||
{
|
{
|
||||||
|
@ -822,9 +892,14 @@ void CubeEffect::rotateCube()
|
||||||
rotationAngle = manualAngle * (1.0 - timeLine.value());
|
rotationAngle = manualAngle * (1.0 - timeLine.value());
|
||||||
else
|
else
|
||||||
rotationAngle += manualAngle * (1.0 - timeLine.value());
|
rotationAngle += manualAngle * (1.0 - timeLine.value());
|
||||||
|
m_rotationMatrix.translate(rect.width()/2, rect.height()/2, -point-zTranslate);
|
||||||
|
m_rotationMatrix.rotate(rotationAngle, 0.0, 1.0, 0.0);
|
||||||
|
m_rotationMatrix.translate(-rect.width()/2, -rect.height()/2, point+zTranslate);
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
||||||
glRotatef( rotationAngle, 0.0, 1.0, 0.0 );
|
glRotatef( rotationAngle, 0.0, 1.0, 0.0 );
|
||||||
glTranslatef( -rect.width()/2, -rect.height()/2, point+zTranslate );
|
glTranslatef( -rect.width()/2, -rect.height()/2, point+zTranslate );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,6 +942,7 @@ void CubeEffect::paintCube( int mask, QRegion region, ScreenPaintData& data )
|
||||||
|
|
||||||
void CubeEffect::paintCap()
|
void CubeEffect::paintCap()
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
if( ( !paintCaps ) || effects->numberOfDesktops() <= 2 )
|
if( ( !paintCaps ) || effects->numberOfDesktops() <= 2 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -927,10 +1003,12 @@ void CubeEffect::paintCap()
|
||||||
}
|
}
|
||||||
glEndList();
|
glEndList();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CubeEffect::paintCubeCap()
|
void CubeEffect::paintCubeCap()
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
||||||
float cubeAngle = (float)((float)(effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f);
|
float cubeAngle = (float)((float)(effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f);
|
||||||
float z = rect.width()/2*tan(cubeAngle*0.5f*M_PI/180.0f);
|
float z = rect.width()/2*tan(cubeAngle*0.5f*M_PI/180.0f);
|
||||||
|
@ -1035,10 +1113,12 @@ void CubeEffect::paintCubeCap()
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CubeEffect::paintCylinderCap()
|
void CubeEffect::paintCylinderCap()
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
||||||
float cubeAngle = (float)((float)(effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f);
|
float cubeAngle = (float)((float)(effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f);
|
||||||
|
|
||||||
|
@ -1067,10 +1147,12 @@ void CubeEffect::paintCylinderCap()
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CubeEffect::paintSphereCap()
|
void CubeEffect::paintSphereCap()
|
||||||
{
|
{
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
|
||||||
float cubeAngle = (float)((float)(effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f);
|
float cubeAngle = (float)((float)(effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f);
|
||||||
float zTexture = rect.width()/2*tan(45.0f*M_PI/180.0f);
|
float zTexture = rect.width()/2*tan(45.0f*M_PI/180.0f);
|
||||||
|
@ -1115,6 +1197,7 @@ void CubeEffect::paintSphereCap()
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CubeEffect::postPaintScreen()
|
void CubeEffect::postPaintScreen()
|
||||||
|
@ -1178,8 +1261,10 @@ void CubeEffect::postPaintScreen()
|
||||||
|
|
||||||
effects->setActiveFullScreenEffect( 0 );
|
effects->setActiveFullScreenEffect( 0 );
|
||||||
|
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
// delete the GL lists
|
// delete the GL lists
|
||||||
glDeleteLists( glList, 3 );
|
glDeleteLists( glList, 3 );
|
||||||
|
#endif
|
||||||
desktopNameFrame->free();
|
desktopNameFrame->free();
|
||||||
}
|
}
|
||||||
effects->addRepaintFull();
|
effects->addRepaintFull();
|
||||||
|
@ -1320,7 +1405,7 @@ void CubeEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int
|
||||||
int prev_desktop = painting_desktop -1;
|
int prev_desktop = painting_desktop -1;
|
||||||
if( prev_desktop == 0 )
|
if( prev_desktop == 0 )
|
||||||
prev_desktop = effects->numberOfDesktops();
|
prev_desktop = effects->numberOfDesktops();
|
||||||
if( w->isOnDesktop( prev_desktop ) && mode == Cube )
|
if( w->isOnDesktop( prev_desktop ) && mode == Cube && !useZOrdering )
|
||||||
{
|
{
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, prev_desktop);
|
QRect rect = effects->clientArea( FullArea, activeScreen, prev_desktop);
|
||||||
if( w->x()+w->width() > rect.x() + rect.width() )
|
if( w->x()+w->width() > rect.x() + rect.width() )
|
||||||
|
@ -1344,7 +1429,7 @@ void CubeEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int
|
||||||
int next_desktop = painting_desktop +1;
|
int next_desktop = painting_desktop +1;
|
||||||
if( next_desktop > effects->numberOfDesktops() )
|
if( next_desktop > effects->numberOfDesktops() )
|
||||||
next_desktop = 1;
|
next_desktop = 1;
|
||||||
if( w->isOnDesktop( next_desktop ) && mode == Cube )
|
if( w->isOnDesktop( next_desktop ) && mode == Cube && !useZOrdering )
|
||||||
{
|
{
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, next_desktop);
|
QRect rect = effects->clientArea( FullArea, activeScreen, next_desktop);
|
||||||
if( w->x() < rect.x() )
|
if( w->x() < rect.x() )
|
||||||
|
@ -1373,6 +1458,8 @@ void CubeEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int
|
||||||
|
|
||||||
void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
|
void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
|
||||||
{
|
{
|
||||||
|
GLShader *shader = ShaderManager::instance()->pushShader(ShaderManager::GenericShader);
|
||||||
|
QMatrix4x4 origMatrix;
|
||||||
if( activated && cube_painting )
|
if( activated && cube_painting )
|
||||||
{
|
{
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
|
@ -1454,7 +1541,9 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
int next_desktop = painting_desktop +1;
|
int next_desktop = painting_desktop +1;
|
||||||
if( next_desktop > effects->numberOfDesktops() )
|
if( next_desktop > effects->numberOfDesktops() )
|
||||||
next_desktop = 1;
|
next_desktop = 1;
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
#endif
|
||||||
if( w->isOnDesktop( prev_desktop ) && ( mask & PAINT_WINDOW_TRANSFORMED ) )
|
if( w->isOnDesktop( prev_desktop ) && ( mask & PAINT_WINDOW_TRANSFORMED ) )
|
||||||
{
|
{
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, prev_desktop);
|
QRect rect = effects->clientArea( FullArea, activeScreen, prev_desktop);
|
||||||
|
@ -1467,6 +1556,9 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.quads = new_quads;
|
data.quads = new_quads;
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
data.xTranslate = -rect.width();
|
||||||
|
#else
|
||||||
RotationData rot = RotationData();
|
RotationData rot = RotationData();
|
||||||
rot.axis = RotationData::YAxis;
|
rot.axis = RotationData::YAxis;
|
||||||
rot.xRotationPoint = rect.width() - w->x();
|
rot.xRotationPoint = rect.width() - w->x();
|
||||||
|
@ -1477,6 +1569,7 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
glTranslatef( rect.width()/2, 0.0, -point );
|
glTranslatef( rect.width()/2, 0.0, -point );
|
||||||
glRotatef( -360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
glRotatef( -360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
||||||
glTranslatef( -rect.width()/2, 0.0, point );
|
glTranslatef( -rect.width()/2, 0.0, point );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if( w->isOnDesktop( next_desktop ) && ( mask & PAINT_WINDOW_TRANSFORMED ) )
|
if( w->isOnDesktop( next_desktop ) && ( mask & PAINT_WINDOW_TRANSFORMED ) )
|
||||||
{
|
{
|
||||||
|
@ -1490,6 +1583,9 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.quads = new_quads;
|
data.quads = new_quads;
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
data.xTranslate = rect.width();
|
||||||
|
#else
|
||||||
RotationData rot = RotationData();
|
RotationData rot = RotationData();
|
||||||
rot.axis = RotationData::YAxis;
|
rot.axis = RotationData::YAxis;
|
||||||
rot.xRotationPoint = -w->x();
|
rot.xRotationPoint = -w->x();
|
||||||
|
@ -1500,6 +1596,7 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
glTranslatef( rect.width()/2, 0.0, -point );
|
glTranslatef( rect.width()/2, 0.0, -point );
|
||||||
glRotatef( 360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
glRotatef( 360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
||||||
glTranslatef( -rect.width()/2, 0.0, point );
|
glTranslatef( -rect.width()/2, 0.0, point );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, painting_desktop );
|
QRect rect = effects->clientArea( FullArea, activeScreen, painting_desktop );
|
||||||
|
|
||||||
|
@ -1577,10 +1674,22 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
}
|
}
|
||||||
data.quads = new_quads;
|
data.quads = new_quads;
|
||||||
}
|
}
|
||||||
|
if (shader) {
|
||||||
|
origMatrix = shader->getUniformMatrix4x4("screenTransformation");
|
||||||
|
if (reflectionPainting) {
|
||||||
|
shader->setUniform("screenTransformation", m_rotationMatrix*m_reflectionMatrix*origMatrix);
|
||||||
|
} else {
|
||||||
|
shader->setUniform("screenTransformation", m_rotationMatrix*origMatrix);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
effects->paintWindow( w, mask, region, data );
|
effects->paintWindow( w, mask, region, data );
|
||||||
if( activated && cube_painting )
|
if( activated && cube_painting )
|
||||||
{
|
{
|
||||||
|
if (shader) {
|
||||||
|
shader->setUniform("screenTransformation", origMatrix);
|
||||||
|
ShaderManager::instance()->popShader();
|
||||||
|
}
|
||||||
if( w->isDesktop() && effects->numScreens() > 1 && paintCaps )
|
if( w->isDesktop() && effects->numScreens() > 1 && paintCaps )
|
||||||
{
|
{
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, painting_desktop );
|
QRect rect = effects->clientArea( FullArea, activeScreen, painting_desktop );
|
||||||
|
@ -1593,6 +1702,7 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
}
|
}
|
||||||
paint = paint.subtracted( QRegion( w->geometry()));
|
paint = paint.subtracted( QRegion( w->geometry()));
|
||||||
// in case of free area in multiscreen setup fill it with cap color
|
// in case of free area in multiscreen setup fill it with cap color
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
if( !paint.isEmpty() )
|
if( !paint.isEmpty() )
|
||||||
{
|
{
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
|
@ -1644,8 +1754,11 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
glDisable( GL_BLEND );
|
glDisable( GL_BLEND );
|
||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
if( mode == Cylinder )
|
if( mode == Cylinder )
|
||||||
cylinderShader->unbind();
|
cylinderShader->unbind();
|
||||||
if( mode == Sphere )
|
if( mode == Sphere )
|
||||||
|
@ -2044,19 +2157,23 @@ void CubeEffect::setActive( bool active )
|
||||||
manualVerticalAngle = 0.0;
|
manualVerticalAngle = 0.0;
|
||||||
if( reflection )
|
if( reflection )
|
||||||
{
|
{
|
||||||
|
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop());
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
// clip parts above the reflection area
|
// clip parts above the reflection area
|
||||||
double eqn[4] = {0.0, 1.0, 0.0, 0.0};
|
double eqn[4] = {0.0, 1.0, 0.0, 0.0};
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop());
|
|
||||||
glTranslatef( 0.0, rect.height(), 0.0 );
|
glTranslatef( 0.0, rect.height(), 0.0 );
|
||||||
glClipPlane( GL_CLIP_PLANE0, eqn );
|
glClipPlane( GL_CLIP_PLANE0, eqn );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
float temporaryCoeff = float( rect.width() ) / tan( M_PI / float( effects->numberOfDesktops() ) );
|
float temporaryCoeff = float( rect.width() ) / tan( M_PI / float( effects->numberOfDesktops() ) );
|
||||||
mAddedHeightCoeff1 = sqrt( float( rect.height() ) * float( rect.height() ) + temporaryCoeff * temporaryCoeff );
|
mAddedHeightCoeff1 = sqrt( float( rect.height() ) * float( rect.height() ) + temporaryCoeff * temporaryCoeff );
|
||||||
mAddedHeightCoeff2 = sqrt( float( rect.height() ) * float( rect.height() ) + float( rect.width() ) * float( rect.width() ) + temporaryCoeff * temporaryCoeff );
|
mAddedHeightCoeff2 = sqrt( float( rect.height() ) * float( rect.height() ) + float( rect.width() ) * float( rect.width() ) + temporaryCoeff * temporaryCoeff );
|
||||||
}
|
}
|
||||||
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
// create the needed GL lists
|
// create the needed GL lists
|
||||||
glList = glGenLists(3);
|
glList = glGenLists(3);
|
||||||
|
#endif
|
||||||
capListCreated = false;
|
capListCreated = false;
|
||||||
recompileList = true;
|
recompileList = true;
|
||||||
useList = false;
|
useList = false;
|
||||||
|
|
|
@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <kshortcut.h>
|
#include <kshortcut.h>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
|
#include <QMatrix4x4>
|
||||||
#include "cube_inside.h"
|
#include "cube_inside.h"
|
||||||
#include "cube_proxy.h"
|
#include "cube_proxy.h"
|
||||||
|
|
||||||
|
@ -167,6 +168,8 @@ class CubeEffect
|
||||||
bool capListCreated;
|
bool capListCreated;
|
||||||
bool recompileList;
|
bool recompileList;
|
||||||
GLuint glList;
|
GLuint glList;
|
||||||
|
QMatrix4x4 m_rotationMatrix;
|
||||||
|
QMatrix4x4 m_reflectionMatrix;
|
||||||
|
|
||||||
// Shortcuts - needed to toggle the effect
|
// Shortcuts - needed to toggle the effect
|
||||||
KShortcut cubeShortcut;
|
KShortcut cubeShortcut;
|
||||||
|
|
|
@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <kwinglutils.h>
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
@ -81,18 +81,27 @@ void CubeSlideEffect::paintScreen( int mask, QRegion region, ScreenPaintData& da
|
||||||
{
|
{
|
||||||
if( !slideRotations.empty() )
|
if( !slideRotations.empty() )
|
||||||
{
|
{
|
||||||
|
#ifdef KWIN_HAVE_OPENGLES
|
||||||
|
glEnable( GL_CULL_FACE );
|
||||||
|
glCullFace( GL_FRONT );
|
||||||
|
paintSlideCube( mask, region, data );
|
||||||
|
glCullFace( GL_BACK );
|
||||||
|
paintSlideCube( mask, region, data );
|
||||||
|
glDisable( GL_CULL_FACE );
|
||||||
|
#else
|
||||||
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
|
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
|
||||||
glEnable( GL_CULL_FACE );
|
glEnable( GL_CULL_FACE );
|
||||||
glCullFace( GL_BACK );
|
glCullFace( GL_FRONT );
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
paintSlideCube( mask, region, data );
|
paintSlideCube( mask, region, data );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glCullFace( GL_FRONT );
|
glCullFace( GL_BACK );
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
paintSlideCube( mask, region, data );
|
paintSlideCube( mask, region, data );
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glDisable( GL_CULL_FACE );
|
glDisable( GL_CULL_FACE );
|
||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
|
#endif
|
||||||
if( dontSlidePanels )
|
if( dontSlidePanels )
|
||||||
{
|
{
|
||||||
foreach( EffectWindow* w, panels )
|
foreach( EffectWindow* w, panels )
|
||||||
|
|
Loading…
Reference in New Issue