OGLplus (0.52.0) a C++ wrapper for OpenGL

buffer_selection.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #ifndef OGLPLUS_CONTEXT_BUFFER_SELECTION_1201040722_HPP
13 #define OGLPLUS_CONTEXT_BUFFER_SELECTION_1201040722_HPP
14 
15 #include <oglplus/glfunc.hpp>
16 #include <oglplus/color_buffer.hpp>
18 #include <oglplus/one_of.hpp>
19 
20 namespace oglplus {
21 namespace context {
22 
24 
28 {
29 public:
31  typedef OneOf<
32  GLenum,
33  std::tuple<
36  >
38 
39 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_0
40 
45  static void DrawBuffer(ColorBuffer buffer)
46  {
47  OGLPLUS_GLFUNC(DrawBuffer)(GLenum(buffer));
48  OGLPLUS_VERIFY_SIMPLE(DrawBuffer);
49  }
50 
52 
56  static void DrawBuffers(const EnumArray<ColorBuffer>& buffers)
57  {
58  OGLPLUS_GLFUNC(DrawBuffers)(
59  buffers.Count(),
60  buffers.Values()
61  );
62  OGLPLUS_VERIFY_SIMPLE(DrawBuffers);
63  }
64 
65  static void DrawBuffers(GLsizei count, const ColorBuffer* buffers)
66  {
67  DrawBuffers(oglplus::EnumArray<ColorBuffer>(count, buffers));
68  }
69 #endif // GL_VERSION_3_0
70 
72 
76  static void ReadBuffer(ColorBuffer buffer)
77  {
78  OGLPLUS_GLFUNC(ReadBuffer)(GLenum(buffer));
79  OGLPLUS_VERIFY_SIMPLE(ReadBuffer);
80  }
81 };
82 
83 } // namespace context
84 } // namespace oglplus
85 
86 #endif // include guard
OpenGL Color buffer enumeration.
static void DrawBuffers(const EnumArray< ColorBuffer > &buffers)
Sets the destination color buffers for draw operations.
Definition: buffer_selection.hpp:56
Wrappers for functions selecting the buffers for read/write operations.
Definition: buffer_selection.hpp:27
static void DrawBuffer(ColorBuffer buffer)
Sets the destination color buffer for draw operations.
Definition: buffer_selection.hpp:45
static void ReadBuffer(ColorBuffer buffer)
Sets the source color buffer for read operations.
Definition: buffer_selection.hpp:76
COLOR_BUFFER_BIT: Clear the color buffer.
Helper macro for optional checking of availability of GL function.
Stores a value having one of the listed types in a common representation.
Definition: one_of.hpp:60
OneOf< GLenum, std::tuple< oglplus::ColorBuffer, oglplus::FramebufferColorAttachment > > ColorBuffer
Color buffer specification type.
Definition: buffer_selection.hpp:37
OpenGL Framebuffer attachment enumerations.
ColorBuffer
Enumeration of color buffers for read/write operations.
Definition: color_buffer.hpp:28
Variant helper class used mostly with enums.
FramebufferColorAttachment
Framebuffer color attachment points.
Definition: framebuffer_attachment.hpp:72

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).