2
* Copyright © 2008 Dennis Kasprzyk
3
* Copyright © 2007 Novell, Inc.
5
* Permission to use, copy, modify, distribute, and sell this software
6
* and its documentation for any purpose is hereby granted without
7
* fee, provided that the above copyright notice appear in all copies
8
* and that both that copyright notice and this permission notice
9
* appear in supporting documentation, and that the name of
10
* Dennis Kasprzyk not be used in advertising or publicity pertaining to
11
* distribution of the software without specific, written prior permission.
12
* Dennis Kasprzyk makes no representations about the suitability of this
13
* software for any purpose. It is provided "as is" without express or
16
* DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
18
* NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
22
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
* Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
25
* David Reveman <davidr@novell.com>
28
#ifndef _OPENGL_PRIVATES_H
29
#define _OPENGL_PRIVATES_H
31
#include <composite/composite.h>
32
#include <opengl/opengl.h>
33
#include <core/atoms.h>
35
#include "privatefragment.h"
36
#include "privatetexture.h"
38
#define GL_OPTION_TEXTURE_FILTER 0
39
#define GL_OPTION_LIGHTING 1
40
#define GL_OPTION_SYNC_TO_VBLANK 2
41
#define GL_OPTION_TEXTURE_COMPRESSION 3
42
#define GL_OPTION_NUM 4
44
extern CompPlugin::VTable *openglVTable;
46
extern const CompMetadata::OptionInfo
47
glOptionInfo[GL_OPTION_NUM];
49
extern CompOutput *targetOutput;
54
GLIcon () : icon (NULL) {};
57
GLTexture::List textures;
60
class PrivateGLScreen :
61
public ScreenInterface,
62
public CompositeScreen::PaintHandler
65
PrivateGLScreen (GLScreen *gs);
68
void handleEvent (XEvent *event);
70
void outputChangeNotify ();
72
void paintOutputs (CompOutput::ptrList &outputs,
74
const CompRegion ®ion);
78
void prepareDrawing ();
80
void waitForVideoSync ();
82
void paintBackground (const CompRegion ®ion,
85
void paintOutputRegion (const GLMatrix &transform,
86
const CompRegion ®ion,
90
void updateScreenBackground ();
97
CompositeScreen *cScreen;
101
GLFBConfig glxPixmapFBConfigs[MAX_DEPTH + 1];
103
GLTexture::List backgroundTextures;
104
bool backgroundLoaded;
106
GLTexture::Filter filter[3];
110
GLFragment::Storage fragmentStorage;
112
GLfloat projection[16];
117
GL::GLXGetProcAddressProc getProcAddress;
121
CompRegion outputRegion;
123
bool pendingCommands;
125
XRectangle lastViewport;
127
std::vector<GLTexture::BindPixmapProc> bindPixmap;
132
CompOption::Vector opt;
135
class PrivateGLWindow :
136
public WindowInterface,
137
public CompositeWindowInterface
140
PrivateGLWindow (CompWindow *w, GLWindow *gw);
143
void windowNotify (CompWindowNotify n);
144
void resizeNotify (int dx, int dy, int dwidth, int dheight);
145
void moveNotify (int dx, int dy, bool now);
146
void updateFrameRegion (CompRegion ®ion);
148
void setWindowMatrix ();
149
void updateWindowRegions ();
153
CompositeWindow *cWindow;
156
GLTexture::List textures;
157
GLTexture::MatrixList matrices;
158
CompRegion::Vector regions;
170
GLWindowPaintAttrib paint;
171
GLWindowPaintAttrib lastPaint;
173
unsigned int lastMask;
175
GLWindow::Geometry geometry;
177
std::list<GLIcon> icons;