~mc-return/compiz/compiz.merge-src-screen.cpp-improvements

« back to all changes in this revision

Viewing changes to plugins/opengl/privates.h

  • Committer: Dennis kasprzyk
  • Author(s): Dennis Kasprzyk
  • Date: 2009-03-15 05:09:18 UTC
  • Revision ID: git-v1:163f6b6f3c3b7764987cbdf8e03cc355edeaa499
New generalized build system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2008 Dennis Kasprzyk
3
 
 * Copyright © 2007 Novell, Inc.
4
 
 *
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
14
 
 * implied warranty.
15
 
 *
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.
23
 
 *
24
 
 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
25
 
 *          David Reveman <davidr@novell.com>
26
 
 */
27
 
 
28
 
#ifndef _OPENGL_PRIVATES_H
29
 
#define _OPENGL_PRIVATES_H
30
 
 
31
 
#include <composite/composite.h>
32
 
#include <opengl/opengl.h>
33
 
#include <core/atoms.h>
34
 
 
35
 
#include "privatefragment.h"
36
 
#include "privatetexture.h"
37
 
 
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
43
 
 
44
 
extern CompPlugin::VTable *openglVTable;
45
 
 
46
 
extern const CompMetadata::OptionInfo
47
 
    glOptionInfo[GL_OPTION_NUM];
48
 
 
49
 
extern CompOutput *targetOutput;
50
 
 
51
 
class GLIcon
52
 
{
53
 
    public:
54
 
        GLIcon () : icon (NULL) {};
55
 
        
56
 
        CompIcon        *icon;
57
 
        GLTexture::List textures;
58
 
};
59
 
 
60
 
class PrivateGLScreen :
61
 
    public ScreenInterface,
62
 
    public CompositeScreen::PaintHandler
63
 
{
64
 
    public:
65
 
        PrivateGLScreen (GLScreen *gs);
66
 
        ~PrivateGLScreen ();
67
 
 
68
 
        void handleEvent (XEvent *event);
69
 
 
70
 
        void outputChangeNotify ();
71
 
 
72
 
        void paintOutputs (CompOutput::ptrList &outputs,
73
 
                           unsigned int        mask,
74
 
                           const CompRegion    &region);
75
 
 
76
 
        bool hasVSync ();
77
 
 
78
 
        void prepareDrawing ();
79
 
 
80
 
        void waitForVideoSync ();
81
 
 
82
 
        void paintBackground (const CompRegion &region,
83
 
                              bool             transformed);
84
 
 
85
 
        void paintOutputRegion (const GLMatrix   &transform,
86
 
                                const CompRegion &region,
87
 
                                CompOutput       *output,
88
 
                                unsigned int     mask);
89
 
 
90
 
        void updateScreenBackground ();
91
 
 
92
 
        void updateView ();
93
 
 
94
 
    public:
95
 
 
96
 
        GLScreen        *gScreen;
97
 
        CompositeScreen *cScreen;
98
 
 
99
 
        GLenum textureFilter;
100
 
 
101
 
        GLFBConfig      glxPixmapFBConfigs[MAX_DEPTH + 1];
102
 
 
103
 
        GLTexture::List backgroundTextures;
104
 
        bool            backgroundLoaded;
105
 
 
106
 
        GLTexture::Filter filter[3];
107
 
 
108
 
        CompPoint rasterPos;
109
 
 
110
 
        GLFragment::Storage fragmentStorage;
111
 
 
112
 
        GLfloat projection[16];
113
 
 
114
 
        bool clearBuffers;
115
 
        bool lighting;
116
 
 
117
 
        GL::GLXGetProcAddressProc getProcAddress;
118
 
 
119
 
        GLXContext ctx;
120
 
 
121
 
        CompRegion outputRegion;
122
 
 
123
 
        bool pendingCommands;
124
 
 
125
 
        XRectangle lastViewport;
126
 
 
127
 
        std::vector<GLTexture::BindPixmapProc> bindPixmap;
128
 
        bool hasCompositing;
129
 
 
130
 
        GLIcon defaultIcon;
131
 
 
132
 
        CompOption::Vector opt;
133
 
};
134
 
 
135
 
class PrivateGLWindow :
136
 
    public WindowInterface,
137
 
    public CompositeWindowInterface
138
 
{
139
 
    public:
140
 
        PrivateGLWindow (CompWindow *w, GLWindow *gw);
141
 
        ~PrivateGLWindow ();
142
 
 
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 &region);
147
 
        
148
 
        void setWindowMatrix ();
149
 
        void updateWindowRegions ();
150
 
 
151
 
        CompWindow      *window;
152
 
        GLWindow        *gWindow;
153
 
        CompositeWindow *cWindow;
154
 
        GLScreen        *gScreen;
155
 
 
156
 
        GLTexture::List       textures;
157
 
        GLTexture::MatrixList matrices;
158
 
        CompRegion::Vector    regions;
159
 
        bool                  updateReg;
160
 
        
161
 
        CompRegion    clip;
162
 
        
163
 
        bool          bindFailed;
164
 
        bool          overlayWindow;
165
 
 
166
 
        GLushort opacity;
167
 
        GLushort brightness;
168
 
        GLushort saturation;
169
 
 
170
 
        GLWindowPaintAttrib paint;
171
 
        GLWindowPaintAttrib lastPaint;
172
 
 
173
 
        unsigned int lastMask;
174
 
 
175
 
        GLWindow::Geometry geometry;
176
 
 
177
 
        std::list<GLIcon> icons;
178
 
};
179
 
 
180
 
 
181
 
#endif