Class opengl_renderbuffer

| Home | Libraries | People | FAQ | More

## Class opengl_renderbuffer

boost::compute::opengl_renderbuffer

## Synopsis

    // In header: <boost/compute/interop/opengl/opengl_renderbuffer.hpp>

    class opengl_renderbuffer : public boost::compute::image_object {
    public:
      // construct/copy/destruct
      opengl_renderbuffer();
      explicit opengl_renderbuffer(cl_mem, bool = true);
      opengl_renderbuffer(const context &, GLuint, cl_mem_flags = read_write);
      opengl_renderbuffer(const opengl_renderbuffer &);
      opengl_renderbuffer & operator=(const opengl_renderbuffer &);
      ~opengl_renderbuffer();

      // public member functions
      extents< 2 > size() const;
      extents< 2 > origin() const;
      GLuint get_opengl_object() const;
      cl_gl_object_type get_opengl_type() const;
    };

## Description

A OpenCL buffer for accessing an OpenGL renderbuffer object.

### `opengl_renderbuffer` public construct/copy/destruct

1.     opengl_renderbuffer();

   Creates a null OpenGL renderbuffer object.

2.     explicit opengl_renderbuffer(cl_mem mem, bool retain = true);

   Creates a new OpenGL renderbuffer object for `mem`.

3.     opengl_renderbuffer(const context & context, GLuint renderbuffer,
                           cl_mem_flags flags = read_write);

   Creates a new OpenGL renderbuffer object in `context` for `renderbuffer` with `flags`.

   See the documentation for clCreateFromGLRenderbuffer() for more information.

4.     opengl_renderbuffer(const opengl_renderbuffer & other);

   Creates a new OpenGL renderbuffer object as a copy of `other`.

5.     opengl_renderbuffer & operator=(const opengl_renderbuffer & other);

   Copies the OpenGL renderbuffer object from `other`.

6.     ~opengl_renderbuffer();

   Destroys the OpenGL buffer object.

### `opengl_renderbuffer` public member functions

1.     extents< 2 > size() const;

   Returns the size (width, height) of the renderbuffer.

2.     extents< 2 > origin() const;

   Returns the origin of the renderbuffer (`0`, `0`).

3.     GLuint get_opengl_object() const;

   Returns the OpenGL memory object ID.

   See the documentation for clGetGLObjectInfo() for more information.

4.     cl_gl_object_type get_opengl_type() const;

   Returns the OpenGL memory object type.

   See the documentation for clGetGLObjectInfo() for more information.