1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
5
* Copyright (c) 2010-11 Canonical Ltd.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
20
#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
21
#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
23
#ifndef USE_MODERN_COMPIZ_GL
28
class ScreenEffectFramebufferObject
32
typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
33
typedef void (*FuncPtr) (void);
34
typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
36
ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
37
~ScreenEffectFramebufferObject ();
41
void bind (const nux::Geometry &geom);
45
void paint (const nux::Geometry &geom);
46
bool bound () { return mBoundCnt > 0; }
48
GLuint texture () { return mFBTexture; }
50
void onScreenSizeChanged (const nux::Geometry &screenSize);
54
FuncPtr getProcAddr (const std::string &);
56
typedef void (*GLActiveTextureProc) (GLenum texture);
57
typedef void (*GLGenFramebuffersProc) (GLsizei n,
58
GLuint *framebuffers);
59
typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
60
GLuint *framebuffers);
61
typedef void (*GLBindFramebufferProc) (GLenum target,
63
typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
64
typedef void (*GLFramebufferTexture2DProc) (GLenum target,
70
GLXGetProcAddressProc getProcAddressGLX;
71
GLActiveTextureProc activeTexture;
72
GLGenFramebuffersProc genFramebuffers;
73
GLDeleteFramebuffersProc deleteFramebuffers;
74
GLBindFramebufferProc bindFramebuffer;
75
GLCheckFramebufferStatusProc checkFramebufferStatus;
76
GLFramebufferTexture2DProc framebufferTexture2D;
77
/* compiz fbo handle that goes through to nux */
78
GLuint mFboHandle; // actual handle to the framebuffer_ext
79
bool mFboStatus; // did the framebuffer texture bind succeed
81
nux::Geometry mGeometry;
82
unsigned int mBoundCnt;
84
nux::Geometry mScreenSize;
88
#endif // USE_MODERN_COMPIZ_GL