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
27
class ScreenEffectFramebufferObject
31
typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
32
typedef void (*FuncPtr) (void);
33
typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
35
ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
36
~ScreenEffectFramebufferObject ();
40
void bind (const nux::Geometry &geom);
44
void paint (const nux::Geometry &geom);
45
bool bound () { return mBoundCnt > 0; }
47
GLuint texture () { return mFBTexture; }
49
void onScreenSizeChanged (const nux::Geometry &screenSize);
53
FuncPtr getProcAddr (const std::string &);
55
typedef void (*GLActiveTextureProc) (GLenum texture);
56
typedef void (*GLGenFramebuffersProc) (GLsizei n,
57
GLuint *framebuffers);
58
typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
59
GLuint *framebuffers);
60
typedef void (*GLBindFramebufferProc) (GLenum target,
62
typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
63
typedef void (*GLFramebufferTexture2DProc) (GLenum target,
69
GLXGetProcAddressProc getProcAddressGLX;
70
GLActiveTextureProc activeTexture;
71
GLGenFramebuffersProc genFramebuffers;
72
GLDeleteFramebuffersProc deleteFramebuffers;
73
GLBindFramebufferProc bindFramebuffer;
74
GLCheckFramebufferStatusProc checkFramebufferStatus;
75
GLFramebufferTexture2DProc framebufferTexture2D;
76
/* compiz fbo handle that goes through to nux */
77
GLuint mFboHandle; // actual handle to the framebuffer_ext
78
bool mFboStatus; // did the framebuffer texture bind succeed
80
nux::Geometry mGeometry;
81
unsigned int mBoundCnt;
83
nux::Geometry mScreenSize;