2007-03-16 13:02:47 +00:00
|
|
|
/*****************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
#ifndef KWIN_EXPLOSIONEFFECT_H
|
|
|
|
#define KWIN_EXPLOSIONEFFECT_H
|
|
|
|
|
|
|
|
// Include with base class for effects.
|
2007-04-21 12:57:15 +00:00
|
|
|
#include <kwineffects.h>
|
|
|
|
|
|
|
|
#include <QMap>
|
2007-03-16 13:02:47 +00:00
|
|
|
|
2007-04-05 12:07:35 +00:00
|
|
|
namespace KWin
|
2007-03-16 13:02:47 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class GLShader;
|
Add GLTexture class. This is a convenient wrapper around managing an OpenGL texture, as well as loading an image into it. Includes support for loading from QImage, QPixmap, and a file. Defaults to a GL_TEXTURE_2D target, and will scale image if necessary.
Also add SceneOpenGL::Texture class, based on GLTexture. Optimised for SceneOpenGL::Window, this adds support for loading from an X Pixmap, as well as taking advantage of texture_from_pixmap/shm when available. Automatically detects what texture target should be used, so be sure to enableUnnormalizedTexCoords() before painting.
Make SceneOpenGL::Window, BoxSwitchEffect, and ExplosionEffect use the new classes.
svn path=/branches/work/kwin_composite/; revision=645125
2007-03-21 18:14:09 +00:00
|
|
|
class GLTexture;
|
2007-03-16 13:02:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Makes windows explode into small pieces when they're closed
|
|
|
|
**/
|
|
|
|
class ExplosionEffect
|
|
|
|
: public Effect
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ExplosionEffect();
|
|
|
|
|
|
|
|
virtual void prePaintScreen( int* mask, QRegion* region, int time );
|
2007-03-25 10:48:07 +00:00
|
|
|
virtual void prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, QRegion* clip, int time );
|
2007-03-16 13:02:47 +00:00
|
|
|
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
|
|
|
|
virtual void postPaintScreen();
|
|
|
|
|
|
|
|
virtual void windowClosed( EffectWindow* c );
|
|
|
|
virtual void windowDeleted( EffectWindow* c );
|
|
|
|
|
2007-04-21 12:57:15 +00:00
|
|
|
static bool supported();
|
|
|
|
|
2007-03-16 13:02:47 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool loadData();
|
|
|
|
|
|
|
|
private:
|
|
|
|
GLShader* mShader;
|
Add GLTexture class. This is a convenient wrapper around managing an OpenGL texture, as well as loading an image into it. Includes support for loading from QImage, QPixmap, and a file. Defaults to a GL_TEXTURE_2D target, and will scale image if necessary.
Also add SceneOpenGL::Texture class, based on GLTexture. Optimised for SceneOpenGL::Window, this adds support for loading from an X Pixmap, as well as taking advantage of texture_from_pixmap/shm when available. Automatically detects what texture target should be used, so be sure to enableUnnormalizedTexCoords() before painting.
Make SceneOpenGL::Window, BoxSwitchEffect, and ExplosionEffect use the new classes.
svn path=/branches/work/kwin_composite/; revision=645125
2007-03-21 18:14:09 +00:00
|
|
|
GLTexture* mStartOffsetTex;
|
|
|
|
GLTexture* mEndOffsetTex;
|
2007-03-16 13:02:47 +00:00
|
|
|
QMap< const EffectWindow*, double > mWindows;
|
|
|
|
int mActiveAnimations;
|
|
|
|
bool mValid;
|
|
|
|
bool mInited;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|