2006-09-29 16:49:34 +00:00
|
|
|
/*****************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
#ifndef KWIN_SCENE_OPENGL_H
|
|
|
|
#define KWIN_SCENE_OPENGL_H
|
|
|
|
|
|
|
|
#include "scene.h"
|
|
|
|
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glx.h>
|
|
|
|
|
|
|
|
namespace KWinInternal
|
|
|
|
{
|
|
|
|
|
|
|
|
class SceneOpenGL
|
|
|
|
: public Scene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SceneOpenGL( Workspace* ws );
|
|
|
|
virtual ~SceneOpenGL();
|
2006-09-30 15:40:03 +00:00
|
|
|
virtual void paint( QRegion damage, ToplevelList windows );
|
2006-10-29 19:07:10 +00:00
|
|
|
virtual void postPaint();
|
2006-10-01 21:14:53 +00:00
|
|
|
virtual void windowGeometryShapeChanged( Toplevel* );
|
|
|
|
virtual void windowOpacityChanged( Toplevel* );
|
|
|
|
virtual void windowAdded( Toplevel* );
|
|
|
|
virtual void windowDeleted( Toplevel* );
|
2006-10-16 21:06:34 +00:00
|
|
|
protected:
|
2006-10-21 18:07:00 +00:00
|
|
|
virtual void paintGenericScreen( int mask, ScreenPaintData data );
|
|
|
|
virtual void paintSimpleScreen( int mask, QRegion region );
|
2006-10-16 21:06:34 +00:00
|
|
|
virtual void paintBackground( QRegion region );
|
2006-09-29 16:49:34 +00:00
|
|
|
private:
|
2006-10-08 20:31:00 +00:00
|
|
|
void initBuffer();
|
2006-11-07 22:44:39 +00:00
|
|
|
bool findConfig( const int* attrs, GLXFBConfig* config, VisualID visual = None );
|
2006-09-29 19:05:36 +00:00
|
|
|
typedef GLuint Texture;
|
2006-09-29 16:49:34 +00:00
|
|
|
GC gcroot;
|
2006-10-08 20:31:00 +00:00
|
|
|
Drawable buffer;
|
2006-11-07 22:44:39 +00:00
|
|
|
GLXFBConfig fbcbuffer;
|
|
|
|
static bool db;
|
2006-09-29 19:05:36 +00:00
|
|
|
static GLXFBConfig fbcdrawable;
|
2006-11-07 22:44:39 +00:00
|
|
|
static GLXDrawable glxbuffer;
|
|
|
|
static GLXContext ctxbuffer;
|
2006-10-07 21:23:46 +00:00
|
|
|
static bool tfp_mode;
|
2006-10-21 15:23:01 +00:00
|
|
|
static bool copy_buffer_hack;
|
2006-11-07 23:33:23 +00:00
|
|
|
static bool supports_saturation;
|
2006-10-16 21:06:34 +00:00
|
|
|
class Window;
|
2006-09-29 19:05:36 +00:00
|
|
|
QMap< Toplevel*, Window > windows;
|
2006-09-29 16:49:34 +00:00
|
|
|
};
|
|
|
|
|
2006-09-29 19:05:36 +00:00
|
|
|
class SceneOpenGL::Window
|
2006-10-15 08:58:38 +00:00
|
|
|
: public Scene::Window
|
2006-09-29 19:05:36 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Window( Toplevel* c );
|
2006-10-16 21:06:34 +00:00
|
|
|
virtual void free();
|
2006-10-22 10:15:19 +00:00
|
|
|
virtual void performPaint( int mask, QRegion region, WindowPaintData data );
|
2006-09-30 16:17:54 +00:00
|
|
|
void bindTexture();
|
2006-09-29 19:05:36 +00:00
|
|
|
void discardTexture();
|
2006-09-30 17:28:27 +00:00
|
|
|
Window() {} // QMap sucks even in Qt4
|
|
|
|
private:
|
2006-09-30 16:17:54 +00:00
|
|
|
Texture texture;
|
2006-10-29 19:23:45 +00:00
|
|
|
bool texture_y_inverted; // texture has y inverted
|
|
|
|
Pixmap bound_pixmap; // the pixmap the texture is bound to, only for tfp_mode
|
|
|
|
GLXPixmap bound_glxpixmap; // the glx pixmap the texture is bound to, only for tfp_mode
|
2006-09-29 19:05:36 +00:00
|
|
|
};
|
|
|
|
|
2006-09-29 16:49:34 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|