OGLplus (0.52.0) a C++ wrapper for OpenGL

ARB_copy_image.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_EXT_ARB_COPY_IMAGE_1406270722_HPP
14 #define OGLPLUS_EXT_ARB_COPY_IMAGE_1406270722_HPP
15 
16 #if OGLPLUS_DOCUMENTATION_ONLY || GL_ARB_copy_image
17 
18 #include <oglplus/object/name.hpp>
19 #include <oglplus/error/object.hpp>
20 #include <oglplus/extension.hpp>
21 
22 namespace oglplus {
23 
25 
32 {
33 private:
34  template <typename SrcObjTag, typename DstObjTag>
35  static void _chk_params(void)
36  {
37  static_assert(
38  std::is_same<SrcObjTag, tag::Texture>() ||
39  std::is_same<SrcObjTag, tag::Renderbuffer>(),
40  "Source object must be a Texture or a Renderbuffer"
41  );
42  static_assert(
43  std::is_same<DstObjTag, tag::Texture>() ||
44  std::is_same<DstObjTag, tag::Renderbuffer>(),
45  "Destination object must be a Texture or a Renderbuffer"
46  );
47  }
48 public:
49  OGLPLUS_EXTENSION_CLASS(ARB, copy_image)
50 
51  template <typename SrcObjTag, typename DstObjTag>
52  static void CopyImageSubData(
53  ObjectName<SrcObjTag> src_name,
54  typename ObjBindingOps<SrcObjTag>::Target src_target,
55  GLint src_level,
56  GLint src_x, GLint src_y, GLint src_z,
57  ObjectName<DstObjTag> dst_name,
58  typename ObjBindingOps<DstObjTag>::Target dst_target,
59  GLint dst_level,
60  GLint dst_x, GLint dst_y, GLint dst_z,
61  GLsizei width, GLsizei height, GLsizei depth
62  )
63  {
64  _chk_params<SrcObjTag, DstObjTag>();
65  OGLPLUS_GLFUNC(CopyImageSubData)(
66  GetGLName(src_name),
67  GLenum(src_target),
68  src_level,
69  src_x, src_y, src_z,
70  GetGLName(dst_name),
71  GLenum(dst_target),
72  dst_level,
73  dst_x, dst_y, dst_z,
74  width, height, depth
75  );
76  OGLPLUS_CHECK(
77  CopyImageSubData,
78  ObjectPairError,
79  Subject(dst_name).
80  SubjectBinding(dst_target).
81  Object(src_name).
82  ObjectBinding(src_target)
83  );
84  }
85 };
86 
87 } // namespace oglplus
88 
89 #endif // ARB_copy_image
90 
91 #endif // include guard
Funcions and classes for handling and wrapping OpenGL extensions.
Wrapper for the ARB_copy_image extension.
Definition: ARB_copy_image.hpp:31
Declaration of OGLplus object-related error.
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
Base class for OpenGL "named" objects.
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136

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).