Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
examples
buffer_render_target.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2012 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17
*/
18
19
#ifndef MIR_TOOLS_BUFFER_RENDER_TARGET_H_
20
#define MIR_TOOLS_BUFFER_RENDER_TARGET_H_
21
22
#include <EGL/egl.h>
23
#include <EGL/eglext.h>
24
#include <GLES2/gl2.h>
25
26
namespace
mir
27
{
28
namespace
graphics
29
{
30
class
Buffer;
31
}
32
namespace
tools
33
{
34
35
class
BufferRenderTarget
36
{
37
public
:
38
BufferRenderTarget
(
mir::graphics::Buffer
& buffer);
39
~BufferRenderTarget
();
40
41
void
make_current
();
42
43
private
:
44
class
Resources
45
{
46
public
:
47
Resources()
48
: fbo{0}, color_tex{0}, depth_rbo{0}
49
{
50
}
51
~Resources();
52
void
setup(
mir::graphics::Buffer
& buffer);
53
54
GLuint fbo;
55
GLuint color_tex;
56
GLuint depth_rbo;
57
};
58
59
Resources resources;
60
mir::graphics::Buffer
& buffer;
61
GLint old_viewport[4];
62
};
63
64
}
65
}
66
67
#endif
/* MIR_TOOLS_BUFFER_RENDER_TARGET_H_ */
Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013