| Home | Libraries | People | FAQ | More

## Class opengl_buffer

boost::compute::opengl_buffer

## Synopsis

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

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

      // public member functions
      GLuint get_opengl_object() const;
      cl_gl_object_type get_opengl_type() const;
    };

## Description

A OpenCL buffer for accessing an OpenGL memory object.

### `opengl_buffer` public construct/copy/destruct

1.     opengl_buffer();

   Creates a null OpenGL buffer object.

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

   Creates a new OpenGL buffer object for `mem`.

3.     opengl_buffer(const context & context, GLuint bufobj,
                     cl_mem_flags flags = read_write);

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

   See the documentation for clCreateFromGLBuffer() for more information.

4.     opengl_buffer(const opengl_buffer & other);

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

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

   Copies the OpenGL buffer object from `other`.

6.     ~opengl_buffer();

   Destroys the OpenGL buffer object.

### `opengl_buffer` public member functions

1.     GLuint get_opengl_object() const;

   Returns the OpenGL memory object ID.

   See the documentation for clGetGLObjectInfo() for more information.

2.     cl_gl_object_type get_opengl_type() const;

   Returns the OpenGL memory object type.

   See the documentation for clGetGLObjectInfo() for more information.