SCM Library
Spherical Cube Map rendering library
 All Classes Files Functions Variables Friends Pages
scm-frame.hpp
1 // Copyright (C) 2011-2013 Robert Kooima
2 //
3 // LIBSCM is free software; you can redistribute it and/or modify it under the
4 // terms of the GNU General Public License as published by the Free Software
5 // Foundation; either version 2 of the License, or (at your option) any later
6 // version.
7 //
8 // This program is distributed in the hope that it will be useful, but WITH-
9 // OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 // more details.
12 
13 #ifndef SCM_FRAME_HPP
14 #define SCM_FRAME_HPP
15 
16 #include <GL/glew.h>
17 
18 //------------------------------------------------------------------------------
19 
21 
22 class scm_frame
23 {
24 public:
25 
26  scm_frame(GLsizei, GLsizei);
27  ~scm_frame();
28 
29  void bind_frame() const;
30  void bind_color() const;
31  void bind_depth() const;
32 
33 private:
34 
35  GLuint frame;
36  GLuint color;
37  GLuint depth;
38  GLsizei width;
39  GLsizei height;
40 
41  void init_color();
42  void init_depth();
43  void init_frame();
44 };
45 
46 //------------------------------------------------------------------------------
47 
48 #endif
scm_frame(GLsizei, GLsizei)
Create a new OpenGL framebuffer object with color and depth textures.
Definition: scm-frame.cpp:23
~scm_frame()
Delete the framebuffer object and its textures.
Definition: scm-frame.cpp:36
An scm_frame abstracts the OpenGL framebuffer object.
Definition: scm-frame.hpp:22
void bind_color() const
Bind the color texture.
Definition: scm-frame.cpp:52
void bind_depth() const
Bind the depth texture.
Definition: scm-frame.cpp:59
void bind_frame() const
Bind the framebuffer object as render target.
Definition: scm-frame.cpp:45