Mir
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 
36 {
37 public:
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_fbo;
62  GLint old_viewport[4];
63 };
64 
65 }
66 }
67 
68 #endif /* MIR_TOOLS_BUFFER_RENDER_TARGET_H_ */
Definition: as_render_target.h:27
bool make_current(mrg::RenderTarget *render_target)
Definition: server_example_adorning_compositor.cpp:39
Definition: buffer.h:44
Definition: buffer_render_target.h:35

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 13:49:26 UTC 2017